From b6548a202db1a596e93ae8e9e024ff417eea8f53 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Tue, 12 May 2020 14:51:39 -0400 Subject: [PATCH] Fix Continuation Indent --- .clang-format | 1 + AppKit/CoreData_/NSPersistentDocument.h | 12 +- AppKit/CoreData_/NSPersistentDocument.m | 18 +- AppKit/CoreData_/_NSManagedProxy.h | 12 +- AppKit/CoreData_/_NSManagedProxy.m | 24 +- AppKit/MacWorkspace.m | 17 +- AppKit/NSAccessibility.m | 466 ++++----- AppKit/NSAlert.m | 85 +- AppKit/NSAlertPanel.h | 10 +- AppKit/NSAlertPanel.m | 39 +- AppKit/NSAnimation/NSAnimation.m | 10 +- AppKit/NSAnimation/NSViewAnimation.m | 16 +- AppKit/NSAppearance.m | 10 +- AppKit/NSApplication.m | 377 +++---- AppKit/NSAttributedString.m | 84 +- AppKit/NSBezierPath.m | 93 +- AppKit/NSBitmapImageRep.m | 109 +- AppKit/NSBox.m | 22 +- AppKit/NSBrowser.m | 67 +- AppKit/NSBrowserCell.m | 24 +- AppKit/NSButton.m | 8 +- AppKit/NSButtonCell.m | 135 +-- AppKit/NSCachedImageRep.m | 18 +- AppKit/NSCell.m | 83 +- AppKit/NSClipView.m | 44 +- AppKit/NSCoder+AppKit.m | 8 +- AppKit/NSCollectionViewFlowLayout.m | 4 +- AppKit/NSCollectionViewLayout.m | 4 +- AppKit/NSColor.subproj/NSColor.m | 61 +- AppKit/NSColor.subproj/NSColor_CGColor.m | 30 +- AppKit/NSColor.subproj/NSColor_catalog.m | 4 +- AppKit/NSColorList.m | 20 +- AppKit/NSColorPanel.m | 51 +- .../NSColorPickerColorList.m | 23 +- .../NSColorPickerSliders.m | 63 +- .../NSColorPickerWheel.m | 15 +- .../NSColorPickerWheelView.m | 6 +- AppKit/NSColorSpace.m | 4 +- AppKit/NSColorWell.m | 72 +- AppKit/NSComboBox.m | 18 +- AppKit/NSComboBoxCell.m | 30 +- AppKit/NSComboBoxView.m | 14 +- AppKit/NSComboBoxWindow.m | 8 +- AppKit/NSControl.m | 59 +- AppKit/NSController/NSArrayController.m | 46 +- AppKit/NSController/NSController.m | 6 +- .../NSController/NSControllerSelectionProxy.m | 49 +- AppKit/NSController/NSDictionaryController.m | 16 +- AppKit/NSController/NSObjectController.m | 18 +- AppKit/NSController/NSObservationProxy.m | 6 +- .../NSController/NSUserDefaultsController.m | 6 +- .../NSUserDefaultsControllerProxy.m | 8 +- AppKit/NSController/_NSControllerArray.m | 70 +- AppKit/NSCursor.m | 14 +- AppKit/NSDatePickerCell.m | 102 +- AppKit/NSDisplay.m | 31 +- AppKit/NSDocument.m | 428 ++++---- AppKit/NSDocumentController.m | 95 +- AppKit/NSDrawer.subproj/NSDrawer.m | 121 ++- AppKit/NSDrawer.subproj/NSDrawerWindow.m | 2 +- AppKit/NSErrors.m | 24 +- AppKit/NSEvent.subproj/NSEvent.m | 64 +- AppKit/NSEvent.subproj/NSEvent_CoreGraphics.m | 12 +- AppKit/NSEvent.subproj/NSEvent_keyboard.h | 14 +- AppKit/NSEvent.subproj/NSEvent_keyboard.m | 20 +- AppKit/NSEvent.subproj/NSEvent_mouse.m | 18 +- AppKit/NSEvent.subproj/NSEvent_other.h | 16 +- AppKit/NSEvent.subproj/NSEvent_other.m | 16 +- AppKit/NSEvent_keyboard.h | 14 +- AppKit/NSEvent_other.h | 16 +- AppKit/NSFont.m | 89 +- AppKit/NSFontDescriptor.m | 42 +- AppKit/NSFontFamily.m | 2 +- AppKit/NSFontManager.m | 53 +- AppKit/NSFontMetric.h | 4 +- AppKit/NSFontMetric.m | 4 +- AppKit/NSFontPanel.m | 25 +- AppKit/NSFontTypeface.h | 10 +- AppKit/NSFontTypeface.m | 10 +- AppKit/NSFormCell.m | 11 +- AppKit/NSGlyphGenerator.m | 10 +- AppKit/NSGlyphInfo.m | 8 +- AppKit/NSGradient.m | 20 +- AppKit/NSGraphics.m | 28 +- AppKit/NSGraphicsContext.m | 44 +- AppKit/NSImage.m | 160 +-- AppKit/NSImageRep.m | 14 +- AppKit/NSImageView.m | 2 +- AppKit/NSInterfacePart/NSGraphicsStyle.m | 103 +- .../NSInterfacePartAttributedString.m | 4 +- AppKit/NSKeyValueBinding.m | 20 +- AppKit/NSKeyValueBinding/NSBinder.m | 50 +- AppKit/NSKeyValueBinding/NSCachingBinder.m | 4 +- AppKit/NSKeyValueBinding/NSKVOBinder.m | 48 +- .../NSKeyValueBinding/NSMultipleValueBinder.m | 55 +- .../NSObject+BindingSupport.h | 6 +- .../NSObject+BindingSupport.m | 41 +- AppKit/NSKeyValueBinding/NSTextBinder.m | 30 +- AppKit/NSKeyValueBinding/NSTextFieldBinder.m | 20 +- AppKit/NSKeyboardBinding/NSKeyboardBinding.m | 6 +- .../NSKeyboardBindingManager.m | 36 +- AppKit/NSMatrix.m | 78 +- AppKit/NSMeasurementUnit.h | 8 +- AppKit/NSMeasurementUnit.m | 77 +- AppKit/NSMenu.subproj/NSMainMenuView.m | 35 +- AppKit/NSMenu.subproj/NSMenu.m | 32 +- AppKit/NSMenu.subproj/NSMenuItem.m | 24 +- AppKit/NSMenu.subproj/NSMenuView.m | 31 +- AppKit/NSMenu.subproj/NSMenuWindow.m | 4 +- AppKit/NSMenu.subproj/NSSubmenuView.m | 30 +- AppKit/NSMutableAttributedString.m | 35 +- AppKit/NSOpenGL/NSOpenGLContext.m | 20 +- AppKit/NSOpenGL/NSOpenGLPixelFormat.m | 6 +- AppKit/NSOpenGL/NSOpenGLView.m | 2 +- AppKit/NSOutlineView.m | 189 ++-- AppKit/NSPDFImageRep.m | 4 +- AppKit/NSPageLayout.m | 4 +- AppKit/NSPanel.m | 32 +- AppKit/NSParagraphStyle.m | 66 +- AppKit/NSPasteboard.m | 28 +- AppKit/NSPathCell.m | 38 +- AppKit/NSPathComponentCell.m | 10 +- AppKit/NSPersistentDocument.h | 12 +- AppKit/NSPoofAnimation.h | 8 +- AppKit/NSPoofAnimation.m | 34 +- AppKit/NSPopUpButton.m | 46 +- AppKit/NSPopUpButtonCell.m | 20 +- AppKit/NSPopUpView.m | 91 +- AppKit/NSPopUpWindow.m | 5 +- AppKit/NSPopover.m | 4 +- AppKit/NSPrintInfo.m | 35 +- AppKit/NSPrintOperation.m | 37 +- AppKit/NSPrintPanel.m | 10 +- AppKit/NSPrintProgressPanelController.m | 2 +- AppKit/NSProgressIndicator.m | 16 +- AppKit/NSResponder.m | 26 +- AppKit/NSRuleEditor.m | 2 +- AppKit/NSRulerMarker.m | 40 +- AppKit/NSRulerView.m | 64 +- AppKit/NSSavePanel.subproj/NSOpenPanel.m | 45 +- AppKit/NSSavePanel.subproj/NSSavePanel.m | 39 +- .../_NSFileSystemDataSource.m | 8 +- AppKit/NSScrollView.m | 66 +- AppKit/NSScroller.m | 34 +- AppKit/NSSearchFieldCell.m | 24 +- AppKit/NSSecureTextFieldCell.m | 2 +- AppKit/NSSegmentedControl/NSSegmentItem.m | 6 +- AppKit/NSSegmentedControl/NSSegmentedCell.m | 28 +- AppKit/NSSheetContext.m | 8 +- AppKit/NSSliderCell.m | 87 +- AppKit/NSSound.m | 9 +- AppKit/NSSpellChecker.m | 145 +-- AppKit/NSSpellingViewController.m | 32 +- AppKit/NSSplitView.m | 82 +- AppKit/NSStatusBar.m | 16 +- AppKit/NSStatusItem.m | 16 +- AppKit/NSStepperCell.m | 30 +- AppKit/NSStringDrawer.h | 10 +- AppKit/NSStringDrawer.m | 45 +- AppKit/NSStringDrawing.m | 6 +- AppKit/NSSystemInfoPanel/NSSystemInfoPanel.m | 48 +- AppKit/NSTabView.m | 39 +- AppKit/NSTabViewItem.m | 14 +- AppKit/NSTableColumn.m | 9 +- AppKit/NSTableHeaderCell.m | 8 +- AppKit/NSTableHeaderView.m | 42 +- AppKit/NSTableView.m | 356 +++---- AppKit/NSText.m | 4 +- AppKit/NSTextAttachmentCell.m | 14 +- AppKit/NSTextField.m | 54 +- AppKit/NSTextFieldCell.m | 22 +- AppKit/NSTextTable/NSTextBlock.m | 4 +- AppKit/NSTextTable/NSTextTableBlock.m | 8 +- AppKit/NSTextView.subproj/NSBidiHelper.m | 303 +++--- AppKit/NSTextView.subproj/NSLayoutManager.m | 530 +++++----- AppKit/NSTextView.subproj/NSRangeArray.m | 4 +- .../NSRulerMarker+NSTextExtensions.m | 90 +- .../NSSecureLayoutManager.m | 4 +- AppKit/NSTextView.subproj/NSSecureTextView.m | 2 +- AppKit/NSTextView.subproj/NSTextContainer.m | 42 +- AppKit/NSTextView.subproj/NSTextStorage.m | 43 +- .../NSTextStorage_concrete.m | 24 +- AppKit/NSTextView.subproj/NSTextTab.m | 2 +- AppKit/NSTextView.subproj/NSTextView.m | 882 ++++++++-------- .../NSTextView.subproj/NSTextViewSharedData.m | 12 +- AppKit/NSTextView.subproj/NSTypesetter.m | 48 +- .../NSTypesetter_concrete.m | 202 ++-- .../NSTextView.subproj/NSUndoTextOperation.m | 55 +- AppKit/NSThemeFrame.m | 16 +- AppKit/NSToolTipWindow.m | 22 +- AppKit/NSToolbar.subproj/NSToolbar.m | 153 +-- .../NSToolbarCustomizationPalette.m | 9 +- .../NSToolbarCustomizationView.m | 35 +- AppKit/NSToolbar.subproj/NSToolbarItem.m | 204 ++-- AppKit/NSToolbar.subproj/NSToolbarItemView.m | 48 +- AppKit/NSToolbar.subproj/NSToolbarView.m | 48 +- AppKit/NSTouchBarItem.m | 8 +- AppKit/NSTrackingArea.m | 26 +- AppKit/NSView.m | 217 ++-- AppKit/NSViewController.m | 2 +- AppKit/NSWindow-Drag.m | 4 +- AppKit/NSWindow-Private.h | 2 +- AppKit/NSWindow.m | 344 ++++--- AppKit/NSWindowAnimationContext.h | 2 +- AppKit/NSWindowAnimationContext.m | 26 +- AppKit/NSWindowController.m | 25 +- AppKit/NSWorkspace.m | 32 +- AppKit/RTF.subproj/NSRichTextReader.m | 91 +- AppKit/RTF.subproj/NSRichTextWriter.m | 73 +- AppKit/Win32.subproj/CGLContext.m | 62 +- AppKit/Win32.subproj/KTFont_gdi.m | 34 +- .../Win32.subproj/NSGraphicsStyle_uxtheme.m | 246 ++--- AppKit/Win32.subproj/NSOpenPanel-Win32.m | 61 +- AppKit/Win32.subproj/NSSavePanel-Win32.m | 32 +- AppKit/Win32.subproj/NSSound_DirectShow.m | 5 +- AppKit/Win32.subproj/NSSound_win32.m | 28 +- AppKit/Win32.subproj/O2Context_gdi+AppKit.h | 2 +- AppKit/Win32.subproj/O2Context_gdi+AppKit.m | 30 +- AppKit/Win32.subproj/Win32Display.m | 220 ++-- .../Win32DragSession.h | 2 +- .../Win32DragSession.m | 12 +- .../Win32DraggingManager.m | 7 +- .../Win32DropPasteboard.m | 8 +- .../Win32GeneralPasteboard.m | 20 +- .../Win32IDataObjectClient.m | 19 +- .../Win32IDataObjectServer.m | 22 +- .../Win32IDropSourceServer.m | 12 +- .../Win32IDropTargetServer.m | 26 +- .../Win32IEnumFORMATETCServer.m | 2 +- .../Win32IUnknownServer.m | 65 +- .../Win32Pasteboard.m | 8 +- .../Win32Window-Drag.m | 8 +- AppKit/Win32.subproj/Win32EventInputSource.m | 16 +- AppKit/Win32.subproj/Win32RunningCopyPipe.m | 28 +- AppKit/Win32.subproj/Win32Window.h | 6 +- AppKit/Win32.subproj/Win32Window.m | 163 +-- AppKit/Win32.subproj/Win32Workspace.m | 135 +-- AppKit/Win32.subproj/glweak.m | 14 +- AppKit/Win32.subproj/opengl_dll.m | 78 +- AppKit/X11.backend/X11Cursor.m | 16 +- AppKit/X11.backend/X11Display.m | 206 ++-- AppKit/X11.backend/X11KeySymToUCS.m | 956 ++++++++++-------- AppKit/X11.backend/X11Pasteboard.h | 2 +- AppKit/X11.backend/X11Pasteboard.m | 12 +- AppKit/X11.backend/X11SubWindow.m | 10 +- AppKit/X11.backend/X11Window.m | 80 +- AppKit/_NSManagedProxy.h | 12 +- .../include/AppKit/NSAccessibilityConstants.h | 30 +- AppKit/include/AppKit/NSAnimation.h | 6 +- AppKit/include/AppKit/NSAppearance.h | 4 +- AppKit/include/AppKit/NSApplication.h | 30 +- AppKit/include/AppKit/NSArrayController.h | 2 +- AppKit/include/AppKit/NSAttributedString.h | 36 +- AppKit/include/AppKit/NSBitmapImageRep.h | 2 +- AppKit/include/AppKit/NSBrowser.h | 20 +- AppKit/include/AppKit/NSCachedImageRep.h | 6 +- AppKit/include/AppKit/NSCell.h | 6 +- .../include/AppKit/NSCollectionViewLayout.h | 2 +- AppKit/include/AppKit/NSColor.h | 6 +- AppKit/include/AppKit/NSColorPanel.h | 2 +- AppKit/include/AppKit/NSControl.h | 16 +- AppKit/include/AppKit/NSCursor.h | 6 +- AppKit/include/AppKit/NSDatePickerCell.h | 4 +- AppKit/include/AppKit/NSDisplay.h | 20 +- AppKit/include/AppKit/NSDocument.h | 56 +- AppKit/include/AppKit/NSDocumentController.h | 14 +- AppKit/include/AppKit/NSEvent.h | 18 +- AppKit/include/AppKit/NSFontDescriptor.h | 4 +- AppKit/include/AppKit/NSFontManager.h | 2 +- AppKit/include/AppKit/NSGlyphGenerator.h | 6 +- AppKit/include/AppKit/NSGlyphInfo.h | 8 +- AppKit/include/AppKit/NSGradient.h | 6 +- AppKit/include/AppKit/NSGraphicsContext.h | 6 +- AppKit/include/AppKit/NSKeyValueBinding.h | 2 +- AppKit/include/AppKit/NSLayoutManager.h | 76 +- AppKit/include/AppKit/NSMatrix.h | 20 +- AppKit/include/AppKit/NSMenu.h | 6 +- AppKit/include/AppKit/NSNibLoading.h | 24 +- .../include/AppKit/NSObject+BindingSupport.h | 6 +- AppKit/include/AppKit/NSObjectController.h | 2 +- AppKit/include/AppKit/NSOpenGLContext.h | 12 +- AppKit/include/AppKit/NSOpenGLPixelFormat.h | 6 +- AppKit/include/AppKit/NSOutlineView.h | 34 +- AppKit/include/AppKit/NSPanel.h | 4 +- AppKit/include/AppKit/NSPasteboard.h | 6 +- AppKit/include/AppKit/NSPathControl.h | 8 +- AppKit/include/AppKit/NSResponder.h | 10 +- AppKit/include/AppKit/NSRulerMarker.h | 6 +- AppKit/include/AppKit/NSRulerView.h | 30 +- AppKit/include/AppKit/NSSpellChecker.h | 41 +- AppKit/include/AppKit/NSSplitView.h | 38 +- AppKit/include/AppKit/NSStringDrawing.h | 2 +- AppKit/include/AppKit/NSTabView.h | 6 +- AppKit/include/AppKit/NSTableView.h | 36 +- AppKit/include/AppKit/NSTextAttachmentCell.h | 10 +- AppKit/include/AppKit/NSTextBlock.h | 6 +- AppKit/include/AppKit/NSTextStorage.h | 4 +- AppKit/include/AppKit/NSTextTableBlock.h | 8 +- AppKit/include/AppKit/NSTextView.h | 36 +- AppKit/include/AppKit/NSToolbar.h | 8 +- AppKit/include/AppKit/NSToolbarItem.h | 4 +- AppKit/include/AppKit/NSTouchBarItem.h | 8 +- AppKit/include/AppKit/NSTrackingArea.h | 12 +- AppKit/include/AppKit/NSTypesetter.h | 36 +- .../include/AppKit/NSUserDefaultsController.h | 2 +- AppKit/include/AppKit/NSView.h | 14 +- AppKit/include/AppKit/NSWindow.h | 14 +- AppKit/include/AppKit/NSWorkspace.h | 14 +- AppKit/nib.subproj/NSButtonImageSource.m | 2 +- AppKit/nib.subproj/NSClassSwapper.m | 8 +- AppKit/nib.subproj/NSCustomObject.m | 16 +- AppKit/nib.subproj/NSCustomView.m | 17 +- AppKit/nib.subproj/NSIBObjectData.m | 52 +- ...SIBUserDefinedRuntimeAttributesConnector.m | 2 +- AppKit/nib.subproj/NSNib.m | 31 +- AppKit/nib.subproj/NSNibBindingConnector.m | 6 +- AppKit/nib.subproj/NSNibControlConnector.m | 6 +- AppKit/nib.subproj/NSNibLoading.m | 30 +- AppKit/nib.subproj/NSNibOutletConnector.m | 6 +- AppKit/nib.subproj/NSWindowTemplate.m | 14 +- CFNetwork/CFHost.m | 42 +- CFNetwork/CFSocketStream.m | 52 +- CFSSLHandler_openssl/CFSSLHandler_openssl.m | 8 +- CoreData/NSAtomicStore.m | 20 +- CoreData/NSAttributeDescription.m | 4 +- CoreData/NSEntityDescription.m | 77 +- CoreData/NSFetchRequest.m | 2 +- CoreData/NSManagedObject-Private.h | 2 +- CoreData/NSManagedObject.m | 53 +- CoreData/NSManagedObjectContext-Private.h | 2 +- CoreData/NSManagedObjectContext.m | 93 +- CoreData/NSManagedObjectID.m | 2 +- CoreData/NSManagedObjectModel.m | 12 +- CoreData/NSManagedObjectSet.m | 4 +- CoreData/NSPersistentStore.m | 16 +- .../NSPersistentStoreCoordinator-Private.h | 2 +- CoreData/NSPersistentStoreCoordinator.m | 63 +- CoreData/NSRelationshipDescription.m | 4 +- CoreData/NSXMLPersistentStore.m | 168 +-- CoreData/include/CoreData/NSAtomicStore.h | 10 +- .../include/CoreData/NSEntityDescription.h | 4 +- CoreData/include/CoreData/NSManagedObject.h | 6 +- .../include/CoreData/NSManagedObjectContext.h | 4 +- .../include/CoreData/NSManagedObjectModel.h | 4 +- CoreData/include/CoreData/NSPersistentStore.h | 8 +- .../CoreData/NSPersistentStoreCoordinator.h | 10 +- CoreGraphics/CGAffineTransform.m | 2 +- CoreGraphics/CGColorSpace.m | 16 +- CoreGraphics/CGContext.m | 6 +- CoreGraphics/CGDirectDisplay.m | 20 +- CoreGraphics/CGGeometry.m | 16 +- CoreGraphics/CGGradient.m | 2 +- CoreGraphics/CGLPixelSurface.m | 20 +- CoreGraphics/CGPDFContext.m | 8 +- CoreGraphics/CGPDFPage.m | 2 +- CoreGraphics/CGPath.m | 2 +- CoreGraphics/KTFont+PDF.m | 15 +- .../include/CoreGraphics/CGAffineTransform.h | 2 +- .../include/CoreGraphics/CGDirectDisplay.h | 12 +- CoreGraphics/include/CoreGraphics/CGImage.h | 25 +- CoreGraphics/include/CoreGraphics/CGPath.h | 2 +- CoreGraphics/include/CoreGraphics/CGShading.h | 4 +- CoreGraphics/include/CoreGraphics/CGWindow.h | 2 +- CoreText/KTFont.m | 6 +- CoreText/KTFont_FT.m | 4 +- CoreText/include/CoreText/CTFont.h | 6 +- CoreText/include/CoreText/KTFont.h | 4 +- Examples/CGShadingCreate/GradientView.m | 28 +- Examples/NSOpenGLView/MyOpenGLView.m | 6 +- Examples/TextEditor/MyDocument.m | 2 +- Foundation/NSAffineTransform.m | 4 +- Foundation/NSArray/NSArray.m | 18 +- Foundation/NSArray/NSEnumerator_array.m | 2 +- .../NSArray/NSEnumerator_arrayReverse.m | 2 +- Foundation/NSArray/NSMutableArray.m | 14 +- Foundation/NSArray/NSMutableArray_concrete.m | 14 +- Foundation/NSAssertionHandler.h | 25 +- Foundation/NSAssertionHandler.m | 6 +- .../NSAttributedString/NSAttributedString.h | 10 +- .../NSAttributedString/NSAttributedString.m | 20 +- .../NSAttributedString_placeholder.m | 10 +- .../NSMutableAttributedString.m | 10 +- .../NSMutableAttributedString_concrete.m | 14 +- ...bleString_proxyToMutableAttributedString.h | 2 +- ...bleString_proxyToMutableAttributedString.m | 2 +- .../NSAttributedString/NSRangeEntries.m | 25 +- Foundation/NSBundle.m | 153 +-- Foundation/NSCharacterSet/NSCharacterSet.m | 40 +- .../NSCharacterSet/NSCharacterSet_bitmap.m | 6 +- .../NSCharacterSet/NSCharacterSet_range.m | 5 +- .../NSCharacterSet_rangeInverted.m | 5 +- .../NSCharacterSet/NSCharacterSet_string.m | 2 +- .../NSCharacterSet/NSMutableCharacterSet.m | 10 +- .../NSMutableCharacterSet_bitmap.m | 6 +- .../NSCharacterSet/bitmapRepresentation.h | 6 +- Foundation/NSClassDescription.m | 8 +- Foundation/NSConcreteDirectoryEnumerator.m | 12 +- Foundation/NSConnection/NSConnection.h | 17 +- Foundation/NSConnection/NSConnection.m | 23 +- Foundation/NSConnection/NSPort.m | 2 +- Foundation/NSConnection/NSPortMessage.h | 4 +- Foundation/NSConnection/NSPortMessage.m | 4 +- Foundation/NSData/NSData.m | 48 +- Foundation/NSData/NSData_concrete.m | 2 +- Foundation/NSData/NSMutableData.m | 4 +- Foundation/NSDate/NSCalendar.m | 12 +- Foundation/NSDate/NSCalendarDate.h | 44 +- Foundation/NSDate/NSCalendarDate.m | 103 +- Foundation/NSDate/NSDate.m | 46 +- Foundation/NSDate/NSDateFormatter.h | 6 +- Foundation/NSDate/NSDateFormatter.m | 291 +++--- Foundation/NSDecimal/NSDecimalNumber.h | 26 +- Foundation/NSDecimal/NSDecimalNumber.m | 34 +- .../NSDecimal/NSDecimalNumberPlaceholder.m | 2 +- Foundation/NSDictionary/NSDictionary.m | 20 +- .../NSEnumerator_dictionaryKeys.m | 2 +- Foundation/NSDictionary/NSMutableDictionary.m | 4 +- .../NSMutableDictionary_mapTable.h | 8 +- .../NSMutableDictionary_mapTable.m | 57 +- Foundation/NSDistributedNotificationCenter.h | 10 +- Foundation/NSDistributedNotificationCenter.m | 12 +- Foundation/NSError.m | 33 +- Foundation/NSException/NSException.h | 8 +- Foundation/NSException/NSException.m | 12 +- Foundation/NSException/NSRaise.h | 11 +- Foundation/NSException/NSRaise.m | 2 +- Foundation/NSException/debugHelpers.m | 8 +- Foundation/NSFileManager.h | 52 +- Foundation/NSFileManager.m | 32 +- Foundation/NSFormatter.h | 6 +- Foundation/NSFormatter.m | 6 +- Foundation/NSGeometry.m | 6 +- Foundation/NSHTTPCookie/NSHTTPCookieStorage.h | 4 +- Foundation/NSHTTPCookie/NSHTTPCookieStorage.m | 4 +- Foundation/NSHashTable.m | 27 +- Foundation/NSHost.m | 4 +- Foundation/NSIndexPath.h | 7 +- Foundation/NSIndexSet/NSIndexSet.m | 26 +- Foundation/NSIndexSet/NSMutableIndexSet.m | 12 +- Foundation/NSInvocation.h | 2 +- Foundation/NSInvocation.m | 26 +- Foundation/NSKeyValueCoding/NSArray+KVC.m | 22 +- .../NSKeyValueCoding/NSKVCMutableArray.m | 14 +- .../NSKeyValueCoding/NSKVOInfoPerObject.m | 8 +- Foundation/NSKeyValueCoding/NSKeyObserver.h | 6 +- Foundation/NSKeyValueCoding/NSKeyObserver.m | 10 +- .../NSKeyValueCoding/NSKeyValueCoding.m | 50 +- .../NSKeyValueCoding/NSKeyValueObserving.h | 22 +- .../NSKeyValueCoding/NSKeyValueObserving.m | 355 +++---- .../NSKeyValueCoding/NSString+KVCAdditions.m | 8 +- Foundation/NSKeyedArchiving/NSKeyedArchiver.h | 4 +- Foundation/NSKeyedArchiving/NSKeyedArchiver.m | 29 +- .../NSKeyedArchiving/NSKeyedUnarchiver.h | 8 +- .../NSKeyedArchiving/NSKeyedUnarchiver.m | 20 +- Foundation/NSLocale.m | 52 +- Foundation/NSLock/NSConditionLock.m | 2 +- Foundation/NSLock/NSRecursiveLock.m | 2 +- Foundation/NSMapTable.h | 10 +- Foundation/NSMapTable.m | 79 +- Foundation/NSMethodSignature.m | 6 +- Foundation/NSNetService/NSNetServices.h | 12 +- Foundation/NSNetService/NSNetServices.m | 139 +-- Foundation/NSNetService/bonjour.h | 83 +- Foundation/NSNetService/bonjour.m | 91 +- Foundation/NSNotification/NSNotification.m | 6 +- .../NSNotification/NSNotification_concrete.h | 4 +- .../NSNotification/NSNotification_concrete.m | 6 +- .../NSNotificationCenter.m | 14 +- .../NSObjectToObservers.m | 14 +- .../NSNotificationAndModes.m | 2 +- .../NSNotificationQueue/NSNotificationQueue.m | 10 +- Foundation/NSNumber/NSNumber.m | 18 +- Foundation/NSNumber/NSNumber_BOOL.m | 6 +- Foundation/NSNumber/NSNumber_double.m | 29 +- Foundation/NSNumber/NSNumber_float.m | 2 +- Foundation/NSNumber/NSNumber_longLong.m | 2 +- Foundation/NSNumber/NSNumber_placeholder.m | 2 +- Foundation/NSNumber/NSNumber_unsignedChar.m | 2 +- Foundation/NSNumber/NSNumber_unsignedInt.m | 2 +- Foundation/NSNumber/NSNumber_unsignedLong.m | 2 +- .../NSNumber/NSNumber_unsignedLongLong.m | 2 +- Foundation/NSNumber/NSNumber_unsignedShort.m | 2 +- Foundation/NSNumberFormatter.h | 2 +- Foundation/NSNumberFormatter.m | 194 ++-- Foundation/NSObjCRuntime.m | 16 +- Foundation/NSObject/NSObject.m | 6 +- Foundation/NSObject/NSZombieObject.m | 4 +- Foundation/NSObject/forwarding.m | 14 +- Foundation/NSObject/objc_forward_ffi.m | 10 +- Foundation/NSOperation/NSAtomicList.m | 4 +- Foundation/NSOperation/NSOperation.m | 12 +- .../NSPortNameServer/NSSocketPortNameServer.h | 8 +- .../NSPortNameServer/NSSocketPortNameServer.m | 8 +- .../NSPredicate/NSComparisonPredicate.h | 10 +- .../NSPredicate/NSComparisonPredicate.m | 50 +- Foundation/NSPredicate/NSCompoundPredicate.h | 2 +- Foundation/NSPredicate/NSCompoundPredicate.m | 4 +- Foundation/NSPredicate/NSExpression.h | 2 +- Foundation/NSPredicate/NSExpression.m | 12 +- Foundation/NSPredicate/NSExpression_array.m | 7 +- .../NSPredicate/NSExpression_assignment.m | 8 +- .../NSPredicate/NSExpression_function.m | 5 +- .../NSPredicate/NSExpression_operator.m | 5 +- .../NSPredicate/NSExpression_variable.m | 6 +- Foundation/NSPredicate/NSPredicate.h | 2 +- Foundation/NSPredicate/NSPredicate.m | 238 ++--- Foundation/NSProcessInfo.m | 14 +- Foundation/NSPropertyList/NSOldXMLAttribute.m | 4 +- Foundation/NSPropertyList/NSOldXMLReader.m | 4 +- Foundation/NSPropertyList/NSPropertyList.h | 8 +- Foundation/NSPropertyList/NSPropertyList.m | 12 +- .../NSPropertyList/NSPropertyListReader.m | 8 +- .../NSPropertyListReader_binary1.m | 29 +- .../NSPropertyListReader_vintage.m | 51 +- .../NSPropertyListReader_xml1.m | 30 +- .../NSPropertyListWriter_vintage.m | 40 +- .../NSPropertyListWriter_xml1.m | 32 +- Foundation/NSProxy.m | 14 +- Foundation/NSRunLoop/NSRunLoop.m | 60 +- Foundation/NSRunLoop/NSRunLoopState.m | 10 +- Foundation/NSScanner/NSScanner_concrete.m | 17 +- Foundation/NSSet/NSEnumerator_set.m | 2 +- Foundation/NSSet/NSInlineSetTable.m | 4 +- Foundation/NSSet/NSMutableSet.m | 8 +- Foundation/NSSet/NSMutableSet_concrete.m | 4 +- Foundation/NSSet/NSSet_concrete.m | 2 +- Foundation/NSSortDescriptor.h | 4 +- Foundation/NSSortDescriptor.m | 10 +- Foundation/NSSpellEngine.m | 32 +- Foundation/NSSpellServer.h | 28 +- Foundation/NSStream/NSFileHandle.h | 2 +- Foundation/NSStream/NSFileHandle.m | 26 +- Foundation/NSStream/NSFileHandle_stream.m | 47 +- Foundation/NSStream/NSInputStream_socket.m | 6 +- Foundation/NSStream/NSOutputStream_socket.m | 6 +- Foundation/NSStream/NSSelectInputSourceSet.m | 8 +- Foundation/NSStream/NSSelectSet.m | 2 +- Foundation/NSStream/NSSocket.h | 3 +- Foundation/NSStream/NSStream.m | 22 +- Foundation/NSString/NSMutableString.m | 20 +- .../NSString/NSMutableString_unicodePtr.m | 28 +- Foundation/NSString/NSPathUtilities.m | 10 +- Foundation/NSString/NSString.h | 40 +- Foundation/NSString/NSString.m | 146 +-- Foundation/NSString/NSStringEncoder.m | 28 +- Foundation/NSString/NSStringFormatter.m | 28 +- Foundation/NSString/NSStringHashing.h | 4 +- Foundation/NSString/NSStringSymbol.m | 60 +- Foundation/NSString/NSStringUTF8.m | 6 +- Foundation/NSString/NSString_cString.m | 10 +- Foundation/NSString/NSString_isoLatin1.m | 6 +- Foundation/NSString/NSString_isoLatin2.m | 360 +++---- Foundation/NSString/NSString_macOSRoman.h | 4 +- Foundation/NSString/NSString_macOSRoman.m | 258 ++--- Foundation/NSString/NSString_nextstep.m | 62 +- .../NSString/NSString_nextstepCString.m | 18 +- Foundation/NSString/NSString_placeholder.h | 8 +- Foundation/NSString/NSString_placeholder.m | 42 +- Foundation/NSString/NSString_unicode.m | 2 +- Foundation/NSString/NSString_unicodePtr.m | 2 +- Foundation/NSString/NSString_win1252.m | 74 +- Foundation/NSString/NSUnicodeCaseMapping.m | 8 +- Foundation/NSString/unibuffer.h | 4 +- .../NSStringsFileFormat/NSStringsFileParser.m | 16 +- Foundation/NSTask.m | 8 +- Foundation/NSTextCheckingResult.h | 22 +- Foundation/NSTextCheckingResult.m | 18 +- Foundation/NSThread/NSThread.m | 62 +- Foundation/NSTimeZone/NSTimeZone.h | 2 +- Foundation/NSTimeZone/NSTimeZone.m | 14 +- Foundation/NSTimeZone/NSTimeZoneTransition.h | 4 +- Foundation/NSTimeZone/NSTimeZoneTransition.m | 10 +- Foundation/NSTimeZone/NSTimeZoneType.h | 4 +- Foundation/NSTimeZone/NSTimeZoneType.m | 16 +- Foundation/NSTimeZone/NSTimeZone_absolute.m | 8 +- Foundation/NSTimer/NSTimer.m | 18 +- Foundation/NSURL/NSCachedURLResponse.h | 6 +- Foundation/NSURL/NSCachedURLResponse.m | 6 +- Foundation/NSURL/NSHTTPURLResponse.m | 12 +- Foundation/NSURL/NSMutableURLRequest.m | 2 +- Foundation/NSURL/NSURL.m | 36 +- .../NSURL/NSURLAuthenticationChallenge.h | 14 +- .../NSURL/NSURLAuthenticationChallenge.m | 14 +- Foundation/NSURL/NSURLCache.m | 109 +- Foundation/NSURL/NSURLConnection.h | 22 +- Foundation/NSURL/NSURLConnection.m | 53 +- Foundation/NSURL/NSURLConnectionState.m | 4 +- Foundation/NSURL/NSURLCredential.h | 6 +- Foundation/NSURL/NSURLCredential.m | 6 +- Foundation/NSURL/NSURLCredentialStorage.h | 8 +- Foundation/NSURL/NSURLCredentialStorage.m | 10 +- Foundation/NSURL/NSURLDownload.h | 28 +- Foundation/NSURL/NSURLDownload.m | 33 +- Foundation/NSURL/NSURLProtectionSpace.h | 16 +- Foundation/NSURL/NSURLProtectionSpace.m | 16 +- Foundation/NSURL/NSURLProtocol.h | 26 +- Foundation/NSURL/NSURLProtocol.m | 4 +- Foundation/NSURL/NSURLProtocol_http.h | 2 +- Foundation/NSURL/NSURLProtocol_http.m | 88 +- Foundation/NSURL/NSURLRequest.h | 8 +- Foundation/NSURL/NSURLRequest.m | 10 +- Foundation/NSURL/NSURLResponse.h | 6 +- Foundation/NSURL/NSURLResponse.m | 6 +- Foundation/NSUnarchiver.m | 24 +- Foundation/NSUndoManager/NSUndoGroup.m | 6 +- Foundation/NSUndoManager/NSUndoManager.m | 85 +- Foundation/NSUserDefaults/NSUserDefaults.m | 80 +- Foundation/NSValue/NSValue.m | 8 +- .../NSValueTransformer/NSValueTransformer.m | 14 +- Foundation/NSZone/NSZone.m | 4 +- .../platform_darwin/NSPlatform_darwin.m | 26 +- .../platform_posix/NSConditionLock_posix.m | 12 +- .../platform_posix/NSFileHandle_posix.m | 72 +- .../platform_posix/NSFileManager_posix.m | 13 +- .../platform_posix/NSPersistantDomain_posix.m | 4 +- Foundation/platform_posix/NSPipe_posix.m | 16 +- Foundation/platform_posix/NSPlatform_posix.m | 2 +- .../platform_posix/NSRecursiveLock_posix.m | 12 +- Foundation/platform_posix/NSSelectSet_bsd.m | 21 +- Foundation/platform_posix/NSSocket_bsd.m | 23 +- .../NSString_defaultEncoding_posix.m | 2 +- Foundation/platform_posix/NSTask_posix.m | 24 +- Foundation/platform_posix/NSTimeZone_posix.h | 6 +- Foundation/platform_posix/NSTimeZone_posix.m | 93 +- .../platform_windows/NSCondition_win32.m | 4 +- .../platform_windows/NSFileHandle_win32.m | 52 +- .../platform_windows/NSFileManager_win32.m | 141 +-- .../NSHandleMonitorSet_win32.m | 16 +- .../platform_windows/NSLocale+windows.m | 8 +- .../NSMemoryFunctions_win32.m | 6 +- .../NSParentDeathMonitor_win32.m | 8 +- .../NSPersistantDomain_win32.m | 30 +- Foundation/platform_windows/NSPipe_win32.m | 8 +- .../platform_windows/NSPlatform_win32.m | 78 +- .../NSReadInBackground_win32.m | 8 +- .../platform_windows/NSRunLoopState_windows.m | 5 +- .../platform_windows/NSSelectSet_windows.m | 27 +- .../platform_windows/NSSocket_windows.m | 48 +- .../NSString_defaultEncoding_windows.m | 2 +- Foundation/platform_windows/NSTask_win32.m | 59 +- .../platform_windows/NSTimeZone_win32.m | 81 +- Foundation/xml/NSXMLDTD.m | 4 +- Foundation/xml/NSXMLDocument.m | 22 +- Foundation/xml/NSXMLElement.h | 2 +- Foundation/xml/NSXMLElement.m | 8 +- Foundation/xml/NSXMLNode.h | 4 +- Foundation/xml/NSXMLNode.m | 20 +- Foundation/xml/NSXMLParser.h | 72 +- Foundation/xml/NSXMLParser.m | 19 +- IOKit/IOKitLib.m | 14 +- ImageKit/IKImageBrowserView.h | 16 +- ImageKit/IKImageBrowserView.m | 2 +- InstallCDT/Resources/tools/retargetBundle.m | 78 +- .../NSSpellEngine_hunspell.mm | 49 +- .../NSSpellEngine_hunspellDictionary.mm | 16 +- O2Context_AntiGrain/O2Context_AntiGrain.h | 10 +- O2Context_AntiGrain/O2Context_AntiGrain.mm | 321 +++--- O2Context_AntiGrain/agg_font_win32_tt.mm | 112 +- Onyx2D/O2AffineTransform.m | 2 +- Onyx2D/O2BitmapContext.m | 50 +- Onyx2D/O2ClipPhase.m | 4 +- Onyx2D/O2ClipState.m | 6 +- Onyx2D/O2Color.m | 30 +- Onyx2D/O2ColorSpace+PDF.m | 35 +- Onyx2D/O2ColorSpace.m | 22 +- Onyx2D/O2Context.m | 56 +- Onyx2D/O2Context_builtin.m | 149 +-- Onyx2D/O2Context_builtin_FT.m | 14 +- Onyx2D/O2Context_distill.m | 10 +- Onyx2D/O2DataConsumer.m | 8 +- Onyx2D/O2DataProvider.m | 4 +- Onyx2D/O2Decoder_TIFF.m | 26 +- Onyx2D/O2EXIFDecoder.m | 318 +++--- Onyx2D/O2Encoder_JPG.m | 5 +- Onyx2D/O2Encoder_PNG.m | 37 +- Onyx2D/O2Encoder_TIFF.m | 12 +- Onyx2D/O2Encoding.m | 122 +-- Onyx2D/O2Font+PDF.m | 20 +- Onyx2D/O2Font.m | 532 +++++----- Onyx2D/O2Font_freetype.m | 10 +- Onyx2D/O2Font_ttf.m | 2 +- Onyx2D/O2Function+PDF.m | 40 +- Onyx2D/O2GraphicsState.m | 22 +- Onyx2D/O2Image+PDF.m | 64 +- Onyx2D/O2Image.m | 129 +-- Onyx2D/O2ImageDecoder_JPEG_libjpeg.m | 22 +- Onyx2D/O2ImageDecoder_JPEG_stb.m | 18 +- Onyx2D/O2ImageDestination.m | 14 +- Onyx2D/O2ImageSource_BMP.m | 33 +- Onyx2D/O2ImageSource_GIF.m | 28 +- Onyx2D/O2ImageSource_ICNS.m | 224 ++-- Onyx2D/O2ImageSource_JPEG.m | 34 +- Onyx2D/O2ImageSource_PNG.m | 33 +- Onyx2D/O2ImageSource_TIFF.m | 28 +- Onyx2D/O2LZW.m | 10 +- Onyx2D/O2MutablePath.m | 20 +- Onyx2D/O2PDFBlock.m | 2 +- Onyx2D/O2PDFCharWidths.m | 6 +- Onyx2D/O2PDFContentStream.m | 4 +- Onyx2D/O2PDFContext.m | 67 +- Onyx2D/O2PDFDictionary.m | 8 +- Onyx2D/O2PDFFilter.m | 2 +- Onyx2D/O2PDFFont.m | 14 +- Onyx2D/O2PDFFunction_Type0.m | 14 +- Onyx2D/O2PDFFunction_Type2.m | 4 +- Onyx2D/O2PDFFunction_Type3.m | 14 +- Onyx2D/O2PDFFunction_Type4.m | 22 +- Onyx2D/O2PDFObject_Boolean.m | 4 +- Onyx2D/O2PDFObject_Name.m | 6 +- Onyx2D/O2PDFObject_R.m | 4 +- Onyx2D/O2PDFObject_const.m | 18 +- Onyx2D/O2PDFObject_identifier.m | 2 +- Onyx2D/O2PDFOperatorTable.m | 2 +- Onyx2D/O2PDFOperators.m | 34 +- Onyx2D/O2PDFPage.m | 10 +- Onyx2D/O2PDFScanner.m | 87 +- Onyx2D/O2PDFStream.m | 4 +- Onyx2D/O2PDFString.m | 8 +- Onyx2D/O2PDFxref.m | 2 +- Onyx2D/O2Paint_axialGradient.m | 10 +- Onyx2D/O2Paint_color.m | 12 +- Onyx2D/O2Paint_image.m | 20 +- Onyx2D/O2Paint_pattern.m | 4 +- Onyx2D/O2Paint_radialGradient.m | 8 +- Onyx2D/O2Paint_ramp.m | 45 +- Onyx2D/O2Path.m | 39 +- Onyx2D/O2Pattern.m | 14 +- Onyx2D/O2Shading+PDF.m | 2 +- Onyx2D/O2Surface.m | 102 +- Onyx2D/O2TIFFImageDirectory.m | 6 +- Onyx2D/O2TTFDecoder.m | 522 +++++----- Onyx2D/O2argb8u.m | 52 +- Onyx2D/O2zlib.m | 34 +- Onyx2D/VGPath.m | 231 +++-- Onyx2D/include/Onyx2D/O2BitmapContext.h | 8 +- Onyx2D/include/Onyx2D/O2ClipPhase.h | 4 +- Onyx2D/include/Onyx2D/O2ClipState.h | 4 +- Onyx2D/include/Onyx2D/O2Context.h | 8 +- Onyx2D/include/Onyx2D/O2Context_builtin.h | 4 +- Onyx2D/include/Onyx2D/O2Exceptions.h | 11 +- Onyx2D/include/Onyx2D/O2GraphicsState.h | 3 +- Onyx2D/include/Onyx2D/O2Image.h | 40 +- Onyx2D/include/Onyx2D/O2LZW.h | 20 +- Onyx2D/include/Onyx2D/O2PDFCharWidths.h | 6 +- Onyx2D/include/Onyx2D/O2PDFContentStream.h | 6 +- Onyx2D/include/Onyx2D/O2PDFContext.h | 10 +- Onyx2D/include/Onyx2D/O2PDFFunction_Type0.h | 14 +- Onyx2D/include/Onyx2D/O2PDFFunction_Type3.h | 8 +- Onyx2D/include/Onyx2D/O2PDFFunction_Type4.h | 4 +- Onyx2D/include/Onyx2D/O2PDFScanner.h | 2 +- Onyx2D/include/Onyx2D/O2Paint_axialGradient.h | 2 +- Onyx2D/include/Onyx2D/O2Paint_color.h | 12 +- Onyx2D/include/Onyx2D/O2Paint_image.h | 12 +- Onyx2D/include/Onyx2D/O2Paint_pattern.h | 4 +- .../include/Onyx2D/O2Paint_radialGradient.h | 2 +- Onyx2D/include/Onyx2D/O2Paint_ramp.h | 4 +- Onyx2D/include/Onyx2D/O2Path.h | 6 +- Onyx2D/include/Onyx2D/O2Surface.h | 16 +- .../platform_Windows/O2Context_builtin_gdi.m | 45 +- Onyx2D/platform_Windows/O2Context_gdi.m | 108 +- Onyx2D/platform_Windows/O2DeviceContext_gdi.m | 26 +- .../O2DeviceContext_gdiDIBSection.h | 4 +- .../O2DeviceContext_gdiDIBSection.m | 10 +- Onyx2D/platform_Windows/O2Font_gdi.m | 134 +-- .../platform_Windows/O2Surface_DIBSection.h | 4 +- .../platform_Windows/O2Surface_DIBSection.m | 44 +- Onyx2D/platform_Windows/Win32Font.h | 10 +- Onyx2D/platform_Windows/Win32Font.m | 18 +- PDFKit/PDFDocument.h | 2 +- PDFKit/PDFDocument.m | 52 +- PDFKit/PDFDocumentView.m | 4 +- PDFKit/PDFPage.m | 6 +- PDFKit/PDFPageView.m | 2 +- PDFKit/PDFSelection.h | 2 +- PDFKit/PDFSelection.m | 10 +- PDFKit/PDFView.m | 2 +- QuartzCore/CALayerContext.m | 2 +- QuartzCore/CAMediaTimingFunction.m | 6 +- QuartzCore/CARenderer.m | 24 +- QuartzCore/CATransaction.m | 17 +- QuartzCore/CIContext.m | 6 +- Security/SecBase.h | 46 +- Security/SecBase.m | 59 +- Security/SecKeychain.h | 7 +- Security/SecKeychain.m | 67 +- Security/SecKeychainItem.h | 6 +- Security/SecKeychainItem.m | 6 +- Security/SecKeychainSearch.m | 2 +- makefiles/test/src/test.m | 4 +- objc/Protocol.m | 2 +- objc/objc_association.m | 18 +- .../OBJCRegisterModule_Darwin.m | 22 +- pthread/pthread.m | 26 +- .../Examples/CGShadingCreate/GradientView.m | 28 +- .../CGShadingCreateAxial/GradientView.m | 12 +- testing/Examples/NSOpenGLView/MyOpenGLView.m | 6 +- testing/Examples/Quartz2D/Demo.m | 6 +- testing/Examples/Quartz2D/DemoAffineImages.m | 22 +- testing/Examples/Quartz2D/DemoGradient.m | 12 +- testing/Examples/Quartz2D/DemoPattern.m | 6 +- testing/Examples/Quartz2D/DemoPorterDuff.m | 22 +- testing/Examples/Quartz2D/DemoSoftMask.m | 2 +- testing/Examples/Quartz2D/DemoWindingRules.m | 2 +- testing/Examples/TextEditor/MyDocument.m | 2 +- testing/OnyxPDFRasterizer/OnyxPDFRasterizer.m | 8 +- testing/SWRender/CoreGraphics_KG.h | 2 +- testing/SWRender/DemosTemplate.m | 42 +- testing/SWRender/KGImageView.m | 2 +- testing/SWRender/KGRender.h | 40 +- testing/SWRender/KGRender.m | 46 +- testing/SWRender/KGRenderController.m | 57 +- testing/UnitTests/Array.m | 5 +- testing/UnitTests/Bindings/NibBasedTest.m | 4 +- testing/UnitTests/Bindings/ObservableArray.m | 83 +- testing/UnitTests/Bindings/TableViewTest.m | 56 +- testing/UnitTests/Forwarding.m | 10 +- testing/UnitTests/KVO.m | 38 +- testing/UnitTests/KeyedArchiving.m | 8 +- testing/UnitTests/MessageSendTorture.m | 8 +- testing/UnitTests/OperationQueueTests.m | 34 +- testing/UnitTests/Predicate.m | 97 +- testing/UnitTests/Properties.m | 4 +- testing/UnitTests/PropertyListUnarchiving.m | 42 +- testing/UnitTests/Runloop.m | 2 +- 824 files changed, 14463 insertions(+), 13875 deletions(-) diff --git a/.clang-format b/.clang-format index 3272658c..785e5d1d 100644 --- a/.clang-format +++ b/.clang-format @@ -63,6 +63,7 @@ UseTab: Never Language: ObjC BasedOnStyle: LLVM IndentWidth: 4 +ContinuationIndentWidth: 8 UseTab: Never SpaceBeforeParens: ControlStatements SpaceBeforeRangeBasedForLoopColon: true diff --git a/AppKit/CoreData_/NSPersistentDocument.h b/AppKit/CoreData_/NSPersistentDocument.h index 33817253..5026222a 100644 --- a/AppKit/CoreData_/NSPersistentDocument.h +++ b/AppKit/CoreData_/NSPersistentDocument.h @@ -29,12 +29,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSManagedObjectContext *) managedObjectContext; - (NSManagedObjectModel *) managedObjectModel; - (void) setManagedObjectContext: - (NSManagedObjectContext *) managedObjectContext; + (NSManagedObjectContext *) managedObjectContext; - (BOOL) configurePersistentStoreCoordinatorForURL: (NSURL *) url ofType: (NSString *) fileType modelConfiguration: (NSString *) configuration storeOptions: - (NSDictionary *) storeOptions + (NSDictionary *) storeOptions error: (NSError **) error; - (NSString *) persistentStoreTypeForFileType: (NSString *) fileType; @@ -50,9 +50,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ofType: (NSString *) inTypeName error: (NSError **) outError; - (BOOL) writeToURL: (NSURL *) absoluteURL - ofType: (NSString *) typeName - forSaveOperation: (NSSaveOperationType) saveOperation - originalContentsURL: (NSURL *) absoluteOriginalContentsURL - error: (NSError **) error; + ofType: (NSString *) typeName + forSaveOperation: (NSSaveOperationType) saveOperation + originalContentsURL: (NSURL *) absoluteOriginalContentsURL + error: (NSError **) error; @end diff --git a/AppKit/CoreData_/NSPersistentDocument.m b/AppKit/CoreData_/NSPersistentDocument.m index 7f3b214c..b2db4ceb 100644 --- a/AppKit/CoreData_/NSPersistentDocument.m +++ b/AppKit/CoreData_/NSPersistentDocument.m @@ -31,10 +31,10 @@ if (self) { _context = [[NSManagedObjectContext alloc] init]; NSManagedObjectModel *model = - [[NSManagedObjectModel alloc] initWithName: [self className]]; + [[NSManagedObjectModel alloc] initWithName: [self className]]; NSPersistentStoreCoordinator *coordinator = - [[NSPersistentStoreCoordinator alloc] - initWithManagedObjectModel: model]; + [[NSPersistentStoreCoordinator alloc] + initWithManagedObjectModel: model]; [_context setPersistentStoreCoordinator: coordinator]; } return self; @@ -54,7 +54,7 @@ } - (void) setManagedObjectContext: - (NSManagedObjectContext *) managedObjectContext + (NSManagedObjectContext *) managedObjectContext { NSUnimplementedMethod(); } @@ -63,7 +63,7 @@ ofType: (NSString *) fileType modelConfiguration: (NSString *) configuration storeOptions: - (NSDictionary *) storeOptions + (NSDictionary *) storeOptions error: (NSError **) error { NSUnimplementedMethod(); @@ -109,10 +109,10 @@ } - (BOOL) writeToURL: (NSURL *) absoluteURL - ofType: (NSString *) typeName - forSaveOperation: (NSSaveOperationType) saveOperation - originalContentsURL: (NSURL *) absoluteOriginalContentsURL - error: (NSError **) error + ofType: (NSString *) typeName + forSaveOperation: (NSSaveOperationType) saveOperation + originalContentsURL: (NSURL *) absoluteOriginalContentsURL + error: (NSError **) error { NSUnimplementedMethod(); return NO; diff --git a/AppKit/CoreData_/_NSManagedProxy.h b/AppKit/CoreData_/_NSManagedProxy.h index 1d05a418..faeb5e8b 100644 --- a/AppKit/CoreData_/_NSManagedProxy.h +++ b/AppKit/CoreData_/_NSManagedProxy.h @@ -61,13 +61,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (id) objectAtIndex: (NSUInteger) index; - (NSUInteger) count; - (void) addObserver: (NSObject *) observer - toObjectsAtIndexes: (NSIndexSet *) indexes - forKeyPath: (NSString *) keyPath - options: (NSKeyValueObservingOptions) options - context: (void *) context; + toObjectsAtIndexes: (NSIndexSet *) indexes + forKeyPath: (NSString *) keyPath + options: (NSKeyValueObservingOptions) options + context: (void *) context; - (void) removeObserver: (NSObject *) observer - fromObjectsAtIndexes: (NSIndexSet *) indexes - forKeyPath: (NSString *) keyPath; + fromObjectsAtIndexes: (NSIndexSet *) indexes + forKeyPath: (NSString *) keyPath; - (void) notifyObserver: (_NSManagedProxy_observerInfo *) observerInfo; - (void) _refresh; - (id) objectValueForTableColumn: (NSTableColumn *) column; diff --git a/AppKit/CoreData_/_NSManagedProxy.m b/AppKit/CoreData_/_NSManagedProxy.m index 5e7e04d9..6c2c061d 100644 --- a/AppKit/CoreData_/_NSManagedProxy.m +++ b/AppKit/CoreData_/_NSManagedProxy.m @@ -42,7 +42,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _entityName = [[coder decodeObjectForKey: @"NSEntityName"] retain]; NSPredicate *fetchPredicate = - [coder decodeObjectForKey: @"NSFetchPredicate"]; + [coder decodeObjectForKey: @"NSFetchPredicate"]; _fetchRequest = [[NSFetchRequest alloc] init]; [_fetchRequest setEntity: _entity]; @@ -119,7 +119,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (!_context || !_fetchRequest) return nil; id object = - [[_fetchRequest _resultsInContext: _context] objectAtIndex: index]; + [[_fetchRequest _resultsInContext: _context] objectAtIndex: index]; return [[_NSManagedProxy alloc] initWithParent: self object: object]; } @@ -135,16 +135,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) addObserver: (NSObject *) observer - toObjectsAtIndexes: (NSIndexSet *) indexes - forKeyPath: (NSString *) keyPath - options: (NSKeyValueObservingOptions) options - context: (void *) context + toObjectsAtIndexes: (NSIndexSet *) indexes + forKeyPath: (NSString *) keyPath + options: (NSKeyValueObservingOptions) options + context: (void *) context { - NSLog( - @"Proxy for %@ asked to observe by %@ for keypath %@ options 0x%08x\n", - _object, observer, keyPath, options); + NSLog(@"Proxy for %@ asked to observe by %@ for keypath %@ options " + @"0x%08x\n", + _object, observer, keyPath, options); _NSManagedProxy_observerInfo *observerInfo = - [[_NSManagedProxy_observerInfo alloc] init]; + [[_NSManagedProxy_observerInfo alloc] init]; [observerInfo setObserver: observer]; [observerInfo setIndexSet: indexes]; [observerInfo setKeyPath: keyPath]; @@ -155,8 +155,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) removeObserver: (NSObject *) observer - fromObjectsAtIndexes: (NSIndexSet *) indexes - forKeyPath: (NSString *) keyPath + fromObjectsAtIndexes: (NSIndexSet *) indexes + forKeyPath: (NSString *) keyPath { } diff --git a/AppKit/MacWorkspace.m b/AppKit/MacWorkspace.m index dc69dfef..bc7f9861 100644 --- a/AppKit/MacWorkspace.m +++ b/AppKit/MacWorkspace.m @@ -68,8 +68,8 @@ - (BOOL) openFile: (NSString *) path withApplication: (NSString *) application { return [self openFile: path - withApplication: application - andDeactivate: YES]; + withApplication: application + andDeactivate: YES]; } - (BOOL) openTempFile: (NSString *) path { @@ -86,8 +86,8 @@ } - (BOOL) openFile: (NSString *) path - withApplication: (NSString *) application - andDeactivate: (BOOL) deactivate + withApplication: (NSString *) application + andDeactivate: (BOOL) deactivate { // TODO: call LSOpenFromURLSpec() NSUnimplementedMethod(); @@ -101,7 +101,7 @@ } - (BOOL) selectFile: (NSString *) path - inFileViewerRootedAtPath: (NSString *) rootedAtPath + inFileViewerRootedAtPath: (NSString *) rootedAtPath { // TODO: call activateFileViewerSelectingURLs NSUnimplementedMethod(); @@ -273,8 +273,9 @@ - (NSURL *) URLForApplicationWithBundleIdentifier: (NSString *) bundleIdentifier { CFURLRef url; - OSStatus status = LSFindApplicationForInfo( - kLSUnknownCreator, (CFStringRef) bundleIdentifier, NULL, NULL, &url); + OSStatus status = LSFindApplicationForInfo(kLSUnknownCreator, + (CFStringRef) bundleIdentifier, + NULL, NULL, &url); if (status != noErr) return nil; @@ -293,7 +294,7 @@ CFURLRef url; OSStatus status = LSFindApplicationForInfo( - kLSUnknownCreator, NULL, (CFStringRef) appName, NULL, &url); + kLSUnknownCreator, NULL, (CFStringRef) appName, NULL, &url); if (status != noErr) return nil; diff --git a/AppKit/NSAccessibility.m b/AppKit/NSAccessibility.m index 7ff47a5e..da252763 100644 --- a/AppKit/NSAccessibility.m +++ b/AppKit/NSAccessibility.m @@ -2,348 +2,348 @@ #import NSString *const NSAccessibilityChildrenAttribute = - @"NSAccessibilityChildrenAttribute"; + @"NSAccessibilityChildrenAttribute"; NSString *const NSAccessibilityContentsAttribute = - @"NSAccessibilityContentsAttribute"; + @"NSAccessibilityContentsAttribute"; NSString *const NSAccessibilityDescriptionAttribute = - @"NSAccessibilityDescriptionAttribute"; + @"NSAccessibilityDescriptionAttribute"; NSString *const NSAccessibilityEnabledAttribute = - @"NSAccessibilityEnabledAttribute"; + @"NSAccessibilityEnabledAttribute"; NSString *const NSAccessibilityFocusedAttribute = - @"NSAccessibilityFocusedAttribute"; + @"NSAccessibilityFocusedAttribute"; NSString *const NSAccessibilityHelpAttribute = @"NSAccessibilityHelpAttribute"; NSString *const NSAccessibilityMaxValueAttribute = - @"NSAccessibilityMaxValueAttribute"; + @"NSAccessibilityMaxValueAttribute"; NSString *const NSAccessibilityMinValueAttribute = - @"NSAccessibilityMinValueAttribute"; + @"NSAccessibilityMinValueAttribute"; NSString *const NSAccessibilityParentAttribute = - @"NSAccessibilityParentAttribute"; + @"NSAccessibilityParentAttribute"; NSString *const NSAccessibilityPositionAttribute = - @"NSAccessibilityPositionAttribute"; + @"NSAccessibilityPositionAttribute"; NSString *const NSAccessibilityRoleAttribute = @"NSAccessibilityRoleAttribute"; NSString *const NSAccessibilityRoleDescriptionAttribute = - @"NSAccessibilityRoleDescriptionAttribute"; + @"NSAccessibilityRoleDescriptionAttribute"; NSString *const NSAccessibilitySelectedChildrenAttribute = - @"NSAccessibilitySelectedChildrenAttribute"; + @"NSAccessibilitySelectedChildrenAttribute"; NSString *const NSAccessibilityShownMenuAttribute = - @"NSAccessibilityShownMenuAttribute"; + @"NSAccessibilityShownMenuAttribute"; NSString *const NSAccessibilitySizeAttribute = @"NSAccessibilitySizeAttribute"; NSString *const NSAccessibilitySubroleAttribute = - @"NSAccessibilitySubroleAttribute"; + @"NSAccessibilitySubroleAttribute"; NSString *const NSAccessibilityTitleAttribute = - @"NSAccessibilityTitleAttribute"; + @"NSAccessibilityTitleAttribute"; NSString *const NSAccessibilityTopLevelUIElementAttribute = - @"NSAccessibilityTopLevelUIElementAttribute"; + @"NSAccessibilityTopLevelUIElementAttribute"; NSString *const NSAccessibilityValueAttribute = - @"NSAccessibilityValueAttribute"; + @"NSAccessibilityValueAttribute"; NSString *const NSAccessibilityValueDescriptionAttribute = - @"NSAccessibilityValueDescriptionAttribute"; + @"NSAccessibilityValueDescriptionAttribute"; NSString *const NSAccessibilityVisibleChildrenAttribute = - @"NSAccessibilityVisibleChildrenAttribute"; + @"NSAccessibilityVisibleChildrenAttribute"; NSString *const NSAccessibilityWindowAttribute = - @"NSAccessibilityWindowAttribute"; + @"NSAccessibilityWindowAttribute"; NSString *const NSAccessibilityInsertionPointLineNumberAttribute = - @"NSAccessibilityInsertionPointLineNumberAttribute"; + @"NSAccessibilityInsertionPointLineNumberAttribute"; NSString *const NSAccessibilityNumberOfCharactersAttribute = - @"NSAccessibilityNumberOfCharactersAttribute"; + @"NSAccessibilityNumberOfCharactersAttribute"; NSString *const NSAccessibilitySelectedTextAttribute = - @"NSAccessibilitySelectedTextAttribute"; + @"NSAccessibilitySelectedTextAttribute"; NSString *const NSAccessibilitySelectedTextRangeAttribute = - @"NSAccessibilitySelectedTextRangeAttribute"; + @"NSAccessibilitySelectedTextRangeAttribute"; NSString *const NSAccessibilitySelectedTextRangesAttribute = - @"NSAccessibilitySelectedTextRangesAttribute"; + @"NSAccessibilitySelectedTextRangesAttribute"; NSString *const NSAccessibilitySharedCharacterRangeAttribute = - @"NSAccessibilitySharedCharacterRangeAttribute"; + @"NSAccessibilitySharedCharacterRangeAttribute"; NSString *const NSAccessibilitySharedTextUIElementsAttribute = - @"NSAccessibilitySharedTextUIElementsAttribute"; + @"NSAccessibilitySharedTextUIElementsAttribute"; NSString *const NSAccessibilityVisibleCharacterRangeAttribute = - @"NSAccessibilityVisibleCharacterRangeAttribute"; + @"NSAccessibilityVisibleCharacterRangeAttribute"; NSString *const NSAccessibilityAttributedStringForRangeParameterizedAttribute = - @"NSAccessibilityAttributedStringForRangeParameterizedAttribute"; + @"NSAccessibilityAttributedStringForRangeParameterizedAttribute"; NSString *const NSAccessibilityBoundsForRangeParameterizedAttribute = - @"NSAccessibilityBoundsForRangeParameterizedAttribute"; + @"NSAccessibilityBoundsForRangeParameterizedAttribute"; NSString *const NSAccessibilityLineForIndexParameterizedAttribute = - @"NSAccessibilityLineForIndexParameterizedAttribute"; + @"NSAccessibilityLineForIndexParameterizedAttribute"; NSString *const NSAccessibilityRTFForRangeParameterizedAttribute = - @"NSAccessibilityRTFForRangeParameterizedAttribute"; + @"NSAccessibilityRTFForRangeParameterizedAttribute"; NSString *const NSAccessibilityRangeForIndexParameterizedAttribute = - @"NSAccessibilityRangeForIndexParameterizedAttribute"; + @"NSAccessibilityRangeForIndexParameterizedAttribute"; NSString *const NSAccessibilityRangeForLineParameterizedAttribute = - @"NSAccessibilityRangeForLineParameterizedAttribute"; + @"NSAccessibilityRangeForLineParameterizedAttribute"; NSString *const NSAccessibilityRangeForPositionParameterizedAttribute = - @"NSAccessibilityRangeForPositionParameterizedAttribute"; + @"NSAccessibilityRangeForPositionParameterizedAttribute"; NSString *const NSAccessibilityStringForRangeParameterizedAttribute = - @"NSAccessibilityStringForRangeParameterizedAttribute"; + @"NSAccessibilityStringForRangeParameterizedAttribute"; NSString *const NSAccessibilityStyleRangeForIndexParameterizedAttribute = - @"NSAccessibilityStyleRangeForIndexParameterizedAttribute"; + @"NSAccessibilityStyleRangeForIndexParameterizedAttribute"; NSString *const NSAccessibilityAttachmentTextAttribute = - @"NSAccessibilityAttachmentTextAttribute"; + @"NSAccessibilityAttachmentTextAttribute"; NSString *const NSAccessibilityBackgroundColorTextAttribute = - @"NSAccessibilityBackgroundColorTextAttribute"; + @"NSAccessibilityBackgroundColorTextAttribute"; NSString *const NSAccessibilityFontFamilyKey = @"NSAccessibilityFontFamilyKey"; NSString *const NSAccessibilityFontNameKey = @"NSAccessibilityFontNameKey"; NSString *const NSAccessibilityFontSizeKey = @"NSAccessibilityFontSizeKey"; NSString *const NSAccessibilityFontTextAttribute = - @"NSAccessibilityFontTextAttribute"; + @"NSAccessibilityFontTextAttribute"; NSString *const NSAccessibilityForegroundColorTextAttribute = - @"NSAccessibilityForegroundColorTextAttribute"; + @"NSAccessibilityForegroundColorTextAttribute"; NSString *const NSAccessibilityLinkTextAttribute = - @"NSAccessibilityLinkTextAttribute"; + @"NSAccessibilityLinkTextAttribute"; NSString *const NSAccessibilityMisspelledTextAttribute = - @"NSAccessibilityMisspelledTextAttribute"; + @"NSAccessibilityMisspelledTextAttribute"; NSString *const NSAccessibilityShadowTextAttribute = - @"NSAccessibilityShadowTextAttribute"; + @"NSAccessibilityShadowTextAttribute"; NSString *const NSAccessibilityStrikethroughColorTextAttribute = - @"NSAccessibilityStrikethroughColorTextAttribute"; + @"NSAccessibilityStrikethroughColorTextAttribute"; NSString *const NSAccessibilityStrikethroughTextAttribute = - @"NSAccessibilityStrikethroughTextAttribute"; + @"NSAccessibilityStrikethroughTextAttribute"; NSString *const NSAccessibilitySuperscriptTextAttribute = - @"NSAccessibilitySuperscriptTextAttribute"; + @"NSAccessibilitySuperscriptTextAttribute"; NSString *const NSAccessibilityUnderlineColorTextAttribute = - @"NSAccessibilityUnderlineColorTextAttribute"; + @"NSAccessibilityUnderlineColorTextAttribute"; NSString *const NSAccessibilityUnderlineTextAttribute = - @"NSAccessibilityUnderlineTextAttribute"; + @"NSAccessibilityUnderlineTextAttribute"; NSString *const NSAccessibilityVisibleNameKey = - @"NSAccessibilityVisibleNameKey"; + @"NSAccessibilityVisibleNameKey"; NSString *const NSAccessibilityCancelButtonAttribute = - @"NSAccessibilityCancelButtonAttribute"; + @"NSAccessibilityCancelButtonAttribute"; NSString *const NSAccessibilityCloseButtonAttribute = - @"NSAccessibilityCloseButtonAttribute"; + @"NSAccessibilityCloseButtonAttribute"; NSString *const NSAccessibilityDefaultButtonAttribute = - @"NSAccessibilityDefaultButtonAttribute"; + @"NSAccessibilityDefaultButtonAttribute"; NSString *const NSAccessibilityGrowAreaAttribute = - @"NSAccessibilityGrowAreaAttribute"; + @"NSAccessibilityGrowAreaAttribute"; NSString *const NSAccessibilityMainAttribute = @"NSAccessibilityMainAttribute"; NSString *const NSAccessibilityMinimizeButtonAttribute = - @"NSAccessibilityMinimizeButtonAttribute"; + @"NSAccessibilityMinimizeButtonAttribute"; NSString *const NSAccessibilityMinimizedAttribute = - @"NSAccessibilityMinimizedAttribute"; + @"NSAccessibilityMinimizedAttribute"; NSString *const NSAccessibilityModalAttribute = - @"NSAccessibilityModalAttribute"; + @"NSAccessibilityModalAttribute"; NSString *const NSAccessibilityProxyAttribute = - @"NSAccessibilityProxyAttribute"; + @"NSAccessibilityProxyAttribute"; NSString *const NSAccessibilityToolbarButtonAttribute = - @"NSAccessibilityToolbarButtonAttribute"; + @"NSAccessibilityToolbarButtonAttribute"; NSString *const NSAccessibilityZoomButtonAttribute = - @"NSAccessibilityZoomButtonAttribute"; + @"NSAccessibilityZoomButtonAttribute"; NSString *const NSAccessibilityHorizontalOrientationValue = - @"NSAccessibilityHorizontalOrientationValue"; + @"NSAccessibilityHorizontalOrientationValue"; NSString *const NSAccessibilityVerticalOrientationValue = - @"NSAccessibilityVerticalOrientationValue"; + @"NSAccessibilityVerticalOrientationValue"; NSString *const NSAccessibilityUnknownOrientationValue = - @"NSAccessibilityUnknownOrientationValue"; + @"NSAccessibilityUnknownOrientationValue"; NSString *const NSAccessibilityClearButtonAttribute = - @"NSAccessibilityClearButtonAttribute"; + @"NSAccessibilityClearButtonAttribute"; NSString *const NSAccessibilityColumnTitlesAttribute = - @"NSAccessibilityColumnTitlesAttribute"; + @"NSAccessibilityColumnTitlesAttribute"; NSString *const NSAccessibilityFocusedUIElementAttribute = - @"NSAccessibilityFocusedUIElementAttribute"; + @"NSAccessibilityFocusedUIElementAttribute"; NSString *const NSAccessibilityFocusedWindowAttribute = - @"NSAccessibilityFocusedWindowAttribute"; + @"NSAccessibilityFocusedWindowAttribute"; NSString *const NSAccessibilityFrontmostAttribute = - @"NSAccessibilityFrontmostAttribute"; + @"NSAccessibilityFrontmostAttribute"; NSString *const NSAccessibilityHiddenAttribute = - @"NSAccessibilityHiddenAttribute"; + @"NSAccessibilityHiddenAttribute"; NSString *const NSAccessibilityMainWindowAttribute = - @"NSAccessibilityMainWindowAttribute"; + @"NSAccessibilityMainWindowAttribute"; NSString *const NSAccessibilityMenuBarAttribute = - @"NSAccessibilityMenuBarAttribute"; + @"NSAccessibilityMenuBarAttribute"; NSString *const NSAccessibilityOrientationAttribute = - @"NSAccessibilityOrientationAttribute"; + @"NSAccessibilityOrientationAttribute"; NSString *const NSAccessibilitySearchButtonAttribute = - @"NSAccessibilitySearchButtonAttribute"; + @"NSAccessibilitySearchButtonAttribute"; NSString *const NSAccessibilitySearchMenuAttribute = - @"NSAccessibilitySearchMenuAttribute"; + @"NSAccessibilitySearchMenuAttribute"; NSString *const NSAccessibilityWindowsAttribute = - @"NSAccessibilityWindowsAttribute"; + @"NSAccessibilityWindowsAttribute"; NSString *const NSAccessibilityColumnCountAttribute = - @"NSAccessibilityColumnCountAttribute"; + @"NSAccessibilityColumnCountAttribute"; NSString *const NSAccessibilityOrderedByRowAttribute = - @"NSAccessibilityOrderedByRowAttribute"; + @"NSAccessibilityOrderedByRowAttribute"; NSString *const NSAccessibilityRowCountAttribute = - @"NSAccessibilityRowCountAttribute"; + @"NSAccessibilityRowCountAttribute"; NSString *const NSAccessibilityColumnHeaderUIElementsAttribute = - @"NSAccessibilityColumnHeaderUIElementsAttribute"; + @"NSAccessibilityColumnHeaderUIElementsAttribute"; NSString *const NSAccessibilityColumnsAttribute = - @"NSAccessibilityColumnsAttribute"; + @"NSAccessibilityColumnsAttribute"; NSString *const NSAccessibilityRowHeaderUIElementsAttribute = - @"NSAccessibilityRowHeaderUIElementsAttribute"; + @"NSAccessibilityRowHeaderUIElementsAttribute"; NSString *const NSAccessibilityRowsAttribute = @"NSAccessibilityRowsAttribute"; NSString *const NSAccessibilitySelectedColumnsAttribute = - @"NSAccessibilitySelectedColumnsAttribute"; + @"NSAccessibilitySelectedColumnsAttribute"; NSString *const NSAccessibilitySelectedRowsAttribute = - @"NSAccessibilitySelectedRowsAttribute"; + @"NSAccessibilitySelectedRowsAttribute"; NSString *const NSAccessibilitySortDirectionAttribute = - @"NSAccessibilitySortDirectionAttribute"; + @"NSAccessibilitySortDirectionAttribute"; NSString *const NSAccessibilityVisibleColumnsAttribute = - @"NSAccessibilityVisibleColumnsAttribute"; + @"NSAccessibilityVisibleColumnsAttribute"; NSString *const NSAccessibilityVisibleRowsAttribute = - @"NSAccessibilityVisibleRowsAttribute"; + @"NSAccessibilityVisibleRowsAttribute"; NSString *const NSAccessibilityDisclosedByRowAttribute = - @"NSAccessibilityDisclosedByRowAttribute"; + @"NSAccessibilityDisclosedByRowAttribute"; NSString *const NSAccessibilityDisclosedRowsAttribute = - @"NSAccessibilityDisclosedRowsAttribute"; + @"NSAccessibilityDisclosedRowsAttribute"; NSString *const NSAccessibilityDisclosingAttribute = - @"NSAccessibilityDisclosingAttribute"; + @"NSAccessibilityDisclosingAttribute"; NSString *const NSAccessibilityDisclosureLevelAttribute = - @"NSAccessibilityDisclosureLevelAttribute"; + @"NSAccessibilityDisclosureLevelAttribute"; NSString *const NSAccessibilitySelectedCellsAttribute = - @"NSAccessibilitySelectedCellsAttribute"; + @"NSAccessibilitySelectedCellsAttribute"; NSString *const NSAccessibilityVisibleCellsAttribute = - @"NSAccessibilityVisibleCellsAttribute"; + @"NSAccessibilityVisibleCellsAttribute"; NSString *const NSAccessibilityCellForColumnAndRowParameterizedAttribute = - @"NSAccessibilityCellForColumnAndRowParameterizedAttribute"; + @"NSAccessibilityCellForColumnAndRowParameterizedAttribute"; NSString *const NSAccessibilityRowIndexRangeAttribute = - @"NSAccessibilityRowIndexRangeAttribute"; + @"NSAccessibilityRowIndexRangeAttribute"; NSString *const NSAccessibilityColumnIndexRangeAttribute = - @"NSAccessibilityColumnIndexRangeAttribute"; + @"NSAccessibilityColumnIndexRangeAttribute"; NSString *const NSAccessibilityAscendingSortDirectionValue = - @"NSAccessibilityAscendingSortDirectionValue"; + @"NSAccessibilityAscendingSortDirectionValue"; NSString *const NSAccessibilityDescendingSortDirectionValue = - @"NSAccessibilityDescendingSortDirectionValue"; + @"NSAccessibilityDescendingSortDirectionValue"; NSString *const NSAccessibilityUnknownSortDirectionValue = - @"NSAccessibilityUnknownSortDirectionValue"; + @"NSAccessibilityUnknownSortDirectionValue"; NSString *const NSAccessibilityHorizontalUnitsAttribute = - @"NSAccessibilityHorizontalUnitsAttribute"; + @"NSAccessibilityHorizontalUnitsAttribute"; NSString *const NSAccessibilityVerticalUnitsAttribute = - @"NSAccessibilityVerticalUnitsAttribute"; + @"NSAccessibilityVerticalUnitsAttribute"; NSString *const NSAccessibilityHorizontalUnitDescriptionAttribute = - @"NSAccessibilityHorizontalUnitDescriptionAttribute"; + @"NSAccessibilityHorizontalUnitDescriptionAttribute"; NSString *const NSAccessibilityVerticalUnitDescriptionAttribute = - @"NSAccessibilityVerticalUnitDescriptionAttribute"; + @"NSAccessibilityVerticalUnitDescriptionAttribute"; NSString *const NSAccessibilityLayoutPointForScreenPointParameterizedAttribute = - @"NSAccessibilityLayoutPointForScreenPointParameterizedAttribute"; + @"NSAccessibilityLayoutPointForScreenPointParameterizedAttribute"; NSString *const NSAccessibilityLayoutSizeForScreenSizeParameterizedAttribute = - @"NSAccessibilityLayoutSizeForScreenSizeParameterizedAttribute"; + @"NSAccessibilityLayoutSizeForScreenSizeParameterizedAttribute"; NSString *const NSAccessibilityScreenPointForLayoutPointParameterizedAttribute = - @"NSAccessibilityScreenPointForLayoutPointParameterizedAttribute"; + @"NSAccessibilityScreenPointForLayoutPointParameterizedAttribute"; NSString *const NSAccessibilityScreenSizeForLayoutSizeParameterizedAttribute = - @"NSAccessibilityScreenSizeForLayoutSizeParameterizedAttribute"; + @"NSAccessibilityScreenSizeForLayoutSizeParameterizedAttribute"; NSString *const NSAccessibilityHandlesAttribute = - @"NSAccessibilityHandlesAttribute"; + @"NSAccessibilityHandlesAttribute"; NSString *const NSAccessibilityAllowedValuesAttribute = - @"NSAccessibilityAllowedValuesAttribute"; + @"NSAccessibilityAllowedValuesAttribute"; NSString *const NSAccessibilityLabelUIElementsAttribute = - @"NSAccessibilityLabelUIElementsAttribute"; + @"NSAccessibilityLabelUIElementsAttribute"; NSString *const NSAccessibilityLabelValueAttribute = - @"NSAccessibilityLabelValueAttribute"; + @"NSAccessibilityLabelValueAttribute"; NSString *const NSAccessibilityMatteContentUIElementAttribute = - @"NSAccessibilityMatteContentUIElementAttribute"; + @"NSAccessibilityMatteContentUIElementAttribute"; NSString *const NSAccessibilityMatteHoleAttribute = - @"NSAccessibilityMatteHoleAttribute"; + @"NSAccessibilityMatteHoleAttribute"; NSString *const NSAccessibilityMarkerGroupUIElementAttribute = - @"NSAccessibilityMarkerGroupUIElementAttribute"; + @"NSAccessibilityMarkerGroupUIElementAttribute"; NSString *const NSAccessibilityMarkerTypeAttribute = - @"NSAccessibilityMarkerTypeAttribute"; + @"NSAccessibilityMarkerTypeAttribute"; NSString *const NSAccessibilityMarkerTypeDescriptionAttribute = - @"NSAccessibilityMarkerTypeDescriptionAttribute"; + @"NSAccessibilityMarkerTypeDescriptionAttribute"; NSString *const NSAccessibilityMarkerUIElementsAttribute = - @"NSAccessibilityMarkerUIElementsAttribute"; + @"NSAccessibilityMarkerUIElementsAttribute"; NSString *const NSAccessibilityMarkerValuesAttribute = - @"NSAccessibilityMarkerValuesAttribute"; + @"NSAccessibilityMarkerValuesAttribute"; NSString *const NSAccessibilityUnitDescriptionAttribute = - @"NSAccessibilityUnitDescriptionAttribute"; + @"NSAccessibilityUnitDescriptionAttribute"; NSString *const NSAccessibilityUnitsAttribute = - @"NSAccessibilityUnitsAttribute"; + @"NSAccessibilityUnitsAttribute"; NSString *const NSAccessibilityCenterTabStopMarkerTypeValue = - @"NSAccessibilityCenterTabStopMarkerTypeValue"; + @"NSAccessibilityCenterTabStopMarkerTypeValue"; NSString *const NSAccessibilityDecimalTabStopMarkerTypeValue = - @"NSAccessibilityDecimalTabStopMarkerTypeValue"; + @"NSAccessibilityDecimalTabStopMarkerTypeValue"; NSString *const NSAccessibilityFirstLineIndentMarkerTypeValue = - @"NSAccessibilityFirstLineIndentMarkerTypeValue"; + @"NSAccessibilityFirstLineIndentMarkerTypeValue"; NSString *const NSAccessibilityHeadIndentMarkerTypeValue = - @"NSAccessibilityHeadIndentMarkerTypeValue"; + @"NSAccessibilityHeadIndentMarkerTypeValue"; NSString *const NSAccessibilityLeftTabStopMarkerTypeValue = - @"NSAccessibilityLeftTabStopMarkerTypeValue"; + @"NSAccessibilityLeftTabStopMarkerTypeValue"; NSString *const NSAccessibilityRightTabStopMarkerTypeValue = - @"NSAccessibilityRightTabStopMarkerTypeValue"; + @"NSAccessibilityRightTabStopMarkerTypeValue"; NSString *const NSAccessibilityTailIndentMarkerTypeValue = - @"NSAccessibilityTailIndentMarkerTypeValue"; + @"NSAccessibilityTailIndentMarkerTypeValue"; NSString *const NSAccessibilityUnknownMarkerTypeValue = - @"NSAccessibilityUnknownMarkerTypeValue"; + @"NSAccessibilityUnknownMarkerTypeValue"; NSString *const NSAccessibilityCentimetersUnitValue = - @"NSAccessibilityCentimetersUnitValue"; + @"NSAccessibilityCentimetersUnitValue"; NSString *const NSAccessibilityInchesUnitValue = - @"NSAccessibilityInchesUnitValue"; + @"NSAccessibilityInchesUnitValue"; NSString *const NSAccessibilityPicasUnitValue = - @"NSAccessibilityPicasUnitValue"; + @"NSAccessibilityPicasUnitValue"; NSString *const NSAccessibilityPointsUnitValue = - @"NSAccessibilityPointsUnitValue"; + @"NSAccessibilityPointsUnitValue"; NSString *const NSAccessibilityUnknownUnitValue = - @"NSAccessibilityUnknownUnitValue"; + @"NSAccessibilityUnknownUnitValue"; NSString *const NSAccessibilityLinkedUIElementsAttribute = - @"NSAccessibilityLinkedUIElementsAttribute"; + @"NSAccessibilityLinkedUIElementsAttribute"; NSString *const NSAccessibilityServesAsTitleForUIElementsAttribute = - @"NSAccessibilityServesAsTitleForUIElementsAttribute"; + @"NSAccessibilityServesAsTitleForUIElementsAttribute"; NSString *const NSAccessibilityTitleUIElementAttribute = - @"NSAccessibilityTitleUIElementAttribute"; + @"NSAccessibilityTitleUIElementAttribute"; NSString *const NSAccessibilityDecrementButtonAttribute = - @"NSAccessibilityDecrementButtonAttribute"; + @"NSAccessibilityDecrementButtonAttribute"; NSString *const NSAccessibilityDocumentAttribute = - @"NSAccessibilityDocumentAttribute"; + @"NSAccessibilityDocumentAttribute"; NSString *const NSAccessibilityEditedAttribute = - @"NSAccessibilityEditedAttribute"; + @"NSAccessibilityEditedAttribute"; NSString *const NSAccessibilityExpandedAttribute = - @"NSAccessibilityExpandedAttribute"; + @"NSAccessibilityExpandedAttribute"; NSString *const NSAccessibilityFilenameAttribute = - @"NSAccessibilityFilenameAttribute"; + @"NSAccessibilityFilenameAttribute"; NSString *const NSAccessibilityHeaderAttribute = - @"NSAccessibilityHeaderAttribute"; + @"NSAccessibilityHeaderAttribute"; NSString *const NSAccessibilityHorizontalScrollBarAttribute = - @"NSAccessibilityHorizontalScrollBarAttribute"; + @"NSAccessibilityHorizontalScrollBarAttribute"; NSString *const NSAccessibilityIncrementButtonAttribute = - @"NSAccessibilityIncrementButtonAttribute"; + @"NSAccessibilityIncrementButtonAttribute"; NSString *const NSAccessibilityIndexAttribute = - @"NSAccessibilityIndexAttribute"; + @"NSAccessibilityIndexAttribute"; NSString *const NSAccessibilityNextContentsAttribute = - @"NSAccessibilityNextContentsAttribute"; + @"NSAccessibilityNextContentsAttribute"; NSString *const NSAccessibilityOverflowButtonAttribute = - @"NSAccessibilityOverflowButtonAttribute"; + @"NSAccessibilityOverflowButtonAttribute"; NSString *const NSAccessibilityPreviousContentsAttribute = - @"NSAccessibilityPreviousContentsAttribute"; + @"NSAccessibilityPreviousContentsAttribute"; NSString *const NSAccessibilitySelectedAttribute = - @"NSAccessibilitySelectedAttribute"; + @"NSAccessibilitySelectedAttribute"; NSString *const NSAccessibilitySplittersAttribute = - @"NSAccessibilitySplittersAttribute"; + @"NSAccessibilitySplittersAttribute"; NSString *const NSAccessibilityTabsAttribute = @"NSAccessibilityTabsAttribute"; NSString *const NSAccessibilityURLAttribute = @"NSAccessibilityURLAttribute"; NSString *const NSAccessibilityVerticalScrollBarAttribute = - @"NSAccessibilityVerticalScrollBarAttribute"; + @"NSAccessibilityVerticalScrollBarAttribute"; NSString *const NSAccessibilityWarningValueAttribute = - @"NSAccessibilityWarningValueAttribute"; + @"NSAccessibilityWarningValueAttribute"; NSString *const NSAccessibilityCriticalValueAttribute = - @"NSAccessibilityCriticalValueAttribute"; + @"NSAccessibilityCriticalValueAttribute"; NSString *const NSAccessibilityPlaceholderValueAttribute = - @"NSAccessibilityPlaceholderValueAttribute"; + @"NSAccessibilityPlaceholderValueAttribute"; NSString *const NSAccessibilityApplicationRole = - @"NSAccessibilityApplicationRole"; + @"NSAccessibilityApplicationRole"; NSString *const NSAccessibilityBrowserRole = @"NSAccessibilityBrowserRole"; NSString *const NSAccessibilityBusyIndicatorRole = - @"NSAccessibilityBusyIndicatorRole"; + @"NSAccessibilityBusyIndicatorRole"; NSString *const NSAccessibilityButtonRole = @"NSAccessibilityButtonRole"; NSString *const NSAccessibilityCellRole = @"NSAccessibilityCellRole"; NSString *const NSAccessibilityCheckBoxRole = @"NSAccessibilityCheckBoxRole"; @@ -351,7 +351,7 @@ NSString *const NSAccessibilityColorWellRole = @"NSAccessibilityColorWellRole"; NSString *const NSAccessibilityColumnRole = @"NSAccessibilityColumnRole"; NSString *const NSAccessibilityComboBoxRole = @"NSAccessibilityComboBoxRole"; NSString *const NSAccessibilityDisclosureTriangleRole = - @"NSAccessibilityDisclosureTriangleRole"; + @"NSAccessibilityDisclosureTriangleRole"; NSString *const NSAccessibilityDrawerRole = @"NSAccessibilityDrawerRole"; NSString *const NSAccessibilityGridRole = @"NSAccessibilityGridRole"; NSString *const NSAccessibilityGroupRole = @"NSAccessibilityGroupRole"; @@ -360,48 +360,48 @@ NSString *const NSAccessibilityHandleRole = @"NSAccessibilityHandleRole"; NSString *const NSAccessibilityHelpTagRole = @"NSAccessibilityHelpTagRole"; NSString *const NSAccessibilityImageRole = @"NSAccessibilityImageRole"; NSString *const NSAccessibilityIncrementorRole = - @"NSAccessibilityIncrementorRole"; + @"NSAccessibilityIncrementorRole"; NSString *const NSAccessibilityLayoutAreaRole = - @"NSAccessibilityLayoutAreaRole"; + @"NSAccessibilityLayoutAreaRole"; NSString *const NSAccessibilityLayoutItemRole = - @"NSAccessibilityLayoutItemRole"; + @"NSAccessibilityLayoutItemRole"; NSString *const NSAccessibilityLinkRole = @"NSAccessibilityLinkRole"; NSString *const NSAccessibilityListRole = @"NSAccessibilityListRole"; NSString *const NSAccessibilityMatteRole = @"NSAccessibilityMatteRole"; NSString *const NSAccessibilityMenuBarRole = @"NSAccessibilityMenuBarRole"; NSString *const NSAccessibilityMenuButtonRole = - @"NSAccessibilityMenuButtonRole"; + @"NSAccessibilityMenuButtonRole"; NSString *const NSAccessibilityMenuItemRole = @"NSAccessibilityMenuItemRole"; NSString *const NSAccessibilityMenuRole = @"NSAccessibilityMenuRole"; NSString *const NSAccessibilityOutlineRole = @"NSAccessibilityOutlineRole"; NSString *const NSAccessibilityPopUpButtonRole = - @"NSAccessibilityPopUpButtonRole"; + @"NSAccessibilityPopUpButtonRole"; NSString *const NSAccessibilityProgressIndicatorRole = - @"NSAccessibilityProgressIndicatorRole"; + @"NSAccessibilityProgressIndicatorRole"; NSString *const NSAccessibilityRadioButtonRole = - @"NSAccessibilityRadioButtonRole"; + @"NSAccessibilityRadioButtonRole"; NSString *const NSAccessibilityRadioGroupRole = - @"NSAccessibilityRadioGroupRole"; + @"NSAccessibilityRadioGroupRole"; NSString *const NSAccessibilityRelevanceIndicatorRole = - @"NSAccessibilityRelevanceIndicatorRole"; + @"NSAccessibilityRelevanceIndicatorRole"; NSString *const NSAccessibilityRowRole = @"NSAccessibilityRowRole"; NSString *const NSAccessibilityRulerMarkerRole = - @"NSAccessibilityRulerMarkerRole"; + @"NSAccessibilityRulerMarkerRole"; NSString *const NSAccessibilityRulerRole = @"NSAccessibilityRulerRole"; NSString *const NSAccessibilityScrollAreaRole = - @"NSAccessibilityScrollAreaRole"; + @"NSAccessibilityScrollAreaRole"; NSString *const NSAccessibilityScrollBarRole = @"NSAccessibilityScrollBarRole"; NSString *const NSAccessibilitySheetRole = @"NSAccessibilitySheetRole"; NSString *const NSAccessibilitySliderRole = @"NSAccessibilitySliderRole"; NSString *const NSAccessibilitySortButtonRole = - @"NSAccessibilitySortButtonRole"; + @"NSAccessibilitySortButtonRole"; NSString *const NSAccessibilitySplitGroupRole = - @"NSAccessibilitySplitGroupRole"; + @"NSAccessibilitySplitGroupRole"; NSString *const NSAccessibilitySplitterRole = @"NSAccessibilitySplitterRole"; NSString *const NSAccessibilityStaticTextRole = - @"NSAccessibilityStaticTextRole"; + @"NSAccessibilityStaticTextRole"; NSString *const NSAccessibilitySystemWideRole = - @"NSAccessibilitySystemWideRole"; + @"NSAccessibilitySystemWideRole"; NSString *const NSAccessibilityTabGroupRole = @"NSAccessibilityTabGroupRole"; NSString *const NSAccessibilityTableRole = @"NSAccessibilityTableRole"; NSString *const NSAccessibilityTextAreaRole = @"NSAccessibilityTextAreaRole"; @@ -409,142 +409,142 @@ NSString *const NSAccessibilityTextFieldRole = @"NSAccessibilityTextFieldRole"; NSString *const NSAccessibilityToolbarRole = @"NSAccessibilityToolbarRole"; NSString *const NSAccessibilityUnknownRole = @"NSAccessibilityUnknownRole"; NSString *const NSAccessibilityValueIndicatorRole = - @"NSAccessibilityValueIndicatorRole"; + @"NSAccessibilityValueIndicatorRole"; NSString *const NSAccessibilityWindowRole = @"NSAccessibilityWindowRole"; NSString *const NSAccessibilityCloseButtonSubrole = - @"NSAccessibilityCloseButtonSubrole"; + @"NSAccessibilityCloseButtonSubrole"; NSString *const NSAccessibilityDecrementArrowSubrole = - @"NSAccessibilityDecrementArrowSubrole"; + @"NSAccessibilityDecrementArrowSubrole"; NSString *const NSAccessibilityDecrementPageSubrole = - @"NSAccessibilityDecrementPageSubrole"; + @"NSAccessibilityDecrementPageSubrole"; NSString *const NSAccessibilityDialogSubrole = @"NSAccessibilityDialogSubrole"; NSString *const NSAccessibilityFloatingWindowSubrole = - @"NSAccessibilityFloatingWindowSubrole"; + @"NSAccessibilityFloatingWindowSubrole"; NSString *const NSAccessibilityIncrementArrowSubrole = - @"NSAccessibilityIncrementArrowSubrole"; + @"NSAccessibilityIncrementArrowSubrole"; NSString *const NSAccessibilityIncrementPageSubrole = - @"NSAccessibilityIncrementPageSubrole"; + @"NSAccessibilityIncrementPageSubrole"; NSString *const NSAccessibilityMinimizeButtonSubrole = - @"NSAccessibilityMinimizeButtonSubrole"; + @"NSAccessibilityMinimizeButtonSubrole"; NSString *const NSAccessibilityOutlineRowSubrole = - @"NSAccessibilityOutlineRowSubrole"; + @"NSAccessibilityOutlineRowSubrole"; NSString *const NSAccessibilitySearchFieldSubrole = - @"NSAccessibilitySearchFieldSubrole"; + @"NSAccessibilitySearchFieldSubrole"; NSString *const NSAccessibilitySecureTextFieldSubrole = - @"NSAccessibilitySecureTextFieldSubrole"; + @"NSAccessibilitySecureTextFieldSubrole"; NSString *const NSAccessibilityStandardWindowSubrole = - @"NSAccessibilityStandardWindowSubrole"; + @"NSAccessibilityStandardWindowSubrole"; NSString *const NSAccessibilitySystemDialogSubrole = - @"NSAccessibilitySystemDialogSubrole"; + @"NSAccessibilitySystemDialogSubrole"; NSString *const NSAccessibilitySystemFloatingWindowSubrole = - @"NSAccessibilitySystemFloatingWindowSubrole"; + @"NSAccessibilitySystemFloatingWindowSubrole"; NSString *const NSAccessibilityTableRowSubrole = - @"NSAccessibilityTableRowSubrole"; + @"NSAccessibilityTableRowSubrole"; NSString *const NSAccessibilityTextAttachmentSubrole = - @"NSAccessibilityTextAttachmentSubrole"; + @"NSAccessibilityTextAttachmentSubrole"; NSString *const NSAccessibilityTextLinkSubrole = - @"NSAccessibilityTextLinkSubrole"; + @"NSAccessibilityTextLinkSubrole"; NSString *const NSAccessibilityTimelineSubrole = - @"NSAccessibilityTimelineSubrole"; + @"NSAccessibilityTimelineSubrole"; NSString *const NSAccessibilityToolbarButtonSubrole = - @"NSAccessibilityToolbarButtonSubrole"; + @"NSAccessibilityToolbarButtonSubrole"; NSString *const NSAccessibilityUnknownSubrole = - @"NSAccessibilityUnknownSubrole"; + @"NSAccessibilityUnknownSubrole"; NSString *const NSAccessibilityZoomButtonSubrole = - @"NSAccessibilityZoomButtonSubrole"; + @"NSAccessibilityZoomButtonSubrole"; NSString *const NSAccessibilitySortButtonSubrole = - @"NSAccessibilitySortButtonSubrole"; + @"NSAccessibilitySortButtonSubrole"; NSString *const NSAccessibilityRatingIndicatorSubrole = - @"NSAccessibilityRatingIndicatorSubrole"; + @"NSAccessibilityRatingIndicatorSubrole"; NSString *const NSAccessibilityContentListSubrole = - @"NSAccessibilityContentListSubrole"; + @"NSAccessibilityContentListSubrole"; NSString *const NSAccessibilityDefinitionListSubrole = - @"NSAccessibilityDefinitionListSubrole"; + @"NSAccessibilityDefinitionListSubrole"; NSString *const NSAccessibilityCancelAction = @"NSAccessibilityCancelAction"; NSString *const NSAccessibilityConfirmAction = @"NSAccessibilityConfirmAction"; NSString *const NSAccessibilityDecrementAction = - @"NSAccessibilityDecrementAction"; + @"NSAccessibilityDecrementAction"; NSString *const NSAccessibilityDeleteAction = @"NSAccessibilityDeleteAction"; NSString *const NSAccessibilityIncrementAction = - @"NSAccessibilityIncrementAction"; + @"NSAccessibilityIncrementAction"; NSString *const NSAccessibilityPickAction = @"NSAccessibilityPickAction"; NSString *const NSAccessibilityPressAction = @"NSAccessibilityPressAction"; NSString *const NSAccessibilityRaiseAction = @"NSAccessibilityRaiseAction"; NSString *const NSAccessibilityShowMenuAction = - @"NSAccessibilityShowMenuAction"; + @"NSAccessibilityShowMenuAction"; NSString *const NSAccessibilityMainWindowChangedNotification = - @"NSAccessibilityMainWindowChangedNotification"; + @"NSAccessibilityMainWindowChangedNotification"; NSString *const NSAccessibilityFocusedWindowChangedNotification = - @"NSAccessibilityFocusedWindowChangedNotification"; + @"NSAccessibilityFocusedWindowChangedNotification"; NSString *const NSAccessibilityFocusedUIElementChangedNotification = - @"NSAccessibilityFocusedUIElementChangedNotification"; + @"NSAccessibilityFocusedUIElementChangedNotification"; NSString *const NSAccessibilityWindowCreatedNotification = - @"NSAccessibilityWindowCreatedNotification"; + @"NSAccessibilityWindowCreatedNotification"; NSString *const NSAccessibilityWindowDeminiaturizedNotification = - @"NSAccessibilityWindowDeminiaturizedNotification"; + @"NSAccessibilityWindowDeminiaturizedNotification"; NSString *const NSAccessibilityWindowMiniaturizedNotification = - @"NSAccessibilityWindowMiniaturizedNotification"; + @"NSAccessibilityWindowMiniaturizedNotification"; NSString *const NSAccessibilityWindowMovedNotification = - @"NSAccessibilityWindowMovedNotification"; + @"NSAccessibilityWindowMovedNotification"; NSString *const NSAccessibilityWindowResizedNotification = - @"NSAccessibilityWindowResizedNotification"; + @"NSAccessibilityWindowResizedNotification"; NSString *const NSAccessibilityApplicationActivatedNotification = - @"NSAccessibilityApplicationActivatedNotification"; + @"NSAccessibilityApplicationActivatedNotification"; NSString *const NSAccessibilityApplicationDeactivatedNotification = - @"NSAccessibilityApplicationDeactivatedNotification"; + @"NSAccessibilityApplicationDeactivatedNotification"; NSString *const NSAccessibilityApplicationHiddenNotification = - @"NSAccessibilityApplicationHiddenNotification"; + @"NSAccessibilityApplicationHiddenNotification"; NSString *const NSAccessibilityApplicationShownNotification = - @"NSAccessibilityApplicationShownNotification"; + @"NSAccessibilityApplicationShownNotification"; NSString *const NSAccessibilityDrawerCreatedNotification = - @"NSAccessibilityDrawerCreatedNotification"; + @"NSAccessibilityDrawerCreatedNotification"; NSString *const NSAccessibilitySheetCreatedNotification = - @"NSAccessibilitySheetCreatedNotification"; + @"NSAccessibilitySheetCreatedNotification"; NSString *const NSAccessibilityCreatedNotification = - @"NSAccessibilityCreatedNotification"; + @"NSAccessibilityCreatedNotification"; NSString *const NSAccessibilityMovedNotification = - @"NSAccessibilityMovedNotification"; + @"NSAccessibilityMovedNotification"; NSString *const NSAccessibilityResizedNotification = - @"NSAccessibilityResizedNotification"; + @"NSAccessibilityResizedNotification"; NSString *const NSAccessibilityTitleChangedNotification = - @"NSAccessibilityTitleChangedNotification"; + @"NSAccessibilityTitleChangedNotification"; NSString *const NSAccessibilityUIElementDestroyedNotification = - @"NSAccessibilityUIElementDestroyedNotification"; + @"NSAccessibilityUIElementDestroyedNotification"; NSString *const NSAccessibilityValueChangedNotification = - @"NSAccessibilityValueChangedNotification"; + @"NSAccessibilityValueChangedNotification"; NSString *const NSAccessibilityHelpTagCreatedNotification = - @"NSAccessibilityHelpTagCreatedNotification"; + @"NSAccessibilityHelpTagCreatedNotification"; NSString *const NSAccessibilityRowCountChangedNotification = - @"NSAccessibilityRowCountChangedNotification"; + @"NSAccessibilityRowCountChangedNotification"; NSString *const NSAccessibilitySelectedChildrenChangedNotification = - @"NSAccessibilitySelectedChildrenChangedNotification"; + @"NSAccessibilitySelectedChildrenChangedNotification"; NSString *const NSAccessibilitySelectedColumnsChangedNotification = - @"NSAccessibilitySelectedColumnsChangedNotification"; + @"NSAccessibilitySelectedColumnsChangedNotification"; NSString *const NSAccessibilitySelectedRowsChangedNotification = - @"NSAccessibilitySelectedRowsChangedNotification"; + @"NSAccessibilitySelectedRowsChangedNotification"; NSString *const NSAccessibilitySelectedTextChangedNotification = - @"NSAccessibilitySelectedTextChangedNotification"; + @"NSAccessibilitySelectedTextChangedNotification"; NSString *const NSAccessibilityRowExpandedNotification = - @"NSAccessibilityRowExpandedNotification"; + @"NSAccessibilityRowExpandedNotification"; NSString *const NSAccessibilityRowCollapsedNotification = - @"NSAccessibilityRowCollapsedNotification"; + @"NSAccessibilityRowCollapsedNotification"; NSString *const NSAccessibilitySelectedCellsChangedNotification = - @"NSAccessibilitySelectedCellsChangedNotification"; + @"NSAccessibilitySelectedCellsChangedNotification"; NSString *const NSAccessibilityUnitsChangedNotification = - @"NSAccessibilityUnitsChangedNotification"; + @"NSAccessibilityUnitsChangedNotification"; NSString *const NSAccessibilitySelectedChildrenMovedNotification = - @"NSAccessibilitySelectedChildrenMovedNotification"; + @"NSAccessibilitySelectedChildrenMovedNotification"; NSString *const NSAccessibilityErrorCodeExceptionInfo = - @"NSAccessibilityErrorCodeExceptionInfo"; + @"NSAccessibilityErrorCodeExceptionInfo"; /* The above constants are probably all wrong */ /* The one below is right */ @@ -553,14 +553,14 @@ NSString *const NSAccessibilityActivationPointAttribute = @"AXActivationPoint"; /* Undocumented */ NSString *const NSAccessibilityEventProcessedNotification = @"AXEventProcessed"; NSString *const NSAccessibilityEventSourceProcessIDKey = - @"AXEventSourceProcessIDKey"; + @"AXEventSourceProcessIDKey"; NSString *const NSAccessibilityEventSourceStateIDKey = @"AXEventSourceStateID"; NSString *const NSAccessibilityEventSourceUserDataKey = - @"AXEventSourceUserDataKey"; + @"AXEventSourceUserDataKey"; NSString *const NSAccessibilityEventTimestampKey = @"AXEventTimestampKey"; NSString *const NSAccessibilityMainThreadIdleNotification = @"AXMainThreadIdle"; NSString *const NSAccessibilitySupportsMainThreadIdleNotificationAttribute = - @"AXSupportsMainThreadIdleNotification"; + @"AXSupportsMainThreadIdleNotification"; /* End undocumented */ NSString *const NSAccessibilityLayoutChangedNotification = @"AXLayoutChanged"; diff --git a/AppKit/NSAlert.m b/AppKit/NSAlert.m index d6e53a2b..af076cf5 100644 --- a/AppKit/NSAlert.m +++ b/AppKit/NSAlert.m @@ -45,8 +45,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _style = NSWarningAlertStyle; _icon = [[NSImage imageNamed: @"NSAlertPanelExclamation"] retain]; _messageText = [NSLocalizedStringFromTableInBundle( - @"Alert", nil, [NSBundle bundleForClass: [NSAlert class]], - @"Default message text for NSAlert") copy]; + @"Alert", nil, [NSBundle bundleForClass: [NSAlert class]], + @"Default message text for NSAlert") copy]; _informativeText = @""; _accessoryView = nil; _showsHelp = NO; @@ -60,10 +60,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _suppressionButton = [[NSButton alloc] init]; // [_suppressionButton setButtonType:NSSwitchButton]; [_suppressionButton - setTitle: NSLocalizedStringFromTableInBundle( - @"Do not show this message again", nil, - [NSBundle bundleForClass: [NSAlert class]], - @"Default NSAlert supression button title")]; + setTitle: NSLocalizedStringFromTableInBundle( + @"Do not show this message again", nil, + [NSBundle bundleForClass: [NSAlert class]], + @"Default NSAlert supression button title")]; _needsLayout = YES; return self; } @@ -83,11 +83,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSAlert *) alertWithError: (NSError *) error { NSArray *titles = [error localizedRecoveryOptions]; NSString *defaultTitle = - ([titles count] > 0) ? [titles objectAtIndex: 0] : nil; + ([titles count] > 0) ? [titles objectAtIndex: 0] : nil; NSString *alternateTitle = - ([titles count] > 1) ? [titles objectAtIndex: 1] : nil; + ([titles count] > 1) ? [titles objectAtIndex: 1] : nil; NSString *otherTitle = - ([titles count] > 2) ? [titles objectAtIndex: 2] : nil; + ([titles count] > 2) ? [titles objectAtIndex: 2] : nil; NSAlert *result = [[[self alloc] init] autorelease]; @@ -112,8 +112,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ va_start(arguments, format); informativeText = - [[[NSString alloc] initWithFormat: format - arguments: arguments] autorelease]; + [[[NSString alloc] initWithFormat: format + arguments: arguments] autorelease]; NSAlert *result = [[[self alloc] init] autorelease]; @@ -121,8 +121,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [result setInformativeText: informativeText]; if (defaultTitle == nil) defaultTitle = NSLocalizedStringFromTableInBundle( - @"OK", nil, [NSBundle bundleForClass: [NSAlert class]], - @"Default button title for NSAlert"); + @"OK", nil, [NSBundle bundleForClass: [NSAlert class]], + @"Default button title for NSAlert"); [result addButtonWithTitle: defaultTitle]; if (alternateTitle != nil) [result addButtonWithTitle: alternateTitle]; @@ -273,21 +273,21 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSStringDrawer *drawer = [NSStringDrawer sharedStringDrawer]; NSSize iconSize = (_icon != nil) ? [_icon size] : NSZeroSize; NSDictionary *messageAttributes = [NSDictionary - dictionaryWithObjectsAndKeys: [NSFont boldSystemFontOfSize: 0], - NSFontAttributeName, nil]; + dictionaryWithObjectsAndKeys: [NSFont boldSystemFontOfSize: 0], + NSFontAttributeName, nil]; NSSize messageSize = NSZeroSize; NSDictionary *informativeAttributes = [NSDictionary - dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize: 0], - NSFontAttributeName, nil]; + dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize: 0], + NSFontAttributeName, nil]; NSSize informativeSize = NSZeroSize; CGFloat messageInformativeGap = 0.; NSDictionary *suppressionAttributes = [NSDictionary - dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize: 0], - NSFontAttributeName, nil]; + dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize: 0], + NSFontAttributeName, nil]; NSSize supressionSize = NSZeroSize; CGFloat informativeSuppressionGap = 0.; NSSize accessorySize = - (_accessoryView != nil) ? [_accessoryView frame].size : NSZeroSize; + (_accessoryView != nil) ? [_accessoryView frame].size : NSZeroSize; CGFloat suppressionAccessoryGap = 0.; NSSize mainSize = NSZeroSize; NSSize panelSize = NSZeroSize; @@ -303,7 +303,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSSize size = [drawer sizeOfAttributedString: title inSize: NSZeroSize]; okCancelButtonSize.width = - MAX(size.width + BUTTON_MARGIN * 2, okCancelButtonSize.width); + MAX(size.width + BUTTON_MARGIN * 2, okCancelButtonSize.width); okCancelButtonSize.height = MAX(size.height, okCancelButtonSize.height); } @@ -316,7 +316,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSSize size = [drawer sizeOfAttributedString: title inSize: NSZeroSize]; otherButtonSize.width = - MAX(size.width + BUTTON_MARGIN * 2, otherButtonSize.width); + MAX(size.width + BUTTON_MARGIN * 2, otherButtonSize.width); otherButtonSize.height = MAX(size.height, otherButtonSize.height); } @@ -328,7 +328,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ allButtonsSize.width += [button frame].size.width; allButtonsSize.height = - MAX(allButtonsSize.height, [button frame].size.height); + MAX(allButtonsSize.height, [button frame].size.height); allButtonsSize.width += INTERBUTTON_GAP; if (i == 1) @@ -406,11 +406,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ frame.origin.y = panelSize.height - TOP_MARGIN - messageSize.height; frame.size = messageSize; textField = [[[NSTextField alloc] initWithFrame: frame] autorelease]; - [textField - setAttributedStringValue: [[[NSAttributedString alloc] - initWithString: _messageText - attributes: messageAttributes] - autorelease]]; + [textField setAttributedStringValue: + [[[NSAttributedString alloc] + initWithString: _messageText + attributes: messageAttributes] + autorelease]]; [textField setEditable: NO]; [textField setSelectable: YES]; [textField setBordered: NO]; @@ -426,10 +426,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ messageInformativeGap - informativeSize.height; frame.size = informativeSize; textField = [[[NSTextField alloc] initWithFrame: frame] autorelease]; - [textField setStringValue: [[[NSAttributedString alloc] - initWithString: _informativeText - attributes: informativeAttributes] - autorelease]]; + [textField + setStringValue: [[[NSAttributedString alloc] + initWithString: _informativeText + attributes: informativeAttributes] + autorelease]]; [textField setEditable: NO]; [textField setSelectable: YES]; [textField setBordered: NO]; @@ -491,11 +492,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // manual layout if (_needsLayout) { if ([_buttons count] == 0) { - [self addButtonWithTitle: NSLocalizedStringFromTableInBundle( - @"OK", nil, - [NSBundle - bundleForClass: [NSAlert class]], - @"Default button title for NSAlert")]; + [self addButtonWithTitle: + NSLocalizedStringFromTableInBundle( + @"OK", nil, + [NSBundle bundleForClass: [NSAlert class]], + @"Default button title for NSAlert")]; } [self layout]; @@ -509,7 +510,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ typedef void (*alertDidEnd)(id, SEL, NSAlert *, int, void *); if (_sheetDidEnd) { alertDidEnd endFunction = - (alertDidEnd) [_sheetDelegate methodForSelector: _sheetDidEnd]; + (alertDidEnd) [_sheetDelegate methodForSelector: _sheetDidEnd]; endFunction(_sheetDelegate, _sheetDidEnd, self, returnCode, contextInfo); @@ -530,10 +531,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [self retain]; [NSApp beginSheet: _window - modalForWindow: window - modalDelegate: self - didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) - contextInfo: info]; + modalForWindow: window + modalDelegate: self + didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) + contextInfo: info]; } - (NSInteger) runModal { diff --git a/AppKit/NSAlertPanel.h b/AppKit/NSAlertPanel.h index 6fdc91d9..67e74730 100644 --- a/AppKit/NSAlertPanel.h +++ b/AppKit/NSAlertPanel.h @@ -29,10 +29,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithTitle: (NSString *) title - message: (NSString *) message - defaultButton: (NSString *) defaulteTitle - alternateButton: (NSString *) alternateTitle - otherButton: (NSString *) otherTitle - sheet: (BOOL) sheet; + message: (NSString *) message + defaultButton: (NSString *) defaulteTitle + alternateButton: (NSString *) alternateTitle + otherButton: (NSString *) otherTitle + sheet: (BOOL) sheet; @end diff --git a/AppKit/NSAlertPanel.m b/AppKit/NSAlertPanel.m index ba016db3..b96316f5 100644 --- a/AppKit/NSAlertPanel.m +++ b/AppKit/NSAlertPanel.m @@ -36,11 +36,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define BUTTON_MARGIN 8 - initWithTitle: (NSString *) title - message: (NSString *) message - defaultButton: (NSString *) defaultTitle - alternateButton: (NSString *) alternateTitle - otherButton: (NSString *) otherTitle - sheet: (BOOL) sheet + message: (NSString *) message + defaultButton: (NSString *) defaultTitle + alternateButton: (NSString *) alternateTitle + otherButton: (NSString *) otherTitle + sheet: (BOOL) sheet { NSImage *image = [NSImage imageNamed: @"NSAlertPanelExclamation"]; NSSize imageSize = [image size]; @@ -58,7 +58,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (defaultTitle == nil) defaultTitle = NSLocalizedStringFromTableInBundle( - @"OK", nil, [NSBundle bundleForClass: [NSAlertPanel class]], @""); + @"OK", nil, [NSBundle bundleForClass: [NSAlertPanel class]], + @""); defaultSize = [drawer sizeOfString: defaultTitle withAttributes: nil @@ -122,24 +123,24 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ contentRect.origin = NSZeroPoint; contentRect.size = panelSize; - self = [self - initWithContentRect: contentRect - styleMask: sheet ? NSDocModalWindowMask - : NSTitledWindowMask | NSClosableWindowMask - backing: NSBackingStoreBuffered - defer: NO]; + self = [self initWithContentRect: contentRect + styleMask: sheet ? NSDocModalWindowMask + : NSTitledWindowMask | + NSClosableWindowMask + backing: NSBackingStoreBuffered + defer: NO]; if ([title length] == 0) title = NSLocalizedStringFromTableInBundle( - @"Alert", nil, [NSBundle bundleForClass: [NSAlertPanel class]], - @"Alert panel title"); + @"Alert", nil, [NSBundle bundleForClass: [NSAlertPanel class]], + @"Alert panel title"); [self setTitle: title]; [self setLevel: NSModalPanelWindowLevel]; viewFrame.origin.y = BOTTOM_MARGIN; viewFrame.origin.x = - LEFT_MARGIN + floor((panelSize.width - buttonTotalWidth) / 2); + LEFT_MARGIN + floor((panelSize.width - buttonTotalWidth) / 2); viewFrame.size.width = buttonWidth; viewFrame.size.height = buttonHeight; _defaultButton = [[[NSButton alloc] initWithFrame: viewFrame] autorelease]; @@ -156,7 +157,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ viewFrame.size.width = buttonWidth; viewFrame.size.height = buttonHeight; _alternateButton = - [[[NSButton alloc] initWithFrame: viewFrame] autorelease]; + [[[NSButton alloc] initWithFrame: viewFrame] autorelease]; [_alternateButton setTitle: alternateTitle]; [_alternateButton setTarget: self]; [_alternateButton setAction: @selector(alternateButton:)]; @@ -170,7 +171,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ viewFrame.size.width = buttonWidth; viewFrame.size.height = buttonHeight; _otherButton = - [[[NSButton alloc] initWithFrame: viewFrame] autorelease]; + [[[NSButton alloc] initWithFrame: viewFrame] autorelease]; [_otherButton setTitle: otherTitle]; [_otherButton setTarget: self]; [_otherButton setAction: @selector(otherButton:)]; @@ -194,8 +195,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ viewFrame.origin.y -= messageSize.height - imageSize.height; viewFrame.size = messageSize; viewFrame.size.width += - 6; // TextField's like to shrink the title area a bit - so make sure it - // doesn't make it too small for the message! + 6; // TextField's like to shrink the title area a bit - so make sure + // it doesn't make it too small for the message! _messageText = [[[NSTextField alloc] initWithFrame: viewFrame] autorelease]; [_messageText setStringValue: message]; [_messageText setSelectable: YES]; diff --git a/AppKit/NSAnimation/NSAnimation.m b/AppKit/NSAnimation/NSAnimation.m index 5777a16f..505d06aa 100644 --- a/AppKit/NSAnimation/NSAnimation.m +++ b/AppKit/NSAnimation/NSAnimation.m @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSAnimationProgressMarkNotification = - @"NSAnimationProgressMarkNotification"; + @"NSAnimationProgressMarkNotification"; NSString *NSAnimationTriggerOrderIn = @"NSAnimationTriggerOrderIn"; NSString *NSAnimationTriggerOrderOut = @"NSAnimationTriggerOrderOut"; @@ -35,7 +35,7 @@ NSString *NSAnimationRunLoopMode = @"NSAnimationRunLoopMode"; @implementation NSAnimation - initWithDuration: (NSTimeInterval) duration - animationCurve: (NSAnimationCurve) curve + animationCurve: (NSAnimationCurve) curve { _duration = duration; _curve = curve; @@ -207,9 +207,9 @@ NSString *NSAnimationRunLoopMode = @"NSAnimationRunLoopMode"; while (_isAnimating) [[NSRunLoop currentRunLoop] - runMode: NSAnimationRunLoopMode - beforeDate: [NSDate - dateWithTimeIntervalSinceNow: _duration]]; + runMode: NSAnimationRunLoopMode + beforeDate: [NSDate dateWithTimeIntervalSinceNow: + _duration]]; [self _setCurrentProgressAndEndIfNeeded: 1.0]; break; diff --git a/AppKit/NSAnimation/NSViewAnimation.m b/AppKit/NSAnimation/NSViewAnimation.m index 3992fcc0..d29c1fc9 100644 --- a/AppKit/NSAnimation/NSViewAnimation.m +++ b/AppKit/NSAnimation/NSViewAnimation.m @@ -84,17 +84,17 @@ NSString *const NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect"; NSRect currentRect; currentRect.origin.x = - startRect.origin.x + - (endRect.origin.x - startRect.origin.x) * progress; + startRect.origin.x + + (endRect.origin.x - startRect.origin.x) * progress; currentRect.origin.y = - startRect.origin.y + - (endRect.origin.y - startRect.origin.y) * progress; + startRect.origin.y + + (endRect.origin.y - startRect.origin.y) * progress; currentRect.size.width = - startRect.size.width + - (endRect.size.width - startRect.size.width) * progress; + startRect.size.width + + (endRect.size.width - startRect.size.width) * progress; currentRect.size.height = - startRect.size.height + - (endRect.size.height - startRect.size.height) * progress; + startRect.size.height + + (endRect.size.height - startRect.size.height) * progress; if ([target isKindOfClass: [NSView class]]) [target setFrame: currentRect]; diff --git a/AppKit/NSAppearance.m b/AppKit/NSAppearance.m index aa6a1b4d..96a36587 100644 --- a/AppKit/NSAppearance.m +++ b/AppKit/NSAppearance.m @@ -25,16 +25,16 @@ NSString *const NSAppearanceNameLightContent = @"NSAppearanceNameLightContent"; NSString *const NSAppearanceNameVibrantDark = @"NSAppearanceNameVibrantDark"; NSString *const NSAppearanceNameVibrantLight = @"NSAppearanceNameVibrantLight"; NSString *const NSAppearanceNameAccessibilityHighContrastAqua = - @"NSAppearanceNameAccessibilityAqua"; + @"NSAppearanceNameAccessibilityAqua"; NSString *const NSAppearanceNameAccessibilityHighContrastDarkAqua = - @"NSAppearanceNameAccessibilityDarkAqua"; + @"NSAppearanceNameAccessibilityDarkAqua"; NSString *const NSAppearanceNameAccessibilityHighContrastVibrantLight = - @"NSAppearanceNameAccessibilityVibrantLight"; + @"NSAppearanceNameAccessibilityVibrantLight"; NSString *const NSAppearanceNameAccessibilityHighContrastVibrantDark = - @"NSAppearanceNameAccessibilityVibrantDark"; + @"NSAppearanceNameAccessibilityVibrantDark"; NSString *const NSAppearanceNameControlStrip = - @"NSAppearanceNameControlStrip"; // Undocumented + @"NSAppearanceNameControlStrip"; // Undocumented @implementation NSAppearance diff --git a/AppKit/NSApplication.m b/AppKit/NSApplication.m index 9ed51213..c400fd5a 100644 --- a/AppKit/NSApplication.m +++ b/AppKit/NSApplication.m @@ -47,38 +47,38 @@ const NSRunLoopMode NSModalPanelRunLoopMode = @"NSModalPanelRunLoopMode"; const NSRunLoopMode NSEventTrackingRunLoopMode = @"NSEventTrackingRunLoopMode"; const NSNotificationName NSApplicationWillFinishLaunchingNotification = - @"NSApplicationWillFinishLaunchingNotification"; + @"NSApplicationWillFinishLaunchingNotification"; const NSNotificationName NSApplicationDidFinishLaunchingNotification = - @"NSApplicationDidFinishLaunchingNotification"; + @"NSApplicationDidFinishLaunchingNotification"; const NSNotificationName NSApplicationWillBecomeActiveNotification = - @"NSApplicationWillBecomeActiveNotification"; + @"NSApplicationWillBecomeActiveNotification"; const NSNotificationName NSApplicationDidBecomeActiveNotification = - @"NSApplicationDidBecomeActiveNotification"; + @"NSApplicationDidBecomeActiveNotification"; const NSNotificationName NSApplicationWillResignActiveNotification = - @"NSApplicationWillResignActiveNotification"; + @"NSApplicationWillResignActiveNotification"; const NSNotificationName NSApplicationDidResignActiveNotification = - @"NSApplicationDidResignActiveNotification"; + @"NSApplicationDidResignActiveNotification"; const NSNotificationName NSApplicationWillUpdateNotification = - @"NSApplicationWillUpdateNotification"; + @"NSApplicationWillUpdateNotification"; const NSNotificationName NSApplicationDidUpdateNotification = - @"NSApplicationDidUpdateNotification"; + @"NSApplicationDidUpdateNotification"; const NSNotificationName NSApplicationWillHideNotification = - @"NSApplicationWillHideNotification"; + @"NSApplicationWillHideNotification"; const NSNotificationName NSApplicationDidHideNotification = - @"NSApplicationDidHideNotification"; + @"NSApplicationDidHideNotification"; const NSNotificationName NSApplicationWillUnhideNotification = - @"NSApplicationWillUnhideNotification"; + @"NSApplicationWillUnhideNotification"; const NSNotificationName NSApplicationDidUnhideNotification = - @"NSApplicationDidUnhideNotification"; + @"NSApplicationDidUnhideNotification"; const NSNotificationName NSApplicationWillTerminateNotification = - @"NSApplicationWillTerminateNotification"; + @"NSApplicationWillTerminateNotification"; const NSNotificationName NSApplicationDidChangeScreenParametersNotification = - @"NSApplicationDidChangeScreenParametersNotification"; + @"NSApplicationDidChangeScreenParametersNotification"; const NSAppKitVersion NSAppKitVersionNumber = 1504; // macOS 10.12 @@ -119,10 +119,10 @@ NSApplication *NSApp = nil; NSSize imageSize = [image size]; NSRect rect = NSMakeRect(0, 0, imageSize.width, imageSize.height); NSWindow *splash = - [[NSWindow alloc] initWithContentRect: rect - styleMask: NSBorderlessWindowMask - backing: NSBackingStoreBuffered - defer: NO]; + [[NSWindow alloc] initWithContentRect: rect + styleMask: NSBorderlessWindowMask + backing: NSBackingStoreBuffered + defer: NO]; [splash setLevel: NSFloatingWindowLevel]; NSImageView *view = [[NSImageView alloc] initWithFrame: rect]; @@ -142,7 +142,7 @@ NSApplication *NSApp = nil; if ([contentView isKindOfClass: [NSImageView class]]) if ([[[(NSImageView *) contentView image] name] - isEqual: @"splash"]) { + isEqual: @"splash"]) { [window close]; return; } @@ -309,66 +309,66 @@ NSApplication *NSApp = nil; } - (void) unregisterDelegate { - if ([_delegate - respondsToSelector: @selector(applicationWillFinishLaunching:)]) { + if ([_delegate respondsToSelector: @selector + (applicationWillFinishLaunching:)]) { [[NSNotificationCenter defaultCenter] - removeObserver: _delegate - name: NSApplicationWillFinishLaunchingNotification - object: self]; + removeObserver: _delegate + name: NSApplicationWillFinishLaunchingNotification + object: self]; + } + if ([_delegate respondsToSelector: @selector + (applicationDidFinishLaunching:)]) { + [[NSNotificationCenter defaultCenter] + removeObserver: _delegate + name: NSApplicationDidFinishLaunchingNotification + object: self]; } if ([_delegate - respondsToSelector: @selector(applicationDidFinishLaunching:)]) { + respondsToSelector: @selector(applicationDidBecomeActive:)]) { [[NSNotificationCenter defaultCenter] - removeObserver: _delegate - name: NSApplicationDidFinishLaunchingNotification - object: self]; - } - if ([_delegate - respondsToSelector: @selector(applicationDidBecomeActive:)]) { - [[NSNotificationCenter defaultCenter] - removeObserver: _delegate - name: NSApplicationDidBecomeActiveNotification - object: self]; + removeObserver: _delegate + name: NSApplicationDidBecomeActiveNotification + object: self]; } if ([_delegate respondsToSelector: @selector(applicationWillTerminate:)]) { [[NSNotificationCenter defaultCenter] - removeObserver: _delegate - name: NSApplicationWillTerminateNotification - object: self]; + removeObserver: _delegate + name: NSApplicationWillTerminateNotification + object: self]; } } - (void) registerDelegate { - if ([_delegate - respondsToSelector: @selector(applicationWillFinishLaunching:)]) { + if ([_delegate respondsToSelector: @selector + (applicationWillFinishLaunching:)]) { [[NSNotificationCenter defaultCenter] - addObserver: _delegate - selector: @selector(applicationWillFinishLaunching:) - name: NSApplicationWillFinishLaunchingNotification - object: self]; + addObserver: _delegate + selector: @selector(applicationWillFinishLaunching:) + name: NSApplicationWillFinishLaunchingNotification + object: self]; + } + if ([_delegate respondsToSelector: @selector + (applicationDidFinishLaunching:)]) { + [[NSNotificationCenter defaultCenter] + addObserver: _delegate + selector: @selector(applicationDidFinishLaunching:) + name: NSApplicationDidFinishLaunchingNotification + object: self]; } if ([_delegate - respondsToSelector: @selector(applicationDidFinishLaunching:)]) { + respondsToSelector: @selector(applicationDidBecomeActive:)]) { [[NSNotificationCenter defaultCenter] - addObserver: _delegate - selector: @selector(applicationDidFinishLaunching:) - name: NSApplicationDidFinishLaunchingNotification - object: self]; - } - if ([_delegate - respondsToSelector: @selector(applicationDidBecomeActive:)]) { - [[NSNotificationCenter defaultCenter] - addObserver: _delegate - selector: @selector(applicationDidBecomeActive:) - name: NSApplicationDidBecomeActiveNotification - object: self]; + addObserver: _delegate + selector: @selector(applicationDidBecomeActive:) + name: NSApplicationDidBecomeActiveNotification + object: self]; } if ([_delegate respondsToSelector: @selector(applicationWillTerminate:)]) { [[NSNotificationCenter defaultCenter] - addObserver: _delegate - selector: @selector(applicationWillTerminate:) - name: NSApplicationWillTerminateNotification - object: self]; + addObserver: _delegate + selector: @selector(applicationWillTerminate:) + name: NSApplicationWillTerminateNotification + object: self]; } } @@ -428,14 +428,14 @@ NSApplication *NSApp = nil; NSMenuItem *item; if ([[self windowsMenu] - indexOfItemWithTarget: window - andAction: @selector(makeKeyAndOrderFront:)] != -1) + indexOfItemWithTarget: window + andAction: @selector(makeKeyAndOrderFront:)] != -1) return; if (isFilename) title = [NSString - stringWithFormat: @"%@ -- %@", [title lastPathComponent], - [title stringByDeletingLastPathComponent]]; + stringWithFormat: @"%@ -- %@", [title lastPathComponent], + [title stringByDeletingLastPathComponent]]; item = [[[NSMenuItem alloc] initWithTitle: title action: @selector(makeKeyAndOrderFront:) @@ -455,17 +455,17 @@ NSApplication *NSApp = nil; [self removeWindowsItem: window]; } else { int itemIndex = [[self windowsMenu] - indexOfItemWithTarget: window - andAction: @selector(makeKeyAndOrderFront:)]; + indexOfItemWithTarget: window + andAction: @selector(makeKeyAndOrderFront:)]; if (itemIndex != -1) { NSMenuItem *item = [[self windowsMenu] itemAtIndex: itemIndex]; if (isFilename) title = [NSString - stringWithFormat: @"%@ -- %@", [title lastPathComponent], - [title - stringByDeletingLastPathComponent]]; + stringWithFormat: + @"%@ -- %@", [title lastPathComponent], + [title stringByDeletingLastPathComponent]]; [item setTitle: title]; [[self windowsMenu] itemChanged: item]; @@ -476,15 +476,15 @@ NSApplication *NSApp = nil; - (void) removeWindowsItem: (NSWindow *) window { int itemIndex = [[self windowsMenu] - indexOfItemWithTarget: window - andAction: @selector(makeKeyAndOrderFront:)]; + indexOfItemWithTarget: window + andAction: @selector(makeKeyAndOrderFront:)]; if (itemIndex != -1) { [[self windowsMenu] removeItemAtIndex: itemIndex]; if ([[[[self windowsMenu] itemArray] lastObject] isSeparatorItem]) { [[self windowsMenu] - removeItem: [[[self windowsMenu] itemArray] lastObject]]; + removeItem: [[[self windowsMenu] itemArray] lastObject]]; } } } @@ -495,8 +495,8 @@ NSApplication *NSApp = nil; #else NSMenu *menu = [self windowsMenu]; int itemIndex = [[self windowsMenu] - indexOfItemWithTarget: window - andAction: @selector(makeKeyAndOrderFront:)]; + indexOfItemWithTarget: window + andAction: @selector(makeKeyAndOrderFront:)]; if (itemIndex != -1) { NSMenuItem *item = [menu itemAtIndex: itemIndex]; @@ -547,14 +547,14 @@ NSApplication *NSApp = nil; BOOL needsUntitled = YES; NS_DURING [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationWillFinishLaunchingNotification - object: self]; + postNotificationName: NSApplicationWillFinishLaunchingNotification + object: self]; NS_HANDLER [self reportException: localException]; NS_ENDHANDLER // Load the application icon if we have one NSString *iconName = [[[NSBundle mainBundle] infoDictionary] - objectForKey: @"CFBundleIconFile"]; + objectForKey: @"CFBundleIconFile"]; if (iconName) { iconName = [iconName stringByAppendingPathExtension: @"icns"]; NSImage *image = [NSImage imageNamed: iconName]; @@ -572,7 +572,7 @@ NSApplication *NSApp = nil; NSDocumentController *controller = nil; id types = [[[NSBundle mainBundle] infoDictionary] - objectForKey: @"CFBundleDocumentTypes"]; + objectForKey: @"CFBundleDocumentTypes"]; if ([types count] > 0) controller = [NSDocumentController sharedDocumentController]; @@ -588,7 +588,7 @@ NSApplication *NSApp = nil; if (needsUntitled && _delegate && [_delegate - respondsToSelector: @selector(applicationOpenUntitledFile:)]) { + respondsToSelector: @selector(applicationOpenUntitledFile:)]) { needsUntitled = ![_delegate applicationOpenUntitledFile: self]; } @@ -603,12 +603,12 @@ NSApplication *NSApp = nil; } NS_DURING [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationDidFinishLaunchingNotification - object: self]; + postNotificationName: NSApplicationDidFinishLaunchingNotification + object: self]; NS_HANDLER [self reportException: localException]; NS_ENDHANDLER - [pool release]; + [pool release]; } - (void) _checkForReleasedWindows { @@ -685,7 +685,7 @@ NSApplication *NSApp = nil; NS_HANDLER [self reportException: localException]; NS_ENDHANDLER - [self _checkForReleasedWindows]; + [self _checkForReleasedWindows]; [self _checkForTerminate]; [pool release]; @@ -736,14 +736,14 @@ NSApplication *NSApp = nil; NSAutoreleasePool *pool = [NSAutoreleasePool new]; NS_DURING [NSClassFromString(@"Win32RunningCopyPipe") - performSelector: @selector(createRunningCopyPipe)]; + performSelector: @selector(createRunningCopyPipe)]; // This should happen before _makeSureIsOnAScreen so we don't reposition // done windows [self _checkForReleasedWindows]; [[NSApp windows] - makeObjectsPerformSelector: @selector(_makeSureIsOnAScreen)]; + makeObjectsPerformSelector: @selector(_makeSureIsOnAScreen)]; [self _checkForAppActivation]; [self _displayAllWindowsIfNeeded]; @@ -761,7 +761,7 @@ NSApplication *NSApp = nil; NS_HANDLER [self reportException: localException]; NS_ENDHANDLER - [pool release]; + [pool release]; } while (nextEvent == nil && [untilDate timeIntervalSinceNow] > 0); if (nextEvent != nil) { @@ -864,7 +864,7 @@ NSApplication *NSApp = nil; } NSDocumentController *documentController = - [NSDocumentController sharedDocumentController]; + [NSDocumentController sharedDocumentController]; if ([[documentController currentDocument] respondsToSelector: action]) return [documentController currentDocument]; @@ -999,10 +999,10 @@ NSApplication *NSApp = nil; - (void) endModalSession: (NSModalSession) session { if (session != [_modalStack lastObject]) [NSException - raise: NSInvalidArgumentException - format: @"-[%@ %s] modal session %@ is not the current one %@", - [self class], sel_getName(_cmd), session, - [_modalStack lastObject]]; + raise: NSInvalidArgumentException + format: @"-[%@ %s] modal session %@ is not the current one %@", + [self class], sel_getName(_cmd), session, + [_modalStack lastObject]]; for (NSEvent *requeue in [session unprocessedEvents]) { [self postEvent: requeue atStart: YES]; @@ -1036,13 +1036,13 @@ NSApplication *NSApp = nil; NSMutableDictionary *values = [NSMutableDictionary dictionary]; values[@"NSWindow"] = window; - [self - performSelectorOnMainThread: @selector(_mainThreadRunModalForWindow:) - withObject: values - waitUntilDone: YES - modes: @[ - NSDefaultRunLoopMode, NSModalPanelRunLoopMode - ]]; + [self performSelectorOnMainThread: @selector(_mainThreadRunModalForWindow:) + withObject: values + waitUntilDone: YES + modes: @[ + NSDefaultRunLoopMode, + NSModalPanelRunLoopMode + ]]; NSNumber *result = values[@"result"]; @@ -1064,25 +1064,25 @@ NSApplication *NSApp = nil; } - (void) beginSheet: (NSWindow *) sheet - modalForWindow: (NSWindow *) window - modalDelegate: (id) modalDelegate - didEndSelector: (SEL) didEndSelector - contextInfo: (void *) contextInfo + modalForWindow: (NSWindow *) window + modalDelegate: (id) modalDelegate + didEndSelector: (SEL) didEndSelector + contextInfo: (void *) contextInfo { NSSheetContext *context = - [NSSheetContext sheetContextWithSheet: sheet - modalDelegate: modalDelegate - didEndSelector: didEndSelector - contextInfo: contextInfo - frame: [sheet frame]]; + [NSSheetContext sheetContextWithSheet: sheet + modalDelegate: modalDelegate + didEndSelector: didEndSelector + contextInfo: contextInfo + frame: [sheet frame]]; if ([[NSUserDefaults standardUserDefaults] - boolForKey: @"NSRunAllSheetsAsModalPanel"]) { + boolForKey: @"NSRunAllSheetsAsModalPanel"]) { // Center the sheet on the window. NSPoint windowCenter = - NSMakePoint(NSMidX([window frame]), NSMidY([window frame])); + NSMakePoint(NSMidX([window frame]), NSMidY([window frame])); NSPoint sheetCenter = - NSMakePoint(NSMidX([sheet frame]), NSMidY([sheet frame])); + NSMakePoint(NSMidX([sheet frame]), NSMidY([sheet frame])); NSPoint origin = [sheet frame].origin; origin.x += windowCenter.x - sheetCenter.x; origin.y += windowCenter.y - sheetCenter.y; @@ -1104,13 +1104,13 @@ NSApplication *NSApp = nil; - (void) endSheet: (NSWindow *) sheet returnCode: (NSModalResponse) returnCode { if ([[NSUserDefaults standardUserDefaults] - boolForKey: @"NSRunAllSheetsAsModalPanel"]) { + boolForKey: @"NSRunAllSheetsAsModalPanel"]) { NSSheetContext *context = [sheet _sheetContext]; NSModalSession session = [context modalSession]; [session stopModalWithCode: NSRunStoppedResponse]; IMP function = [[context modalDelegate] - methodForSelector: [context didEndSelector]]; + methodForSelector: [context didEndSelector]]; if (function != NULL) { function([context modalDelegate], [context didEndSelector], sheet, returnCode, [context contextInfo]); @@ -1130,7 +1130,7 @@ NSApplication *NSApp = nil; [check _detachSheetContextAnimateAndOrderOut]; function = [[context modalDelegate] - methodForSelector: [context didEndSelector]]; + methodForSelector: [context didEndSelector]]; if (function != NULL) function([context modalDelegate], [context didEndSelector], sheet, returnCode, [context contextInfo]); @@ -1156,11 +1156,11 @@ NSApplication *NSApp = nil; - (int) requestUserAttention: (NSRequestUserAttentionType) attentionType { [_attentionTimer invalidate]; _attentionTimer = - [NSTimer scheduledTimerWithTimeInterval: 3 - target: self - selector: @selector(_attentionTimer:) - userInfo: nil - repeats: YES]; + [NSTimer scheduledTimerWithTimeInterval: 3 + target: self + selector: @selector(_attentionTimer:) + userInfo: nil + repeats: YES]; return 0; } @@ -1187,15 +1187,15 @@ NSApplication *NSApp = nil; return; } [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationWillHideNotification - object: self]; + postNotificationName: NSApplicationWillHideNotification + object: self]; // Do no use orderOut here ist causes the application to quit if no window // is visible. [_windows - makeObjectsPerformSelector: @selector(_forcedHideForDeactivation)]; + makeObjectsPerformSelector: @selector(_forcedHideForDeactivation)]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationDidHideNotification - object: self]; + postNotificationName: NSApplicationDidHideNotification + object: self]; _isHidden = YES; } @@ -1207,13 +1207,13 @@ NSApplication *NSApp = nil; if (_isHidden) { [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationWillUnhideNotification - object: self]; + postNotificationName: NSApplicationWillUnhideNotification + object: self]; [_windows makeObjectsPerformSelector: @selector (_showForActivation)]; // only shows previously hidden windows [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationDidUnhideNotification - object: self]; + postNotificationName: NSApplicationDidUnhideNotification + object: self]; } _isHidden = NO; //[self activateIgnoringOtherApps:NO] @@ -1227,13 +1227,13 @@ NSApplication *NSApp = nil; if (_isHidden) { [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationWillUnhideNotification - object: self]; + postNotificationName: NSApplicationWillUnhideNotification + object: self]; [_windows makeObjectsPerformSelector: @selector (_showForActivation)]; // only shows previously hidden windows [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationDidUnhideNotification - object: self]; + postNotificationName: NSApplicationDidUnhideNotification + object: self]; } _isHidden = NO; } @@ -1249,10 +1249,10 @@ NSApplication *NSApp = nil; - (void) terminate: sender { [[NSDocumentController sharedDocumentController] - closeAllDocumentsWithDelegate: self - didCloseAllSelector: @selector - (_documentController:didCloseAll:contextInfo:) - contextInfo: NULL]; + closeAllDocumentsWithDelegate: self + didCloseAllSelector: @selector + (_documentController:didCloseAll:contextInfo:) + contextInfo: NULL]; } - (void) _documentController: (NSDocumentController *) docController @@ -1262,10 +1262,10 @@ NSApplication *NSApp = nil; // callback method for terminate: if (didCloseAll) { if ([_delegate - respondsToSelector: @selector(applicationShouldTerminate:)]) + respondsToSelector: @selector(applicationShouldTerminate:)]) [self replyToApplicationShouldTerminate: - [_delegate applicationShouldTerminate: self] == - NSTerminateNow]; + [_delegate applicationShouldTerminate: self] == + NSTerminateNow]; else [self replyToApplicationShouldTerminate: YES]; } @@ -1274,11 +1274,11 @@ NSApplication *NSApp = nil; - (void) replyToApplicationShouldTerminate: (BOOL) terminate { if (terminate == YES) { [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationWillTerminateNotification - object: self]; + postNotificationName: NSApplicationWillTerminateNotification + object: self]; [NSClassFromString(@"Win32RunningCopyPipe") - performSelector: @selector(invalidateRunningCopyPipe)]; + performSelector: @selector(invalidateRunningCopyPipe)]; exit(0); } @@ -1366,7 +1366,7 @@ NSApplication *NSApp = nil; - (void) orderFrontStandardAboutPanelWithOptions: (NSDictionary *) options { NSSystemInfoPanel *standardAboutPanel = - [[NSSystemInfoPanel standardAboutPanel] retain]; + [[NSSystemInfoPanel standardAboutPanel] retain]; [standardAboutPanel showInfoPanel: self withOptions: options]; } @@ -1376,16 +1376,17 @@ NSApplication *NSApp = nil; - (void) showGuessPanel: sender { [[[NSSpellChecker sharedSpellChecker] spellingPanel] - makeKeyAndOrderFront: self]; + makeKeyAndOrderFront: self]; } - (void) showHelp: sender { NSString *helpBookFolder = [[[NSBundle mainBundle] infoDictionary] - objectForKey: @"CFBundleHelpBookFolder"]; + objectForKey: @"CFBundleHelpBookFolder"]; if (helpBookFolder != nil) { BOOL isDir; NSString *folder = - [[NSBundle mainBundle] pathForResource: helpBookFolder ofType: nil]; + [[NSBundle mainBundle] pathForResource: helpBookFolder + ofType: nil]; if (folder != nil && [[NSFileManager defaultManager] fileExistsAtPath: folder isDirectory: &isDir] && @@ -1393,14 +1394,15 @@ NSApplication *NSApp = nil; NSBundle *helpBundle = [NSBundle bundleWithPath: folder]; if (helpBundle) { NSString *helpBookName = [[helpBundle infoDictionary] - objectForKey: @"CFBundleHelpTOCFile"]; + objectForKey: @"CFBundleHelpTOCFile"]; if (helpBookName != nil) { NSString *helpFilePath = - [helpBundle pathForResource: helpBookName ofType: nil]; + [helpBundle pathForResource: helpBookName + ofType: nil]; if (helpFilePath) { if ([[NSWorkspace sharedWorkspace] - openFile: helpFilePath - withApplication: @"Help Viewer"] == YES) { + openFile: helpFilePath + withApplication: @"Help Viewer"] == YES) { return; } } @@ -1410,8 +1412,8 @@ NSApplication *NSApp = nil; ofType: @"html"]; if (helpFilePath) { if ([[NSWorkspace sharedWorkspace] - openFile: helpFilePath - withApplication: @"Help Viewer"] == YES) { + openFile: helpFilePath + withApplication: @"Help Viewer"] == YES) { return; } } @@ -1422,18 +1424,20 @@ NSApplication *NSApp = nil; NSString *processName = [[NSProcessInfo processInfo] processName]; NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText: NSLocalizedStringFromTableInBundle( - @"Help", nil, - [NSBundle bundleForClass: [NSApplication class]], - @"Help alert title")]; - [alert - setInformativeText: - [NSString - stringWithFormat: NSLocalizedStringFromTableInBundle( - @"Help isn't available for %@.", nil, - [NSBundle bundleForClass: [NSApplication - class]], - @""), - processName]]; + @"Help", nil, + [NSBundle bundleForClass: [NSApplication + class]], + @"Help alert title")]; + [alert setInformativeText: + [NSString stringWithFormat: + NSLocalizedStringFromTableInBundle( + @"Help isn't available for %@.", + nil, + [NSBundle bundleForClass: + [NSApplication + class]], + @""), + processName]]; [alert runModal]; [alert release]; } @@ -1459,24 +1463,24 @@ NSApplication *NSApp = nil; if (![self isActive]) { [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationWillBecomeActiveNotification - object: self]; + postNotificationName: NSApplicationWillBecomeActiveNotification + object: self]; } } - (void) _windowDidBecomeActive: (NSWindow *) window { if (![self isActiveExcludingWindow: window]) { [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationDidBecomeActiveNotification - object: self]; + postNotificationName: NSApplicationDidBecomeActiveNotification + object: self]; } } - (void) _windowWillBecomeDeactive: (NSWindow *) window { if (![self isActiveExcludingWindow: window]) { [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationWillResignActiveNotification - object: self]; + postNotificationName: NSApplicationWillResignActiveNotification + object: self]; } } @@ -1491,20 +1495,20 @@ NSApplication *NSApp = nil; // received to let them proceed. This special event type was added to // help them get unstuck and remove the menu on deactivation NSEvent *appKitEvent = - [NSEvent otherEventWithType: NSAppKitDefined - location: NSZeroPoint - modifierFlags: 0 - timestamp: 0 - windowNumber: 0 - context: nil - subtype: NSApplicationDeactivated - data1: 0 - data2: 0]; + [NSEvent otherEventWithType: NSAppKitDefined + location: NSZeroPoint + modifierFlags: 0 + timestamp: 0 + windowNumber: 0 + context: nil + subtype: NSApplicationDeactivated + data1: 0 + data2: 0]; [self postEvent: appKitEvent atStart: YES]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSApplicationDidResignActiveNotification - object: self]; + postNotificationName: NSApplicationDidResignActiveNotification + object: self]; } } @@ -1536,24 +1540,25 @@ int NSApplicationMain(int argc, const char *argv[]) { #ifndef DARLING if (argc > 1) { NSMutableArray *arguments = - [NSMutableArray arrayWithCapacity: arg c - 1]; + [NSMutableArray arrayWithCapacity: arg c - 1]; for (int i = 1; i < argc; i++) if (argv[i][0] != '-') [arguments addObject: [NSString stringWithUTF8String: argv[i]]]; else if (argv[i][1] == '-' && argv[i][2] == '\0') break; else // (argv[i][0] == '-' && argv[i] != "--") - if (*(int64_t *) argv[i] != *(int64_t *) "-NSOpen") + if (*(int64_t *) argv[i] != *(int64_t *) "-NSOpen") i++; if ((argc = [arguments count])) [[NSUserDefaults standardUserDefaults] - setObject: ((argc == 1) ? [arguments lastObject] : arguments) - forKey: @"NSOpen"]; + setObject: ((argc == 1) ? [arguments lastObject] + : arguments) + forKey: @"NSOpen"]; } [NSClassFromString(@"Win32RunningCopyPipe") - performSelector: @selector(startRunningCopyPipe)]; + performSelector: @selector(startRunningCopyPipe)]; #endif if (class == Nil) diff --git a/AppKit/NSAttributedString.m b/AppKit/NSAttributedString.m index 76d6517d..c6deb4d8 100644 --- a/AppKit/NSAttributedString.m +++ b/AppKit/NSAttributedString.m @@ -29,27 +29,27 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSString *const NSFontAttributeName = @"NSFontAttributeName"; NSString *const NSParagraphStyleAttributeName = - @"NSParagraphStyleAttributeName"; + @"NSParagraphStyleAttributeName"; NSString *const NSForegroundColorAttributeName = - @"NSForegroundColorAttributeName"; + @"NSForegroundColorAttributeName"; NSString *const NSBackgroundColorAttributeName = - @"NSBackgroundColorAttributeName"; + @"NSBackgroundColorAttributeName"; NSString *const NSUnderlineStyleAttributeName = - @"NSUnderlineStyleAttributeName"; + @"NSUnderlineStyleAttributeName"; NSString *const NSUnderlineColorAttributeName = - @"NSUnderlineColorAttributeName"; + @"NSUnderlineColorAttributeName"; NSString *const NSAttachmentAttributeName = @"NSAttachmentAttributeName"; NSString *const NSKernAttributeName = @"NSKernAttributeName"; NSString *const NSLigatureAttributeName = @"NSLigatureAttributeName"; NSString *const NSStrikethroughStyleAttributeName = - @"NSStrikethroughStyleAttributeName"; + @"NSStrikethroughStyleAttributeName"; NSString *const NSStrikethroughColorAttributeName = - @"NSStrikethroughColorAttributeName"; + @"NSStrikethroughColorAttributeName"; NSString *const NSObliquenessAttributeName = @"NSObliquenessAttributeName"; NSString *const NSStrokeWidthAttributeName = @"NSStrokeWidthAttributeName"; NSString *const NSStrokeColorAttributeName = @"NSStrokeColorAttributeName"; NSString *const NSBaselineOffsetAttributeName = - @"NSBaselineOffsetAttributeName"; + @"NSBaselineOffsetAttributeName"; NSString *const NSSuperscriptAttributeName = @"NSSuperscriptAttributeName"; NSString *const NSLinkAttributeName = @"NSLinkAttributeName"; NSString *const NSShadowAttributeName = @"NSShadowAttributeName"; @@ -57,7 +57,7 @@ NSString *const NSExpansionAttributeName = @"NSExpansionAttributeName"; NSString *const NSCursorAttributeName = @"NSCursorAttributeName"; NSString *const NSToolTipAttributeName = @"NSToolTipAttributeName"; NSString *const NSSpellingStateAttributeName = - @"NSSpellingStateAttributeName"; // temporary attribute + @"NSSpellingStateAttributeName"; // temporary attribute NSString *const NSDocumentTypeDocumentAttribute = @"DocumentType"; NSString *const NSConvertedDocumentAttribute = @"Converted"; @@ -71,13 +71,13 @@ NSString *const NSKeywordsDocumentAttribute = @"NSKeywordsDocumentAttribute"; NSString *const NSCommentDocumentAttribute = @"NSCommentDocumentAttribute"; NSString *const NSEditorDocumentAttribute = @"NSEditorDocumentAttribute"; NSString *const NSCreationTimeDocumentAttribute = - @"NSCreationTimeDocumentAttribute"; + @"NSCreationTimeDocumentAttribute"; NSString *const NSModificationTimeDocumentAttribute = - @"NSModificationTimeDocumentAttribute"; + @"NSModificationTimeDocumentAttribute"; NSString *const NSManagerDocumentAttribute = @"NSManagerDocumentAttribute"; NSString *const NSCategoryDocumentAttribute = @"NSCategoryDocumentAttribute"; NSString *const NSAppearanceDocumentAttribute = - @"NSAppearanceDocumentAttribute"; + @"NSAppearanceDocumentAttribute"; NSString *const NSCharacterEncodingDocumentAttribute = @"CharacterEncoding"; NSString *const NSDefaultAttributesDocumentAttribute = @"DefaultAttributes"; NSString *const NSPaperSizeDocumentAttribute = @"PaperSize"; @@ -93,7 +93,7 @@ NSString *const NSBackgroundColorDocumentAttribute = @"BackgroundColor"; NSString *const NSHyphenationFactorDocumentAttribute = @"HyphenationFactor"; NSString *const NSDefaultTabIntervalDocumentAttribute = @"DefaultTabInterval"; NSString *const NSTextLayoutSectionsAttribute = - @"NSTextLayoutSectionsAttribute"; + @"NSTextLayoutSectionsAttribute"; NSString *const NSExcludedElementsDocumentAttribute = @"ExcludedElements"; NSString *const NSTextEncodingNameDocumentAttribute = @"TextEncodingName"; NSString *const NSPrefixSpacesDocumentAttribute = @"PrefixSpaces"; @@ -106,7 +106,7 @@ NSString *const NSBaseURLDocumentOption = @"BaseURL"; NSString *const NSTimeoutDocumentOption = @"Timeout"; NSString *const NSWebPreferencesDocumentOption = @"WebPreferences"; NSString *const NSWebResourceLoadDelegateDocumentOption = - @"WebResourceLoadDelegate"; + @"WebResourceLoadDelegate"; NSString *const NSTextSizeMultiplierDocumentOption = @"TextSizeMultiplier"; NSString *const NSFileTypeDocumentOption = @"UTI"; @@ -122,7 +122,7 @@ NSString *const NSOfficeOpenXMLTextDocumentType = @"NSOfficeOpenXML"; NSString *const NSOpenDocumentTextDocumentType = @"NSOpenDocument"; NSString *const NSTextLayoutSectionOrientation = - @"NSTextLayoutSectionOrientation"; + @"NSTextLayoutSectionOrientation"; NSString *const NSTextLayoutSectionRange = @"NSTextLayoutSectionRange"; NSString *const NSCharacterShapeAttributeName = @"NSCharacterShape"; @@ -139,62 +139,62 @@ NSUInteger NSUnderlineByWordMask = 0x8000; #pragma mark Creating an NSAttributedString + (NSAttributedString *) attributedStringWithAttachment: - (NSTextAttachment *) attachment + (NSTextAttachment *) attachment { unichar unicode = NSAttachmentCharacter; NSString *string = [NSString stringWithCharacters: &unicode length: 1]; NSDictionary *attributes = - [NSDictionary dictionaryWithObject: attachment - forKey: NSAttachmentAttributeName]; + [NSDictionary dictionaryWithObject: attachment + forKey: NSAttachmentAttributeName]; return [[[self alloc] initWithString: string attributes: attributes] autorelease]; } - initWithData: (NSData *) data - options: (NSDictionary *) options - documentAttributes: (NSDictionary **) attributes - error: (NSError **) error + options: (NSDictionary *) options + documentAttributes: (NSDictionary **) attributes + error: (NSError **) error { NSUnimplementedMethod(); return nil; } - initWithDocFormat: (NSData *) werd - documentAttributes: (NSDictionary **) attributes + documentAttributes: (NSDictionary **) attributes { NSUnimplementedMethod(); return nil; } - initWithHTML: (NSData *) html - baseURL: (NSURL *) url - documentAttributes: (NSDictionary **) attributes + baseURL: (NSURL *) url + documentAttributes: (NSDictionary **) attributes { NSUnimplementedMethod(); return nil; } - initWithHTML: (NSData *) html - documentAttributes: (NSDictionary **) attributes + documentAttributes: (NSDictionary **) attributes { NSUnimplementedMethod(); return nil; } - initWithHTML: (NSData *) html - options: (NSDictionary *) options - documentAttributes: (NSDictionary **) attributes + options: (NSDictionary *) options + documentAttributes: (NSDictionary **) attributes { NSUnimplementedMethod(); return nil; } - initWithPath: (NSString *) path - documentAttributes: (NSDictionary **) attributes + documentAttributes: (NSDictionary **) attributes { NSAttributedString *string = - [NSRichTextReader attributedStringWithContentsOfFile: path]; + [NSRichTextReader attributedStringWithContentsOfFile: path]; if (string == nil) { [self release]; return nil; @@ -204,7 +204,7 @@ NSUInteger NSUnderlineByWordMask = 0x8000; - initWithRTF: (NSData *) rtf documentAttributes: (NSDictionary **) attributes { NSAttributedString *string = - [NSRichTextReader attributedStringWithData: rtf]; + [NSRichTextReader attributedStringWithData: rtf]; if (string == nil) { [self release]; return nil; @@ -213,14 +213,14 @@ NSUInteger NSUnderlineByWordMask = 0x8000; } - initWithRTFD: (NSData *) rtfd - documentAttributes: (NSDictionary **) attributes + documentAttributes: (NSDictionary **) attributes { NSUnimplementedMethod(); return nil; } - initWithRTFDFileWrapper: (NSFileWrapper *) wrapper - documentAttributes: (NSDictionary **) attributes + documentAttributes: (NSDictionary **) attributes { NSUnimplementedMethod(); return nil; @@ -232,9 +232,9 @@ NSUInteger NSUnderlineByWordMask = 0x8000; } - initWithURL: (NSURL *) url - options: (NSDictionary *) options - documentAttributes: (NSDictionary **) attributes - error: (NSError **) error + options: (NSDictionary *) options + documentAttributes: (NSDictionary **) attributes + error: (NSError **) error { NSUnimplementedMethod(); return nil; @@ -285,16 +285,14 @@ NSUInteger NSUnderlineByWordMask = 0x8000; if (expand) { for (; result.location != 0; result.location--, result.length++) { - if (![set characterIsMember: [string - characterAtIndex: result.location - - 1]]) + if (![set characterIsMember: + [string characterAtIndex: result.location - 1]]) break; } for (; NSMaxRange(result) < length; result.length++) { - if (![set - characterIsMember: [string characterAtIndex: NSMaxRange( - result)]]) + if (![set characterIsMember: + [string characterAtIndex: NSMaxRange(result)]]) break; } } else if (location < length) @@ -440,7 +438,7 @@ NSUInteger NSUnderlineByWordMask = 0x8000; } - (NSData *) RTFFromRange: (NSRange) range - documentAttributes: (NSDictionary *) attributes + documentAttributes: (NSDictionary *) attributes { return [NSRichTextWriter dataWithAttributedString: self range: range]; } @@ -565,7 +563,7 @@ NSParagraphStyle * NSParagraphStyleAttributeInDictionary(NSDictionary *dictionary) { NSParagraphStyle *style = - [dictionary objectForKey: NSParagraphStyleAttributeName]; + [dictionary objectForKey: NSParagraphStyleAttributeName]; if (style == nil) style = [NSParagraphStyle defaultParagraphStyle]; diff --git a/AppKit/NSBezierPath.m b/AppKit/NSBezierPath.m index f72e4f8a..17bdf3ad 100644 --- a/AppKit/NSBezierPath.m +++ b/AppKit/NSBezierPath.m @@ -72,8 +72,8 @@ static void CGPathConverter(void *info, const CGPathElement *element) { case kCGPathElementAddCurveToPoint: [bezier curveToPoint: *(CGPoint *) &element->points[2] - controlPoint1: *(CGPoint *) &element->points[0] - controlPoint2: *(CGPoint *) &element->points[1]]; + controlPoint1: *(CGPoint *) &element->points[0] + controlPoint2: *(CGPoint *) &element->points[1]]; break; case kCGPathElementCloseSubpath: @@ -515,27 +515,27 @@ static int numberOfPointsForOperator(int op) { || ((fromPoint.y > point.y) && (toPoint.y <= point.y))) { // a downward crossing // compute the actual edge-ray intersect x-coordinate - CGFloat vt = - (CGFloat)(point.y - fromPoint.y) / (toPoint.y - fromPoint.y); + CGFloat vt = (CGFloat)(point.y - fromPoint.y) / + (toPoint.y - fromPoint.y); if (point.x < fromPoint.x + - vt * (toPoint.x - fromPoint.x)) // point.x < intersect + vt * (toPoint.x - fromPoint.x)) // point.x < intersect ++count; // a valid crossing of y=point.y right of point.x } } else { // Subdivide the bezier path and test both subpaths - adapted from the // flatten path code CGPoint sub1_start = fromPoint; - CGPoint sub1_cp1 = - CGPointMake((fromPoint.x + tan1.x) / 2, (fromPoint.y + tan1.y) / 2); + CGPoint sub1_cp1 = CGPointMake((fromPoint.x + tan1.x) / 2, + (fromPoint.y + tan1.y) / 2); CGPoint T = CGPointMake((tan1.x + tan2.x) / 2, (tan1.y + tan2.y) / 2); CGPoint sub1_cp2 = - CGPointMake((sub1_cp1.x + T.x) / 2, (sub1_cp1.y + T.y) / 2); + CGPointMake((sub1_cp1.x + T.x) / 2, (sub1_cp1.y + T.y) / 2); CGPoint sub2_end = toPoint; CGPoint sub2_cp2 = - CGPointMake((tan2.x + toPoint.x) / 2, (tan2.y + toPoint.y) / 2); + CGPointMake((tan2.x + toPoint.x) / 2, (tan2.y + toPoint.y) / 2); CGPoint sub2_cp1 = - CGPointMake((T.x + sub2_cp2.x) / 2, (T.y + sub2_cp2.y) / 2); + CGPointMake((T.x + sub2_cp2.x) / 2, (T.y + sub2_cp2.y) / 2); CGPoint sub2_start = CGPointMake((sub1_cp2.x + sub2_cp1.x) / 2, (sub1_cp2.y + sub2_cp1.y) / 2); CGPoint sub1_end = sub2_start; @@ -592,9 +592,10 @@ static int numberOfPointsForOperator(int op) { // compute the actual edge-ray intersect x-coordinate CGFloat vt = (CGFloat)(point.y - currentPoint.y) / (toPoint.y - currentPoint.y); - if (point.x < currentPoint.x + - vt * (toPoint.x - - currentPoint.x)) // point.x < intersect + if (point.x < + currentPoint.x + + vt * (toPoint.x - + currentPoint.x)) // point.x < intersect ++cn; // a valid crossing of y=point.y right of point.x } currentPoint = toPoint; @@ -619,9 +620,10 @@ static int numberOfPointsForOperator(int op) { // compute the actual edge-ray intersect x-coordinate CGFloat vt = (CGFloat)(point.y - currentPoint.y) / (toPoint.y - currentPoint.y); - if (point.x < currentPoint.x + - vt * (toPoint.x - - currentPoint.x)) // point.x < intersect + if (point.x < + currentPoint.x + + vt * (toPoint.x - + currentPoint.x)) // point.x < intersect ++cn; // a valid crossing of y=point.y right of point.x } currentPoint = startPoint; @@ -658,7 +660,7 @@ static inline void expandOperatorCapacity(NSBezierPath *self, unsigned delta) { self->_capacityOfElements = self->_numberOfElements + delta; self->_capacityOfElements = (self->_capacityOfElements / 32 + 1) * 32; self->_elements = - NSZoneRealloc(NULL, self->_elements, self->_capacityOfElements); + NSZoneRealloc(NULL, self->_elements, self->_capacityOfElements); } } @@ -667,7 +669,7 @@ static inline void expandPointCapacity(NSBezierPath *self, unsigned delta) { self->_capacityOfPoints = self->_numberOfPoints + delta; self->_capacityOfPoints = (self->_capacityOfPoints / 64 + 1) * 64; self->_points = NSZoneRealloc( - NULL, self->_points, self->_capacityOfPoints * sizeof(CGPoint)); + NULL, self->_points, self->_capacityOfPoints * sizeof(CGPoint)); } } @@ -777,8 +779,8 @@ static void cgApplier(void *info, const CGPathElement *element) { case kCGPathElementAddCurveToPoint: [self curveToPoint: element->points[2] - controlPoint1: element->points[0] - controlPoint2: element->points[1]]; + controlPoint1: element->points[0] + controlPoint2: element->points[1]]; break; case kCGPathElementCloseSubpath: @@ -801,8 +803,8 @@ static void cgArcApply(void *info, const CGPathElement *element) { case kCGPathElementAddCurveToPoint: [self curveToPoint: element->points[2] - controlPoint1: element->points[0] - controlPoint2: element->points[1]]; + controlPoint1: element->points[0] + controlPoint2: element->points[1]]; break; default: @@ -828,8 +830,8 @@ static void cgArcFromApply(void *info, const CGPathElement *element) { case kCGPathElementAddCurveToPoint: [self curveToPoint: element->points[2] - controlPoint1: element->points[0] - controlPoint2: element->points[1]]; + controlPoint1: element->points[0] + controlPoint2: element->points[1]]; break; default: @@ -870,18 +872,21 @@ static void cgArcFromApply(void *info, const CGPathElement *element) { { [self moveToPoint: NSMakePoint(rect.origin.x + radius, NSMaxY(rect))]; [self appendBezierPathWithArcWithCenter: NSMakePoint( - rect.origin.x + - rect.size.width - radius, - rect.origin.y + - rect.size.height - radius) + rect.origin.x + + rect.size.width - + radius, + rect.origin.y + + rect.size.height - + radius) radius: radius startAngle: 90 endAngle: 0.0f clockwise: YES]; - [self appendBezierPathWithArcWithCenter: NSMakePoint(rect.origin.x + + [self appendBezierPathWithArcWithCenter: NSMakePoint( + rect.origin.x + rect.size.width - radius, - rect.origin.y + radius) + rect.origin.y + radius) radius: radius startAngle: 360.0f endAngle: 270 @@ -892,8 +897,9 @@ static void cgArcFromApply(void *info, const CGPathElement *element) { startAngle: 270 endAngle: 180 clockwise: YES]; - [self appendBezierPathWithArcWithCenter: NSMakePoint(rect.origin.x + radius, - rect.origin.y + + [self appendBezierPathWithArcWithCenter: NSMakePoint( + rect.origin.x + radius, + rect.origin.y + rect.size.height - radius) radius: radius @@ -938,14 +944,14 @@ static inline CGFloat degreesToRadians(CGFloat degrees) { NSString *fontName = [font fontName]; CGFontRef cgFont = CGFontCreateWithFontName((CFStringRef) fontName); if (cgFont) { - CTFontRef fontRef = - CTFontCreateWithGraphicsFont(cgFont, [font pointSize], NULL, NULL); + CTFontRef fontRef = CTFontCreateWithGraphicsFont( + cgFont, [font pointSize], NULL, NULL); if (fontRef) { CGPathRef glyphPath = - CTFontCreatePathForGlyph(fontRef, glyph, NULL); + CTFontCreatePathForGlyph(fontRef, glyph, NULL); if (glyphPath) { NSBezierPath *path = - [NSBezierPath bezierPathWithCGPath: glyphPath]; + [NSBezierPath bezierPathWithCGPath: glyphPath]; // Translate the path to the current point CGPoint currentPoint = [self currentPoint]; @@ -1052,16 +1058,16 @@ static NSUInteger doFlattenBezierCurve(CGFloat desiredFlatness, CGPoint start, // Subdivide the curve - Hearn & Baker Computer Graphics pp460-461 CGPoint sub1_start = start; CGPoint sub1_cp1 = - CGPointMake((start.x + cp1.x) / 2, (start.y + cp1.y) / 2); + CGPointMake((start.x + cp1.x) / 2, (start.y + cp1.y) / 2); CGPoint T = CGPointMake((cp1.x + cp2.x) / 2, (cp1.y + cp2.y) / 2); CGPoint sub1_cp2 = - CGPointMake((sub1_cp1.x + T.x) / 2, (sub1_cp1.y + T.y) / 2); + CGPointMake((sub1_cp1.x + T.x) / 2, (sub1_cp1.y + T.y) / 2); CGPoint sub2_end = end; CGPoint sub2_cp2 = - CGPointMake((cp2.x + end.x) / 2, (cp2.y + end.y) / 2); + CGPointMake((cp2.x + end.x) / 2, (cp2.y + end.y) / 2); CGPoint sub2_cp1 = - CGPointMake((T.x + sub2_cp2.x) / 2, (T.y + sub2_cp2.y) / 2); + CGPointMake((T.x + sub2_cp2.x) / 2, (T.y + sub2_cp2.y) / 2); CGPoint sub2_start = CGPointMake((sub1_cp2.x + sub2_cp1.x) / 2, (sub1_cp2.y + sub2_cp1.y) / 2); CGPoint sub1_end = sub2_start; @@ -1159,7 +1165,8 @@ static NSUInteger flattenBezierCurve(CGFloat desiredFlatness, CGPoint start, // Find the previous start of a path for (j = i - 1; j >= 0; j--) { NSBezierPathElement type = - [self elementAtIndex: j associatedPoints: prevPoints]; + [self elementAtIndex: j + associatedPoints: prevPoints]; if (type == NSMoveToBezierPathElement) { nextPoint = prevPoints[0]; break; @@ -1215,8 +1222,8 @@ static NSUInteger flattenBezierCurve(CGFloat desiredFlatness, CGPoint start, break; case NSCurveToBezierPathElement: [path curveToPoint: nextPoint - controlPoint1: pts[1] - controlPoint2: pts[0]]; + controlPoint1: pts[1] + controlPoint2: pts[0]]; break; case NSClosePathBezierPathElement: if (i != 0) { diff --git a/AppKit/NSBitmapImageRep.m b/AppKit/NSBitmapImageRep.m index 0365d198..c02cfcc5 100644 --- a/AppKit/NSBitmapImageRep.m +++ b/AppKit/NSBitmapImageRep.m @@ -25,36 +25,36 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSBitmapImageRepPropertyKey NSImageCompressionFactor = - @"NSImageCompressionFactor"; + @"NSImageCompressionFactor"; NSBitmapImageRepPropertyKey NSImageCompressionMethod = - @"NSImageCompressionMethod"; + @"NSImageCompressionMethod"; NSBitmapImageRepPropertyKey NSImageDitherTransparency = - @"NSImageDitherTransparency"; + @"NSImageDitherTransparency"; NSBitmapImageRepPropertyKey NSImageInterlaced = @"NSImageInterlaced"; NSBitmapImageRepPropertyKey NSImageRGBColorTable = @"NSImageRGBColorTable"; NSBitmapImageRepPropertyKey NSImageFrameCount = @"NSImageFrameCount"; NSBitmapImageRepPropertyKey NSImageColorSyncProfileData = - @"NSImageColorSyncProfileData"; + @"NSImageColorSyncProfileData"; NSBitmapImageRepPropertyKey NSImageFallbackBackgroundColor = - @"NSImageFallbackBackgroundColor"; + @"NSImageFallbackBackgroundColor"; NSBitmapImageRepPropertyKey NSImageEXIFData = @"NSImageEXIFData"; NSBitmapImageRepPropertyKey NSImageProgressive = @"NSImageProgressive"; NSBitmapImageRepPropertyKey NSImageGamma = @"NSImageGamma"; NSBitmapImageRepPropertyKey NSImageLoopCount = @"NSImageLoopCount"; NSBitmapImageRepPropertyKey NSImageCurrentFrameDuration = - @"NSImageCurrentFrameDuration"; + @"NSImageCurrentFrameDuration"; NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; @implementation NSBitmapImageRep + (NSArray *) imageUnfilteredFileTypes { - return - [NSArray arrayWithObjects: - // Try to order them so the most used ones are at the top - // of the list - @"png", @"tiff", @"tif", @"jpg", @"jpeg", @"icns", @"gif", - @"bmp", @"PNG", @"TIFF", @"TIF", @"JPG", @"JPEG", @"ICNS", - @"jpe", @"JPE", @"GIF", @"BMP", nil]; + return [NSArray arrayWithObjects: + // Try to order them so the most used ones are at + // the top of the list + @"png", @"tiff", @"tif", @"jpg", @"jpeg", + @"icns", @"gif", @"bmp", @"PNG", @"TIFF", + @"TIF", @"JPG", @"JPEG", @"ICNS", @"jpe", + @"JPE", @"GIF", @"BMP", nil]; } + (NSArray *) imageRepsWithContentsOfFile: (NSString *) path { @@ -88,13 +88,13 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; + (NSData *) TIFFRepresentationOfImageRepsInArray: (NSArray *) array usingCompression: - (NSTIFFCompression) compression + (NSTIFFCompression) compression factor: (float) factor { NSMutableData *result = [NSMutableData data]; CGImageDestinationRef dest = CGImageDestinationCreateWithData( - (CFMutableDataRef) result, (CFStringRef) @"public.tiff", [array count], - NULL); + (CFMutableDataRef) result, (CFStringRef) @"public.tiff", + [array count], NULL); for (NSBitmapImageRep *bitmap in array) { CGImageDestinationAddImage(dest, [bitmap CGImage], NULL); @@ -120,7 +120,7 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; + (BOOL) canInitWithData: (NSData *) data { CGImageSourceRef imageSource = - CGImageSourceCreateWithData((CFDataRef) data, nil); + CGImageSourceCreateWithData((CFDataRef) data, nil); BOOL result = (imageSource != NULL) ? YES : NO; CFRelease(imageSource); return result; @@ -129,7 +129,7 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; + (NSArray *) imageRepsWithData: (NSData *) data { NSMutableArray *result = [NSMutableArray array]; CGImageSourceRef imageSource = - CGImageSourceCreateWithData((CFDataRef) data, nil); + CGImageSourceCreateWithData((CFDataRef) data, nil); if (imageSource == nil) return nil; @@ -138,19 +138,17 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; for (i = 0; i < count; i++) { CGImageRef cgImage = - CGImageSourceCreateImageAtIndex(imageSource, i, nil); + CGImageSourceCreateImageAtIndex(imageSource, i, nil); if (cgImage == nil) break; CFDictionaryRef properties = - CGImageSourceCopyPropertiesAtIndex(imageSource, i, nil); - NSNumber *xres = - [[(id) CFDictionaryGetValue(properties, kCGImagePropertyDPIWidth) - copy] autorelease]; - NSNumber *yres = - [[(id) CFDictionaryGetValue(properties, kCGImagePropertyDPIHeight) - copy] autorelease]; + CGImageSourceCopyPropertiesAtIndex(imageSource, i, nil); + NSNumber *xres = [[(id) CFDictionaryGetValue( + properties, kCGImagePropertyDPIWidth) copy] autorelease]; + NSNumber *yres = [[(id) CFDictionaryGetValue( + properties, kCGImagePropertyDPIHeight) copy] autorelease]; CFRelease(properties); @@ -237,7 +235,7 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; _bitmapPlanes[i] = planes[i]; else _bitmapPlanes[i] = - NSZoneCalloc(NULL, _bytesPerRow * _pixelsHigh, 1); + NSZoneCalloc(NULL, _bytesPerRow * _pixelsHigh, 1); } return self; @@ -287,7 +285,7 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; - initWithData: (NSData *) data { CGImageSourceRef imageSource = - CGImageSourceCreateWithData((CFDataRef) data, nil); + CGImageSourceCreateWithData((CFDataRef) data, nil); if (imageSource == nil) { [self dealloc]; @@ -303,13 +301,13 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; } CFDictionaryRef properties = - CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil); + CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil); NSNumber *xres = - [[(id) CFDictionaryGetValue(properties, kCGImagePropertyDPIWidth) copy] - autorelease]; + [[(id) CFDictionaryGetValue(properties, kCGImagePropertyDPIWidth) + copy] autorelease]; NSNumber *yres = - [[(id) CFDictionaryGetValue(properties, kCGImagePropertyDPIHeight) copy] - autorelease]; + [[(id) CFDictionaryGetValue(properties, kCGImagePropertyDPIHeight) + copy] autorelease]; CFRelease(properties); CFRelease(imageSource); @@ -530,7 +528,7 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; NSUnimplementedMethod(); } unsigned char *bits = - _bitmapPlanes[0] + _bytesPerRow * y + (x * _bitsPerPixel) / 8; + _bitmapPlanes[0] + _bytesPerRow * y + (x * _bitsPerPixel) / 8; int i; @@ -585,7 +583,7 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; if (_bitmapFormat & NSFloatingPointSamplesBitmapFormat) { for (i = 0; i < numberOfComponents; i++) { ((CGFloat *) pixels)[i] = - MAX(0.0f, MIN(1.0f, components[i])); // clamp just in case + MAX(0.0f, MIN(1.0f, components[i])); // clamp just in case } } else { int maxValue = (1 << [self bitsPerSample]) - 1; @@ -593,12 +591,12 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; for (i = 0; i < numberOfComponents; i++) { #ifdef __LITTLE_ENDIAN__ pixels[i] = - MAX(0, MIN(maxValue, - (int) (components[(numberOfComponents - 1) - i] * - maxValue))); // clamp just in case + MAX(0, MIN(maxValue, + (int) (components[(numberOfComponents - 1) - i] * + maxValue))); // clamp just in case #else - pixels[i] = - MAX(0, MIN(maxValue, (int) (components[i] * + pixels[i] = MAX( + 0, MIN(maxValue, (int) (components[i] * maxValue))); // clamp just in case #endif } @@ -689,15 +687,15 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; if ([properties count]) { id compressionFactor = - [properties valueForKey: NSImageCompressionFactor]; + [properties valueForKey: NSImageCompressionFactor]; if (compressionFactor) { [CGProperties - setValue: compressionFactor - forKey: (id) kCGImageDestinationLossyCompressionQuality]; + setValue: compressionFactor + forKey: (id) kCGImageDestinationLossyCompressionQuality]; } } CGImageDestinationRef dest = CGImageDestinationCreateWithData( - (CFMutableDataRef) result, uti, 1, (CFDictionaryRef) CGProperties); + (CFMutableDataRef) result, uti, 1, (CFDictionaryRef) CGProperties); CGImageDestinationAddImage(dest, [self CGImage], (CFDictionaryRef) CGProperties); @@ -717,9 +715,10 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; factor: (float) factor { return [[self class] - TIFFRepresentationOfImageRepsInArray: [NSArray arrayWithObject: self] - usingCompression: compression - factor: factor]; + TIFFRepresentationOfImageRepsInArray: [NSArray + arrayWithObject: self] + usingCompression: compression + factor: factor]; } - (CGImageRef) createCGImageIfNeeded { @@ -730,12 +729,12 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; NSUnimplementedMethod(); CGDataProviderRef provider = CGDataProviderCreateWithData( - NULL, _bitmapPlanes[0], _bytesPerRow * _pixelsHigh, NULL); + NULL, _bitmapPlanes[0], _bytesPerRow * _pixelsHigh, NULL); CGImageRef image = CGImageCreate( - _pixelsWide, _pixelsHigh, _bitsPerPixel / _samplesPerPixel, - _bitsPerPixel, _bytesPerRow, [self CGColorSpace], [self CGBitmapInfo], - provider, NULL, NO, kCGRenderingIntentDefault); + _pixelsWide, _pixelsHigh, _bitsPerPixel / _samplesPerPixel, + _bitsPerPixel, _bytesPerRow, [self CGColorSpace], + [self CGBitmapInfo], provider, NULL, NO, kCGRenderingIntentDefault); CGDataProviderRelease(provider); @@ -764,11 +763,11 @@ NSBitmapImageRepPropertyKey NSImageCurrentFrame = @"NSImageCurrentFrame"; - (CGColorSpaceRef) CGColorSpace { if ([_colorSpaceName isEqualToString: NSDeviceRGBColorSpace]) - return ( - CGColorSpaceRef)[(id) CGColorSpaceCreateDeviceRGB() autorelease]; + return (CGColorSpaceRef)[(id) CGColorSpaceCreateDeviceRGB() + autorelease]; if ([_colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]) - return ( - CGColorSpaceRef)[(id) CGColorSpaceCreateDeviceRGB() autorelease]; + return (CGColorSpaceRef)[(id) CGColorSpaceCreateDeviceRGB() + autorelease]; return NULL; } diff --git a/AppKit/NSBox.m b/AppKit/NSBox.m index 2217a739..05bd1ff2 100644 --- a/AppKit/NSBox.m +++ b/AppKit/NSBox.m @@ -58,7 +58,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _isTransparent = [keyed decodeBoolForKey: @"NSFullyTransparent"]; [[_subviews lastObject] - setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; + setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [[_subviews lastObject] setAutoresizesSubviews: YES]; if (_boxType == NSBoxCustom) { @@ -105,7 +105,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _titlePosition = NSAboveTop; contentview = [[NSView alloc] - initWithFrame: NSMakeRect(0, 0, NSWidth(frame), NSHeight(frame))]; + initWithFrame: NSMakeRect(0, 0, NSWidth(frame), NSHeight(frame))]; [contentview setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [self addSubview: contentview]; [contentview release]; @@ -173,7 +173,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) setContentView: (NSView *) view { if (![[self subviews] containsObject: view]) { [[self subviews] - makeObjectsPerformSelector: @selector(removeFromSuperview)]; + makeObjectsPerformSelector: @selector(removeFromSuperview)]; // FIX, adjust size [self addSubview: view]; } @@ -201,7 +201,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSAttributedString *) _attributedTitle { NSMutableDictionary *attributes = [NSMutableDictionary dictionary]; NSMutableParagraphStyle *paraStyle = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; + [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] + autorelease]; NSFont *font = [_titleCell font]; if (font != nil) @@ -217,9 +218,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [attributes setObject: [NSColor windowBackgroundColor] forKey: NSBackgroundColorAttributeName]; - return - [[[NSAttributedString alloc] initWithString: [_titleCell stringValue] - attributes: attributes] autorelease]; + return [[[NSAttributedString alloc] initWithString: [_titleCell stringValue] + attributes: attributes] + autorelease]; } #define TEXTGAP 4 @@ -235,10 +236,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // result.size.width=ceil(size.width); // // NSTextField cell must be bugged // we get too low values for the width here - result.size.width = - bounds.size.width - - result.origin - .x; // use the whole width until the text field cell size is fixed + result.size.width = bounds.size.width - + result.origin.x; // use the whole width until the text + // field cell size is fixed switch (_titlePosition) { diff --git a/AppKit/NSBrowser.m b/AppKit/NSBrowser.m index 8b3b7efc..a554c897 100644 --- a/AppKit/NSBrowser.m +++ b/AppKit/NSBrowser.m @@ -52,7 +52,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSKeyedUnarchiver *keyed = (NSKeyedUnarchiver *) coder; unsigned flags = [keyed decodeIntForKey: @"NSBrFlags"]; NSString *firstTitle = - [keyed decodeObjectForKey: @"NSFirstColumnTitle"]; + [keyed decodeObjectForKey: @"NSFirstColumnTitle"]; _explicitTitles = [NSMutableArray new]; if (firstTitle != nil) @@ -69,7 +69,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _cellPrototype = nil; _numberOfVisibleColumns = - [keyed decodeIntForKey: @"NSNumberOfVisibleColumns"]; + [keyed decodeIntForKey: @"NSNumberOfVisibleColumns"]; _selectedColumn = -1; _allowsMultipleSelection = (flags & 0x80000000) ? YES : NO; @@ -299,9 +299,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ column -= [self firstVisibleColumn]; - result.size.width = - ([self bounds].size.width - (_numberOfVisibleColumns - 1) * columnGap) / - _numberOfVisibleColumns; + result.size.width = ([self bounds].size.width - + (_numberOfVisibleColumns - 1) * columnGap) / + _numberOfVisibleColumns; result.size.height = [self titleHeight]; result.origin.x = column * (result.size.width + columnGap); result.origin.y = [self bounds].size.height - result.size.height; @@ -354,11 +354,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) setDelegate: delegate { // check delegate validity if (![delegate respondsToSelector: @selector(browser: - createRowsForColumn:inMatrix:)]) + createRowsForColumn:inMatrix:)]) if (![delegate respondsToSelector: @selector(browser: - numberOfRowsInColumn:)] && - ![delegate respondsToSelector: @selector(browser: - willDisplayCell:atRow:column:)]) + numberOfRowsInColumn:)] && + ![delegate respondsToSelector: @selector + (browser:willDisplayCell:atRow:column:)]) [NSException raise: NSInternalInconsistencyException format: @"-[NSBrowser setDelegate:] doesn't implement " @"delegate methods"]; @@ -396,7 +396,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (flag) { if (_horizontalScroller == nil) { _horizontalScroller = - [[NSScroller alloc] initWithFrame: [self frameOfScroller]]; + [[NSScroller alloc] initWithFrame: [self frameOfScroller]]; [_horizontalScroller setTarget: self]; [_horizontalScroller setAction: @selector(scrollViaScroller:)]; } @@ -569,7 +569,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ while ([_matrices count] <= column) { NSRect frame = [self frameOfInsideOfColumn: column]; NSMatrix *matrix = - [[[_matrixClass alloc] initWithFrame: frame] autorelease]; + [[[_matrixClass alloc] initWithFrame: frame] autorelease]; [matrix setTarget: self]; [matrix setAction: @selector(doClick:)]; @@ -600,14 +600,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (column >= [self firstVisibleColumn] && column <= [self lastVisibleColumn]) { - NSScrollView *scrollView = - [_scrollViews objectAtIndex: column - [self firstVisibleColumn]]; + NSScrollView *scrollView = [_scrollViews + objectAtIndex: column - [self firstVisibleColumn]]; [scrollView setDocumentView: [_matrices objectAtIndex: column]]; + [scrollView setLineScroll: [[_matrices objectAtIndex: column] cellSize] + .height]; [scrollView - setLineScroll: [[_matrices objectAtIndex: column] cellSize].height]; - [scrollView - setPageScroll: [[scrollView contentView] frame].size.height]; + setPageScroll: [[scrollView contentView] frame].size.height]; } [self updateScroller]; @@ -625,7 +625,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [matrix renewRows: 0 columns: 1]; if ([_delegate respondsToSelector: @selector(browser: - createRowsForColumn:inMatrix:)]) + createRowsForColumn:inMatrix:)]) [_delegate browser: self createRowsForColumn: column inMatrix: matrix]; else { NSInteger nrows = [_delegate browser: self @@ -636,9 +636,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (i = 0; i < nrows; i++) { [_delegate browser: self - willDisplayCell: [matrix cellAtRow: i column: 0] - atRow: i - column: column]; + willDisplayCell: [matrix cellAtRow: i column: 0] + atRow: i + column: column]; } } @@ -655,8 +655,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ title = [_delegate browser: self titleOfColumn: column]; else if (_takesTitleFromPreviousColumn) { if (column > 0) { - title = - [[[self matrixInColumn: column - 1] selectedCell] stringValue]; + title = [[[self matrixInColumn: column - 1] selectedCell] + stringValue]; } } @@ -716,10 +716,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (i = _firstVisibleColumn; i <= [self lastVisibleColumn] && i < [_matrices count]; i++) { NSView *matrix = - (i < [_matrices count]) ? [_matrices objectAtIndex: i] : nil; + (i < [_matrices count]) ? [_matrices objectAtIndex: i] : nil; [[_scrollViews objectAtIndex: scrollViewIndex++] - setDocumentView: matrix]; + setDocumentView: matrix]; } [self updateScroller]; @@ -741,7 +741,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ scrollViewIndex = [_scrollViews count] - 1; for (i = [self lastVisibleColumn]; i >= _firstVisibleColumn; --i) { [[_scrollViews objectAtIndex: scrollViewIndex--] - setDocumentView: [_matrices objectAtIndex: i]]; + setDocumentView: [_matrices objectAtIndex: i]]; } [self updateScroller]; @@ -794,7 +794,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ CGFloat val = (CGFloat) _firstVisibleColumn / (CGFloat)([_matrices count] - _numberOfVisibleColumns); CGFloat knobP = - (CGFloat) _numberOfVisibleColumns / (CGFloat)[_matrices count]; + (CGFloat) _numberOfVisibleColumns / (CGFloat)[_matrices count]; [_horizontalScroller setFloatValue: val knobProportion: knobP]; [_horizontalScroller setEnabled: YES]; @@ -820,7 +820,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSInteger column = _firstVisibleColumn + [_scrollViews count]; NSRect frame = [self frameOfColumn: column]; NSScrollView *view = - [[[NSScrollView alloc] initWithFrame: frame] autorelease]; + [[[NSScrollView alloc] initWithFrame: frame] autorelease]; [view setBorderType: NSBezelBorder]; [view setHasVerticalScroller: YES]; @@ -882,10 +882,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } if ([self hasHorizontalScroller]) - [[self graphicsStyle] - drawBrowserHorizontalScrollerWellInRect: [self - frameOfScrollerBorder] - clipRect: rect]; + [[self graphicsStyle] drawBrowserHorizontalScrollerWellInRect: + [self frameOfScrollerBorder] + clipRect: rect]; } - (void) resizeSubviewsWithOldSize: (NSSize) oldSize { @@ -951,9 +950,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) moveRight: sender { if (![[self selectedCell] isLeaf]) { - [self - selectRow: 0 - inColumn: _selectedColumn + 1]; // nb this changes _selectedColumn + [self selectRow: 0 + inColumn: _selectedColumn + + 1]; // nb this changes _selectedColumn [self doClick: [self matrixInColumn: _selectedColumn]]; } } diff --git a/AppKit/NSBrowserCell.m b/AppKit/NSBrowserCell.m index e983d532..001d17da 100644 --- a/AppKit/NSBrowserCell.m +++ b/AppKit/NSBrowserCell.m @@ -123,7 +123,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSAttributedString *title = [self attributedStringValue]; NSImage *branchImage = [self branchImage]; NSSize branchImageSize = - (branchImage == nil) ? NSMakeSize(0, 0) : [branchImage size]; + (branchImage == nil) ? NSMakeSize(0, 0) : [branchImage size]; NSPoint branchImageOrigin = frame.origin; NSImage *image = [self image]; NSSize imageSize = (image == nil) ? NSMakeSize(0, 0) : [image size]; @@ -133,9 +133,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ BOOL drawBranchImage = YES, drawTitle = YES, drawImage = YES; branchImageOrigin.x = - frame.origin.x + (frame.size.width - branchImageSize.width); + frame.origin.x + (frame.size.width - branchImageSize.width); branchImageOrigin.y += - floor((frame.size.height - branchImageSize.height) / 2); + floor((frame.size.height - branchImageSize.height) / 2); imageOrigin.x = frame.origin.x; imageOrigin.y += floor((frame.size.height - imageSize.height) / 2); @@ -151,10 +151,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* check for length to avoid exception */ if ([title length] > 0 && [title attribute: NSForegroundColorAttributeName - atIndex: 0 - effectiveRange: NULL] == nil) { + atIndex: 0 + effectiveRange: NULL] == nil) { NSMutableAttributedString *change = - [[title mutableCopy] autorelease]; + [[title mutableCopy] autorelease]; [change addAttribute: NSForegroundColorAttributeName value: [NSColor selectedControlTextColor] @@ -174,12 +174,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (drawBranchImage) { [branchImage - drawInRect: NSMakeRect(branchImageOrigin.x, branchImageOrigin.y, - branchImageSize.width, - branchImageSize.height) - fromRect: NSZeroRect - operation: NSCompositeSourceOver - fraction: 1.0]; + drawInRect: NSMakeRect(branchImageOrigin.x, branchImageOrigin.y, + branchImageSize.width, + branchImageSize.height) + fromRect: NSZeroRect + operation: NSCompositeSourceOver + fraction: 1.0]; } if (drawImage) { diff --git a/AppKit/NSButton.m b/AppKit/NSButton.m index 49dbec9d..cd79e725 100644 --- a/AppKit/NSButton.m +++ b/AppKit/NSButton.m @@ -284,10 +284,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ CGFloat size = [currentFont pointSize]; NSFont *newFont = - [[NSFontManager sharedFontManager] fontWithFamily: familyName - traits: 0 - weight: 5 - size: size]; + [[NSFontManager sharedFontManager] fontWithFamily: familyName + traits: 0 + weight: 5 + size: size]; if (newFont != nil) { [self setFont: newFont]; } diff --git a/AppKit/NSButtonCell.m b/AppKit/NSButtonCell.m index 19a12f41..de77bd29 100644 --- a/AppKit/NSButtonCell.m +++ b/AppKit/NSButtonCell.m @@ -116,7 +116,7 @@ static const CGFloat kImageMargin = 2.; _highlightsBy |= NSChangeGrayCellMask; _isBordered = - (flags & 0x00800000) ? YES : NO; // err, this flag is in NSCell too + (flags & 0x00800000) ? YES : NO; // err, this flag is in NSCell too _bezelStyle = (flags2 & 0x7) | (flags2 & 0x20 >> 2); @@ -145,12 +145,12 @@ static const CGFloat kImageMargin = 2.; } else { if (([[[self image] name] isEqualToString: @"NSRadioButton"] && [[[self alternateImage] name] - isEqualToString: @"NSHighlightedRadioButton"]) && + isEqualToString: @"NSHighlightedRadioButton"]) && (flags & 0x20000) == 0) { [self setButtonType: NSRadioButton]; } else if (([[[self image] name] isEqualToString: @"NSSwitch"] && [[[self alternateImage] name] - isEqualToString: @"NSHighlightedSwitch"]) && + isEqualToString: @"NSHighlightedSwitch"]) && (flags & 0x20000) == 0) { [self setButtonType: NSMomentaryPushInButton]; } @@ -169,9 +169,9 @@ static const CGFloat kImageMargin = 2.; id check; _titleOrAttributedTitle = - [[keyed decodeObjectForKey: @"NSContents"] retain]; + [[keyed decodeObjectForKey: @"NSContents"] retain]; _alternateTitle = - [[keyed decodeObjectForKey: @"NSAlternateContents"] retain]; + [[keyed decodeObjectForKey: @"NSAlternateContents"] retain]; [self _applyButtonCellAppleFlags: flags flags2: flags2]; @@ -191,7 +191,7 @@ static const CGFloat kImageMargin = 2.; _normalImage = [_image retain]; _keyEquivalent = - [[keyed decodeObjectForKey: @"NSKeyEquivalent"] retain]; + [[keyed decodeObjectForKey: @"NSKeyEquivalent"] retain]; _keyEquivalentModifierMask = flags2 >> 8; [self setIntValue: _state]; // make the int value of NSButtonCell to be // in synch with the bare _state of NSCell @@ -222,16 +222,16 @@ static const CGFloat kImageMargin = 2.; unichar keyEquivalent = inFlags2 >> 8; if (keyEquivalent != 0) { _keyEquivalent = - [[NSString alloc] initWithCharacters: &keyEquivalent - length: 1]; + [[NSString alloc] initWithCharacters: &keyEquivalent + length: 1]; } if (altContents) { - _alternateTitle = - [[NSString alloc] initWithBytesNoCopy: altContents - length: strlen(altContents) - encoding: NSUTF8StringEncoding - freeWhenDone: TRUE]; + _alternateTitle = [[NSString alloc] + initWithBytesNoCopy: altContents + length: strlen(altContents) + encoding: NSUTF8StringEncoding + freeWhenDone: TRUE]; } if (flags & 0x20000) { @@ -366,13 +366,14 @@ static const CGFloat kImageMargin = 2.; if (version <= 40) { if (([[self image] - isEqual: [NSImage imageNamed: @"NSRadioButton"]] && + isEqual: [NSImage imageNamed: @"NSRadioButton"]] && [[self alternateImage] - isEqual: [NSImage - imageNamed: @"NSHighlightedRadioButton"]]) || + isEqual: [NSImage imageNamed: @"NSHighlightedRadioButt" + @"on"]]) || ([[self image] isEqual: [NSImage imageNamed: @"NSSwitch"]] && [[self alternateImage] - isEqual: [NSImage imageNamed: @"NSHighlightedSwitch"]])) { + isEqual: [NSImage imageNamed: + @"NSHighlightedSwitch"]])) { flags |= 0x1000; } } @@ -384,7 +385,7 @@ static const CGFloat kImageMargin = 2.; if ([[self keyEquivalent] isEqualToString: @"\r"]) { if ([[[self image] name] isEqualToString: @"NSReturnSign"] || [[[self alternateImage] name] - isEqualToString: @"NXreturnSignH"]) { + isEqualToString: @"NXreturnSignH"]) { [self setImage: nil]; [self setAlternateImage: nil]; flags &= 0xB70000; @@ -500,13 +501,13 @@ static const CGFloat kImageMargin = 2.; // attributed string when title is nil return [[NSAttributedString alloc] initWithString: @""]; } else if ([_titleOrAttributedTitle - isKindOfClass: [NSAttributedString class]]) + isKindOfClass: [NSAttributedString class]]) return _titleOrAttributedTitle; else { NSMutableDictionary *attributes = [NSMutableDictionary dictionary]; NSMutableParagraphStyle *paraStyle = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] - autorelease]; + [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] + autorelease]; NSFont *font = [self font]; if (font != nil) @@ -525,14 +526,15 @@ static const CGFloat kImageMargin = 2.; return [[[NSAttributedString alloc] initWithString: [self title] attributes: attributes] - autorelease]; + autorelease]; } } - (NSAttributedString *) attributedAlternateTitle { NSMutableDictionary *attributes = [NSMutableDictionary dictionary]; NSMutableParagraphStyle *paraStyle = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; + [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] + autorelease]; NSFont *font = [self font]; if (font != nil) @@ -549,9 +551,9 @@ static const CGFloat kImageMargin = 2.; [attributes setObject: [NSColor disabledControlTextColor] forKey: NSForegroundColorAttributeName]; - return - [[[NSAttributedString alloc] initWithString: [self alternateTitle] - attributes: attributes] autorelease]; + return [[[NSAttributedString alloc] initWithString: [self alternateTitle] + attributes: attributes] + autorelease]; } - (int) highlightsBy { @@ -763,8 +765,8 @@ static const CGFloat kImageMargin = 2.; _imagePosition = NSImageLeft; _imageDimsWhenDisabled = NO; [self setImage: [NSImage imageNamed: @"NSRadioButton"]]; - [self setAlternateImage: [NSImage - imageNamed: @"NSHighlightedRadioButton"]]; + [self setAlternateImage: + [NSImage imageNamed: @"NSHighlightedRadioButton"]]; [self setAlignment: NSLeftTextAlignment]; [self setBordered: NO]; [self setBezeled: NO]; @@ -857,9 +859,9 @@ static const CGFloat kImageMargin = 2.; BOOL enabled = [self isEnabled] ? YES : ![self imageDimsWhenDisabled]; BOOL mixed = [self state] == NSMixedState; imageSize = - [[[self controlView] graphicsStyle] sizeOfButtonImage: image - enabled: enabled - mixed: mixed]; + [[[self controlView] graphicsStyle] sizeOfButtonImage: image + enabled: enabled + mixed: mixed]; } return NSMakeRect(rect.origin.x, rect.origin.y, imageSize.width, imageSize.height); @@ -932,7 +934,7 @@ static const CGFloat kImageMargin = 2.; frame.size.height = 10 - _controlSize * 2; frame.origin.x = 5 - _controlSize; frame.origin.y = - flipped ? _controlSize * 2 - 3 : 7 - _controlSize * 2; + flipped ? _controlSize * 2 - 3 : 7 - _controlSize * 2; break; case NSMiniControlSize: @@ -947,7 +949,7 @@ static const CGFloat kImageMargin = 2.; - (void) _drawTexturedBezelWithFrame: (NSRect) frame { BOOL highlighted = [self isHighlighted]; BOOL pressed = - [self state] && ([self showsStateBy] & NSChangeBackgroundCellMask); + [self state] && ([self showsStateBy] & NSChangeBackgroundCellMask); BOOL renderDarkenBg = NO, renderOutlineShadow = NO; // CGFloat topGray=0.76, bottomGray=0.98, strokeGray=0.4; @@ -972,10 +974,11 @@ static const CGFloat kImageMargin = 2.; const CGFloat baseY = floor(frame.origin.y); const CGFloat maxY = baseY + frame.size.height - 1.0; - CGRect r = - CGRectMake(floor(frame.origin.x), baseY, ceil(frame.size.width), 1.0); + CGRect r = CGRectMake(floor(frame.origin.x), baseY, ceil(frame.size.width), + 1.0); while (r.origin.y <= maxY) { - CGFloat g = bottomGray + (topGray - bottomGray) * + CGFloat g = + bottomGray + (topGray - bottomGray) * ((r.origin.y - baseY) / (maxY - baseY)); CGFloat components[4] = {g, g, g, 1.0}; CGContextSetFillColor(ctx, components); @@ -1060,7 +1063,7 @@ static void drawRoundedBezel(CGContextRef context, CGRect frame) { BOOL defaulted = ([[controlView window] defaultButtonCell] == self); NSRect adjustment = - [self getControlSizeAdjustment: [controlView isFlipped]]; + [self getControlSizeAdjustment: [controlView isFlipped]]; frame.size.width -= adjustment.size.width; frame.size.height -= adjustment.size.height; frame.origin.x += adjustment.origin.x; @@ -1107,7 +1110,7 @@ static void drawRoundedBezel(CGContextRef context, CGRect frame) { case NSRecessedBezelStyle:; if ([self isBordered] && [self isVisuallyHighlighted]) { CGContextRef context = - [[NSGraphicsContext currentContext] graphicsPort]; + [[NSGraphicsContext currentContext] graphicsPort]; frame.size.height--; frame.origin.y += [controlView isFlipped] ? 1 : 0; @@ -1130,20 +1133,20 @@ static void drawRoundedBezel(CGContextRef context, CGRect frame) { default: if (![self isBordered]) { [[_controlView graphicsStyle] - drawUnborderedButtonInRect: frame - defaulted: defaulted]; + drawUnborderedButtonInRect: frame + defaulted: defaulted]; } else { if (([self highlightsBy] & NSPushInCellMask) && [self isHighlighted]) [[_controlView graphicsStyle] - drawPushButtonPressedInRect: frame]; + drawPushButtonPressedInRect: frame]; else if ([self isVisuallyHighlighted]) [[_controlView graphicsStyle] - drawPushButtonHighlightedInRect: frame]; + drawPushButtonHighlightedInRect: frame]; else [[_controlView graphicsStyle] - drawPushButtonNormalInRect: frame - defaulted: defaulted]; + drawPushButtonNormalInRect: frame + defaulted: defaulted]; } break; } @@ -1164,10 +1167,10 @@ static void drawRoundedBezel(CGContextRef context, CGRect frame) { CGContextScaleCTM(ctx, 1, -1); } [[controlView graphicsStyle] - drawButtonImage: image - inRect: NSMakeRect(0, 0, rect.size.width, rect.size.height) - enabled: enabled - mixed: mixed]; + drawButtonImage: image + inRect: NSMakeRect(0, 0, rect.size.width, rect.size.height) + enabled: enabled + mixed: mixed]; CGContextRestoreGState(ctx); } @@ -1243,7 +1246,7 @@ static NSSize scaledImageSizeInFrameSize(NSSize imageSize, NSSize frameSize, */ BOOL defaulted = ([[controlView window] defaultButtonCell] == self); NSRect adjustment = - [self getControlSizeAdjustment: [controlView isFlipped]]; + [self getControlSizeAdjustment: [controlView isFlipped]]; frame.size.width -= adjustment.size.width; frame.size.height -= adjustment.size.height; frame.origin.x += adjustment.origin.x; @@ -1278,8 +1281,8 @@ static NSSize scaledImageSizeInFrameSize(NSSize imageSize, NSSize frameSize, if ([self bezelStyle] == NSDisclosureBezelStyle) imagePosition = NSImageOnly; - imageSize = - scaledImageSizeInFrameSize(imageSize, frame.size, [self imageScaling]); + imageSize = scaledImageSizeInFrameSize(imageSize, frame.size, + [self imageScaling]); imageOrigin.x += floor((frame.size.width - imageSize.width) / 2); imageOrigin.y += floor((frame.size.height - imageSize.height) / 2); @@ -1314,16 +1317,16 @@ static NSSize scaledImageSizeInFrameSize(NSSize imageSize, NSSize frameSize, titleRect.origin.y += imageSize.height; imageOrigin.y = MAX(frame.origin.y, imageOrigin.y); titleRect.origin.y = - MIN(frame.origin.y + frame.size.height - titleRect.size.height, - titleRect.origin.y); + MIN(frame.origin.y + frame.size.height - titleRect.size.height, + titleRect.origin.y); break; case NSImageAbove: imageOrigin.y = frame.origin.y + (frame.size.height - imageSize.height); titleRect.origin.y -= imageSize.height; imageOrigin.y = - MIN(frame.origin.y + frame.size.height - imageSize.height, - imageOrigin.y); + MIN(frame.origin.y + frame.size.height - imageSize.height, + imageOrigin.y); titleRect.origin.y = MAX(frame.origin.y, titleRect.origin.y); break; @@ -1368,29 +1371,29 @@ static NSSize scaledImageSizeInFrameSize(NSSize imageSize, NSSize frameSize, const CGFloat shadowAlpha = ([self isHighlighted]) ? 0.15 : 0.25; NSString *baseTitle = [NSString stringWithString: [title string]]; NSMutableDictionary *shadowAttrs = - [[[title attributesAtIndex: 0 - effectiveRange: NULL] mutableCopy] autorelease]; + [[[title attributesAtIndex: 0 + effectiveRange: NULL] mutableCopy] autorelease]; if (titleRect.origin.y > frame.origin.y + 1) { // only draw the shadow if it doesn't come // too close to the edge [shadowAttrs - setObject: [NSColor colorWithDeviceRed: shadowGray - green: shadowGray - blue: shadowGray - alpha: shadowAlpha] - forKey: NSForegroundColorAttributeName]; + setObject: [NSColor colorWithDeviceRed: shadowGray + green: shadowGray + blue: shadowGray + alpha: shadowAlpha] + forKey: NSForegroundColorAttributeName]; NSAttributedString *shadowTitle = [[[NSAttributedString alloc] - initWithString: baseTitle - attributes: shadowAttrs] autorelease]; + initWithString: baseTitle + attributes: shadowAttrs] autorelease]; NSRect shadowRect = NSOffsetRect(titleRect, 0, 1); [shadowTitle _clipAndDrawInRect: shadowRect]; } NSMutableDictionary *fgAttrs = - [[shadowAttrs mutableCopy] autorelease]; + [[shadowAttrs mutableCopy] autorelease]; if ([self isEnabled]) [fgAttrs setObject: [NSColor colorWithDeviceRed: fgGray green: fgGray @@ -1405,7 +1408,7 @@ static NSSize scaledImageSizeInFrameSize(NSSize imageSize, NSSize frameSize, forKey: NSForegroundColorAttributeName]; title = [[[NSAttributedString alloc] initWithString: baseTitle attributes: fgAttrs] - autorelease]; + autorelease]; } [self drawTitle: title withFrame: titleRect inView: controlView]; diff --git a/AppKit/NSCachedImageRep.m b/AppKit/NSCachedImageRep.m index c281fe41..627e6292 100644 --- a/AppKit/NSCachedImageRep.m +++ b/AppKit/NSCachedImageRep.m @@ -46,15 +46,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // in them. NSWindowStyleMask styleMask = NSBorderlessWindowMask; if ([[NSUserDefaults standardUserDefaults] - boolForKey: @"NSShowAllWindows"] == NO) { + boolForKey: @"NSShowAllWindows"] == NO) { styleMask |= NSAppKitPrivateWindow; } NSRect rect = {NSZeroPoint, size}; NSWindow *window = - [[NSWindow alloc] initWithContentRect: rect - styleMask: styleMask - backing: NSBackingStoreBuffered - defer: NO]; + [[NSWindow alloc] initWithContentRect: rect + styleMask: styleMask + backing: NSBackingStoreBuffered + defer: NO]; NSDictionary *entries = @{@"CGContext" : @"Onyx"}; [[window platformWindow] addEntriesToDeviceDictionary: entries]; @@ -78,16 +78,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (BOOL) drawAtPoint: (NSPoint) point { NSRect rect = {point, _size}; - CGImageRef imageRef = - CGBitmapContextCreateImage([[_window graphicsContext] graphicsPort]); + CGImageRef imageRef = CGBitmapContextCreateImage( + [[_window graphicsContext] graphicsPort]); CGContextDrawImage(NSCurrentGraphicsPort(), rect, imageRef); CGImageRelease(imageRef); return YES; } - (BOOL) drawInRect: (NSRect) rect { - CGImageRef imageRef = - CGBitmapContextCreateImage([[_window graphicsContext] graphicsPort]); + CGImageRef imageRef = CGBitmapContextCreateImage( + [[_window graphicsContext] graphicsPort]); CGContextDrawImage(NSCurrentGraphicsPort(), rect, imageRef); CGImageRelease(imageRef); return YES; diff --git a/AppKit/NSCell.m b/AppKit/NSCell.m index e43733cc..4addc793 100644 --- a/AppKit/NSCell.m +++ b/AppKit/NSCell.m @@ -347,8 +347,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (BOOL) wraps { return (_lineBreakMode == NSLineBreakByWordWrapping || _lineBreakMode == NSLineBreakByCharWrapping) - ? YES - : NO; + ? YES + : NO; } - (NSString *) title { @@ -432,9 +432,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (int) intValue { NSString *objString = - ([_objectValue isKindOfClass: [NSAttributedString class]]) - ? [_objectValue string] - : (NSString *) _objectValue; + ([_objectValue isKindOfClass: [NSAttributedString class]]) + ? [_objectValue string] + : (NSString *) _objectValue; if ([objString isKindOfClass: [NSString class]]) { int i = 0; [[NSScanner localizedScannerWithString: objString] scanInt: &i]; @@ -450,9 +450,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return 0.f; } NSString *objString = - ([_objectValue isKindOfClass: [NSAttributedString class]]) - ? [_objectValue string] - : (NSString *) _objectValue; + ([_objectValue isKindOfClass: [NSAttributedString class]]) + ? [_objectValue string] + : (NSString *) _objectValue; if ([objString isKindOfClass: [NSString class]]) { float f = 0.0; [[NSScanner localizedScannerWithString: objString] scanFloat: &f]; @@ -470,9 +470,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } NSString *objString = - ([_objectValue isKindOfClass: [NSAttributedString class]]) - ? [_objectValue string] - : (NSString *) _objectValue; + ([_objectValue isKindOfClass: [NSAttributedString class]]) + ? [_objectValue string] + : (NSString *) _objectValue; if ([objString isKindOfClass: [NSString class]]) { double d = 0.0; [[NSScanner localizedScannerWithString: objString] scanDouble: &d]; @@ -483,9 +483,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSInteger) integerValue { NSString *objString = - ([_objectValue isKindOfClass: [NSAttributedString class]]) - ? [_objectValue string] - : (NSString *) _objectValue; + ([_objectValue isKindOfClass: [NSAttributedString class]]) + ? [_objectValue string] + : (NSString *) _objectValue; if ([objString isKindOfClass: [NSString class]]) { NSInteger i = 0; [[NSScanner localizedScannerWithString: objString] scanInteger: &i]; @@ -500,8 +500,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ else { NSMutableDictionary *attributes = [NSMutableDictionary dictionary]; NSMutableParagraphStyle *paraStyle = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] - autorelease]; + [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] + autorelease]; NSFont *font = [self font]; if (font != nil) @@ -525,7 +525,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return [[[NSAttributedString alloc] initWithString: [self stringValue] attributes: attributes] - autorelease]; + autorelease]; } } @@ -558,7 +558,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [self setFont: [NSFont systemFontOfSize: 12.0]]; } [[[self controlView] window] - invalidateCursorRectsForView: [self controlView]]; + invalidateCursorRectsForView: [self controlView]]; } } @@ -596,20 +596,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) setTarget: target { [NSException - raise: NSInternalInconsistencyException - format: @"-[%@ %s] Unimplemented", [self class], sel_getName(_cmd)]; + raise: NSInternalInconsistencyException + format: @"-[%@ %s] Unimplemented", [self class], sel_getName(_cmd)]; } - (void) setAction: (SEL) action { [NSException - raise: NSInternalInconsistencyException - format: @"-[%@ %s] Unimplemented", [self class], sel_getName(_cmd)]; + raise: NSInternalInconsistencyException + format: @"-[%@ %s] Unimplemented", [self class], sel_getName(_cmd)]; } - (void) setTag: (NSInteger) tag { [NSException - raise: NSInternalInconsistencyException - format: @"-[%@ %s] Unimplemented", [self class], sel_getName(_cmd)]; + raise: NSInternalInconsistencyException + format: @"-[%@ %s] Unimplemented", [self class], sel_getName(_cmd)]; } - (void) setEntryType: (NSInteger) type { @@ -672,7 +672,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_isEnabled != flag) { _isEnabled = flag; [[[self controlView] window] - invalidateCursorRectsForView: [self controlView]]; + invalidateCursorRectsForView: [self controlView]]; } } @@ -680,7 +680,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_isEditable != flag) { _isEditable = flag; [[[self controlView] window] - invalidateCursorRectsForView: [self controlView]]; + invalidateCursorRectsForView: [self controlView]]; } } @@ -688,7 +688,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_isSelectable != flag) { _isSelectable = flag; [[[self controlView] window] - invalidateCursorRectsForView: [self controlView]]; + invalidateCursorRectsForView: [self controlView]]; } } @@ -764,9 +764,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) setStringValue: (NSString *) value { if (value == nil) { - [NSException - raise: NSInvalidArgumentException - format: @"-[%@ %s] value==nil", [self class], sel_getName(_cmd)]; + [NSException raise: NSInvalidArgumentException + format: @"-[%@ %s] value==nil", [self class], + sel_getName(_cmd)]; return; } @@ -922,9 +922,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) frame - ofView: (NSView *) view - untilMouseUp: (BOOL) untilMouseUp + inRect: (NSRect) frame + ofView: (NSView *) view + untilMouseUp: (BOOL) untilMouseUp { NSPoint lastPoint; BOOL result = NO; @@ -940,7 +940,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ currentPoint = [view convertPoint: [event locationInWindow] fromView: nil]; isWithinCellFrame = - NSMouseInRect(currentPoint, frame, [view isFlipped]); + NSMouseInRect(currentPoint, frame, [view isFlipped]); if (untilMouseUp) { if ([event type] == NSLeftMouseUp) { @@ -982,8 +982,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [[view window] flushWindow]; - event = [[view window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[view window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while (YES); @@ -1010,7 +1010,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (drawsBackground)]]; if ([self respondsToSelector: @selector(backgroundColor)]) [editor setBackgroundColor: [self performSelector: @selector - (backgroundColor)]]; + (backgroundColor)]]; return editor; } @@ -1040,7 +1040,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } [clipView - setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; + setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [editor setAutoresizingMask: 0]; [editor setHorizontallyResizable: [self isScrollable]]; [editor setVerticallyResizable: YES]; @@ -1149,9 +1149,10 @@ static NSString *NSStringFromCellType(NSCellType type) { - (NSString *) description { return [NSString - stringWithFormat: @"%@\n\ttype: %@\n\tfont: %@\n\tobjectValue: %@", - [super description], NSStringFromCellType(_cellType), - _font, _objectValue]; + stringWithFormat: @"%@\n\ttype: %@\n\tfont: %@\n\tobjectValue: %@", + [super description], + NSStringFromCellType(_cellType), _font, + _objectValue]; } @end diff --git a/AppKit/NSClipView.m b/AppKit/NSClipView.m index c0dccf17..187d0e0c 100644 --- a/AppKit/NSClipView.m +++ b/AppKit/NSClipView.m @@ -45,15 +45,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_docView != nil) [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(viewFrameChanged:) - name: NSViewFrameDidChangeNotification - object: _docView]; + addObserver: self + selector: @selector(viewFrameChanged:) + name: NSViewFrameDidChangeNotification + object: _docView]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(viewBoundsChanged:) - name: NSViewBoundsDidChangeNotification - object: _docView]; + addObserver: self + selector: @selector(viewBoundsChanged:) + name: NSViewBoundsDidChangeNotification + object: _docView]; } else { [NSException raise: NSInvalidArgumentException format: @"-[%@ %s] is not implemented for coder %@", @@ -121,13 +121,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) setDocumentView: (NSView *) view { if (_docView != nil) { [[NSNotificationCenter defaultCenter] - removeObserver: self - name: NSViewFrameDidChangeNotification - object: _docView]; + removeObserver: self + name: NSViewFrameDidChangeNotification + object: _docView]; [[NSNotificationCenter defaultCenter] - removeObserver: self - name: NSViewBoundsDidChangeNotification - object: _docView]; + removeObserver: self + name: NSViewBoundsDidChangeNotification + object: _docView]; } [_docView removeFromSuperview]; @@ -140,15 +140,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_docView != nil) { [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(viewFrameChanged:) - name: NSViewFrameDidChangeNotification - object: _docView]; + addObserver: self + selector: @selector(viewFrameChanged:) + name: NSViewFrameDidChangeNotification + object: _docView]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(viewBoundsChanged:) - name: NSViewBoundsDidChangeNotification - object: _docView]; + addObserver: self + selector: @selector(viewBoundsChanged:) + name: NSViewBoundsDidChangeNotification + object: _docView]; } } diff --git a/AppKit/NSCoder+AppKit.m b/AppKit/NSCoder+AppKit.m index 23d04e2d..684d606e 100644 --- a/AppKit/NSCoder+AppKit.m +++ b/AppKit/NSCoder+AppKit.m @@ -58,8 +58,8 @@ enum { if (*name) colorName = - [NSString stringWithCString: name - encoding: NSMacOSRomanStringEncoding]; + [NSString stringWithCString: name + encoding: NSMacOSRomanStringEncoding]; NSString *catalogs[2] = {@"PANTONE", nil}; NSString *palette = nil; @@ -81,8 +81,8 @@ enum { palette = catalogs[0]; } else palette = [NSString - stringWithCString: bufPalette - encoding: NSMacOSRomanStringEncoding]; + stringWithCString: bufPalette + encoding: NSMacOSRomanStringEncoding]; } } diff --git a/AppKit/NSCollectionViewFlowLayout.m b/AppKit/NSCollectionViewFlowLayout.m index dd3432d7..68b7d29b 100644 --- a/AppKit/NSCollectionViewFlowLayout.m +++ b/AppKit/NSCollectionViewFlowLayout.m @@ -20,6 +20,6 @@ #import NSString *const NSCollectionElementKindSectionHeader = - @"UICollectionElementKindSectionHeader"; + @"UICollectionElementKindSectionHeader"; NSString *const NSCollectionElementKindSectionFooter = - @"UICollectionElementKindSectionFooter"; + @"UICollectionElementKindSectionFooter"; diff --git a/AppKit/NSCollectionViewLayout.m b/AppKit/NSCollectionViewLayout.m index 4130cc25..5b34ef9d 100644 --- a/AppKit/NSCollectionViewLayout.m +++ b/AppKit/NSCollectionViewLayout.m @@ -20,5 +20,5 @@ #import NSCollectionViewSupplementaryElementKind const - NSCollectionElementKindInterItemGapIndicator = - @"NSCollectionElementKindInterItemGapIndicator"; + NSCollectionElementKindInterItemGapIndicator = + @"NSCollectionElementKindInterItemGapIndicator"; diff --git a/AppKit/NSColor.subproj/NSColor.m b/AppKit/NSColor.subproj/NSColor.m index 151b1a08..38c81b7c 100644 --- a/AppKit/NSColor.subproj/NSColor.m +++ b/AppKit/NSColor.subproj/NSColor.m @@ -52,7 +52,7 @@ static int NSColor_ignoresAlpha = -1; [self getRed: &r green: &g blue: &b alpha: &a]; [coder encodeInt: 1 forKey: @"NSColorSpace"]; NSString *string = - [NSString stringWithFormat: @"%f %f %f %f", r, g, b, a]; + [NSString stringWithFormat: @"%f %f %f %f", r, g, b, a]; NSData *data = [string dataUsingEncoding: NSASCIIStringEncoding]; [coder encodeBytes: [data bytes] length: [data length] @@ -63,7 +63,7 @@ static int NSColor_ignoresAlpha = -1; [self getRed: &r green: &g blue: &b alpha: &a]; [coder encodeInt: 2 forKey: @"NSColorSpace"]; NSString *string = - [NSString stringWithFormat: @"%f %f %f %f", r, g, b, a]; + [NSString stringWithFormat: @"%f %f %f %f", r, g, b, a]; NSData *data = [string dataUsingEncoding: NSASCIIStringEncoding]; [coder encodeBytes: [data bytes] length: [data length] @@ -93,8 +93,8 @@ static int NSColor_ignoresAlpha = -1; [self getCyan: &c magenta: &m yellow: &y black: &k alpha: &a]; [coder encodeInt: 5 forKey: @"NSColorSpace"]; - NSString *string = - [NSString stringWithFormat: @"%f %f %f %f %f", c, m, y, k, a]; + NSString *string = [NSString + stringWithFormat: @"%f %f %f %f %f", c, m, y, k, a]; NSData *data = [string dataUsingEncoding: NSASCIIStringEncoding]; [coder encodeBytes: [data bytes] length: [data length] @@ -142,9 +142,9 @@ static int NSColor_ignoresAlpha = -1; const uint8_t *rgb = [keyed decodeBytesForKey: @"NSRGB" returnedLength: &length]; NSString *string = [[[NSString alloc] - initWithBytes: rgb - length: length - encoding: NSUTF8StringEncoding] autorelease]; + initWithBytes: rgb + length: length + encoding: NSUTF8StringEncoding] autorelease]; NSArray *components = [string componentsSeparatedByString: @" "]; int count = [components count]; @@ -181,9 +181,9 @@ static int NSColor_ignoresAlpha = -1; const uint8_t *white = [keyed decodeBytesForKey: @"NSWhite" returnedLength: &length]; NSString *string = [[[NSString alloc] - initWithBytes: white - length: length - encoding: NSUTF8StringEncoding] autorelease]; + initWithBytes: white + length: length + encoding: NSUTF8StringEncoding] autorelease]; NSArray *components = [string componentsSeparatedByString: @" "]; int count = [components count]; @@ -215,9 +215,9 @@ static int NSColor_ignoresAlpha = -1; const uint8_t *cmyk = [keyed decodeBytesForKey: @"NSCMYK" returnedLength: &length]; NSString *string = [[[NSString alloc] - initWithBytes: cmyk - length: length - 1 - encoding: NSUTF8StringEncoding] autorelease]; + initWithBytes: cmyk + length: length - 1 + encoding: NSUTF8StringEncoding] autorelease]; NSArray *components = [string componentsSeparatedByString: @" "]; int count = [components count]; @@ -633,8 +633,8 @@ static void drawPattern(void *info, CGContextRef cgContext) { NSImage *image = (NSImage *) info; NSSize size = [image size]; NSGraphicsContext *context = - [NSGraphicsContext graphicsContextWithGraphicsPort: cgContext - flipped: NO]; + [NSGraphicsContext graphicsContextWithGraphicsPort: cgContext + flipped: NO]; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext: context]; @@ -654,17 +654,17 @@ static void releasePatternInfo(void *info) { CGPatternCallbacks callbacks = {0, drawPattern, releasePatternInfo}; [image retain]; CGPatternRef pattern = - CGPatternCreate(image, CGRectMake(0, 0, size.width, size.height), - CGAffineTransformIdentity, size.width, size.height, - kCGPatternTilingNoDistortion, YES, &callbacks); + CGPatternCreate(image, CGRectMake(0, 0, size.width, size.height), + CGAffineTransformIdentity, size.width, size.height, + kCGPatternTilingNoDistortion, YES, &callbacks); CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGFloat components[4] = {1, 1, 1, 1}; CGColorRef cgColor = - CGColorCreateWithPattern(colorSpace, pattern, components); + CGColorCreateWithPattern(colorSpace, pattern, components); NSColor *result = [[[NSColor_CGColor alloc] - initWithColorRef: cgColor - spaceName: NSPatternColorSpace] autorelease]; + initWithColorRef: cgColor + spaceName: NSPatternColorSpace] autorelease]; CGColorRelease(cgColor); CGColorSpaceRelease(colorSpace); @@ -700,9 +700,9 @@ static void releasePatternInfo(void *info) { } - (void) getHue: (CGFloat *) hue - saturation: (CGFloat *) saturation - brightness: (CGFloat *) brightness - alpha: (CGFloat *) alpha + saturation: (CGFloat *) saturation + brightness: (CGFloat *) brightness + alpha: (CGFloat *) alpha { NSInvalidAbstractInvocation(); } @@ -828,9 +828,9 @@ static void releasePatternInfo(void *info) { ofColor: (NSColor *) color { NSColor *primary = - [color colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + [color colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; NSColor *secondary = - [self colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + [self colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; if (primary == nil || secondary == nil) return nil; @@ -899,10 +899,11 @@ static void releasePatternInfo(void *info) { @synchronized(self) { if (NSColor_ignoresAlpha == -1) NSColor_ignoresAlpha = - [[[NSUserDefaults standardUserDefaults] - objectForKey: @"NSIgnoreAlpha"] - compare: @"NO" - options: NSCaseInsensitiveSearch] != NSOrderedSame; + [[[NSUserDefaults standardUserDefaults] + objectForKey: @"NSIgnoreAlpha"] + compare: @"NO" + options: NSCaseInsensitiveSearch] != + NSOrderedSame; } } diff --git a/AppKit/NSColor.subproj/NSColor_CGColor.m b/AppKit/NSColor.subproj/NSColor_CGColor.m index 5ea4cab7..41e2219d 100644 --- a/AppKit/NSColor.subproj/NSColor_CGColor.m +++ b/AppKit/NSColor.subproj/NSColor_CGColor.m @@ -138,7 +138,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: @"<%@ colorRef=%@>", [self class], _colorRef]; + stringWithFormat: @"<%@ colorRef=%@>", [self class], _colorRef]; } - (NSInteger) numberOfComponents { @@ -159,9 +159,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSColor *) colorWithAlphaComponent: (CGFloat) alpha { CGColorRef ref = CGColorCreateCopyWithAlpha(_colorRef, alpha); - NSColor *result = - [[[[self class] alloc] initWithColorRef: ref - spaceName: _colorSpaceName] autorelease]; + NSColor *result = [[[[self class] alloc] initWithColorRef: ref + spaceName: _colorSpaceName] + autorelease]; CGColorRelease(ref); return result; @@ -219,9 +219,9 @@ static inline CGFloat calibratedWhiteFromRGB(CGFloat r, CGFloat g, CGFloat b) { CGFloat alpha = components[3]; if ([otherSpaceName isEqualToString: NSDeviceWhiteColorSpace]) - return [NSColor - colorWithDeviceWhite: calibratedWhiteFromRGB(red, green, blue) - alpha: alpha]; + return [NSColor colorWithDeviceWhite: calibratedWhiteFromRGB( + red, green, blue) + alpha: alpha]; if ([otherSpaceName isEqualToString: NSDeviceCMYKColorSpace]) return [NSColor colorWithDeviceCyan: 1.0 - red @@ -238,7 +238,7 @@ static inline CGFloat calibratedWhiteFromRGB(CGFloat r, CGFloat g, CGFloat b) { if ([otherSpaceName isEqualToString: NSCalibratedWhiteColorSpace]) return [NSColor colorWithCalibratedWhite: calibratedWhiteFromRGB( - red, green, blue) + red, green, blue) alpha: alpha]; } else if ([_colorSpaceName isEqualToString: NSDeviceCMYKColorSpace]) { CGFloat cyan = components[0]; @@ -296,9 +296,9 @@ static inline CGFloat calibratedWhiteFromRGB(CGFloat r, CGFloat g, CGFloat b) { CGFloat alpha = components[3]; if ([otherSpaceName isEqualToString: NSDeviceWhiteColorSpace]) - return [NSColor - colorWithDeviceWhite: calibratedWhiteFromRGB(red, green, blue) - alpha: alpha]; + return [NSColor colorWithDeviceWhite: calibratedWhiteFromRGB( + red, green, blue) + alpha: alpha]; if ([otherSpaceName isEqualToString: NSDeviceCMYKColorSpace]) return [NSColor colorWithDeviceCyan: 1.0 - red @@ -309,7 +309,7 @@ static inline CGFloat calibratedWhiteFromRGB(CGFloat r, CGFloat g, CGFloat b) { if ([otherSpaceName isEqualToString: NSCalibratedWhiteColorSpace]) return [NSColor colorWithCalibratedWhite: calibratedWhiteFromRGB( - red, green, blue) + red, green, blue) alpha: alpha]; if ([otherSpaceName isEqualToString: NSDeviceRGBColorSpace]) @@ -381,9 +381,9 @@ static inline CGFloat calibratedWhiteFromRGB(CGFloat r, CGFloat g, CGFloat b) { } - (void) getHue: (CGFloat *) huep - saturation: (CGFloat *) saturationp - brightness: (CGFloat *) brightnessp - alpha: (CGFloat *) alphap + saturation: (CGFloat *) saturationp + brightness: (CGFloat *) brightnessp + alpha: (CGFloat *) alphap { CGColorSpaceRef colorSpace = CGColorGetColorSpace(_colorRef); CGColorSpaceModel model = CGColorSpaceGetModel(colorSpace); diff --git a/AppKit/NSColor.subproj/NSColor_catalog.m b/AppKit/NSColor.subproj/NSColor_catalog.m index 4692630c..484cbf00 100644 --- a/AppKit/NSColor.subproj/NSColor_catalog.m +++ b/AppKit/NSColor.subproj/NSColor_catalog.m @@ -110,8 +110,8 @@ NSColor *NSColorGetCatalogColor(NSString *catalogName, NSString *colorName); return self; result = [NSColorGetCatalogColor(_catalogName, _colorName) - colorUsingColorSpaceName: colorSpace - device: device]; + colorUsingColorSpaceName: colorSpace + device: device]; if (result == nil) NSLog(@"result ==nil %@ %@", _colorName, colorSpace); diff --git a/AppKit/NSColorList.m b/AppKit/NSColorList.m index 8872d60a..83b2f044 100644 --- a/AppKit/NSColorList.m +++ b/AppKit/NSColorList.m @@ -21,7 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSColorListDidChangeNotification = - @"NSColorListDidChangeNotification"; + @"NSColorListDidChangeNotification"; @implementation NSColorList @@ -175,11 +175,11 @@ static NSMutableDictionary *_namedColorLists = nil; {nil, 0x0}}; NSColorList *basicColorList = - [[[NSColorList alloc] initWithName: @"Basic"] autorelease]; + [[[NSColorList alloc] initWithName: @"Basic"] autorelease]; NSColorList *systemColorList = - [[[NSColorList alloc] initWithName: @"System"] autorelease]; + [[[NSColorList alloc] initWithName: @"System"] autorelease]; NSColorList *webColorList = - [[[NSColorList alloc] initWithName: @"Web"] autorelease]; + [[[NSColorList alloc] initWithName: @"Web"] autorelease]; int i; for (i = 0; webColors[i].name != nil; i++) { @@ -356,8 +356,8 @@ static NSMutableDictionary *_namedColorLists = nil; } [[NSNotificationCenter defaultCenter] - postNotificationName: NSColorListDidChangeNotification - object: self]; + postNotificationName: NSColorListDidChangeNotification + object: self]; } - (void) removeColorWithKey: (NSString *) key { @@ -368,8 +368,8 @@ static NSMutableDictionary *_namedColorLists = nil; [_keys removeObjectAtIndex: index]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSColorListDidChangeNotification - object: self]; + postNotificationName: NSColorListDidChangeNotification + object: self]; } } @@ -381,8 +381,8 @@ static NSMutableDictionary *_namedColorLists = nil; [_keys insertObject: key atIndex: index]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSColorListDidChangeNotification - object: self]; + postNotificationName: NSColorListDidChangeNotification + object: self]; } - (void) writeToFile: (NSString *) path { diff --git a/AppKit/NSColorPanel.m b/AppKit/NSColorPanel.m index 25a275c1..e0bd3f1a 100644 --- a/AppKit/NSColorPanel.m +++ b/AppKit/NSColorPanel.m @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSColorPanelColorDidChangeNotification = - @"NSColorPanelColorDidChangeNotification"; + @"NSColorPanelColorDidChangeNotification"; @interface NSColorPicker (PrivateInterface) @@ -87,25 +87,25 @@ static NSUInteger _pickerMask = 0; [color writeToPasteboard: pboard]; [view dragImage: image - at: NSMakePoint(0, 0) - offset: NSMakeSize(0, 0) - event: event - pasteboard: pboard - source: view - slideBack: YES]; + at: NSMakePoint(0, 0) + offset: NSMakeSize(0, 0) + event: event + pasteboard: pboard + source: view + slideBack: YES]; return YES; } - (void) swapInNewView: sender { NSColorPicker *chosenColorPicker = - [_colorPickers objectAtIndex: [sender selectedTag]]; + [_colorPickers objectAtIndex: [sender selectedTag]]; NSView *newView; newView = [chosenColorPicker provideNewView: YES]; if (currentColorPickerView != newView) { [[sender selectedCell] - setImage: [chosenColorPicker provideNewButtonImage]]; + setImage: [chosenColorPicker provideNewButtonImage]]; if (currentColorPickerView != nil) [newView setFrame: [currentColorPickerView frame]]; @@ -125,14 +125,14 @@ static NSUInteger _pickerMask = 0; // time to load the color pickers. theoretically we should be searching all // the /Library/ColorPickers out there, but... NSArray *colorPickersClassArray = - [NSArray arrayWithObjects: [NSColorPickerWheel class], - [NSColorPickerSliders class], + [NSArray arrayWithObjects: [NSColorPickerWheel class], + [NSColorPickerSliders class], #if 1 - // Disabled to see if it fixes a nib - // instantiation issue - [NSColorPickerColorList class], + // Disabled to see if it fixes a nib + // instantiation issue + [NSColorPickerColorList class], #endif - nil]; + nil]; NSUInteger i, count = [colorPickersClassArray count]; [colorWell setBordered: NO]; @@ -142,9 +142,9 @@ static NSUInteger _pickerMask = 0; for (i = 0; i < count; i++) { Class colorPickerClass = [colorPickersClassArray objectAtIndex: i]; - NSColorPicker *newPicker = - [[[colorPickerClass alloc] initWithPickerMask: _pickerMask - colorPanel: self] autorelease]; + NSColorPicker *newPicker = [[[colorPickerClass alloc] + initWithPickerMask: _pickerMask + colorPanel: self] autorelease]; NSCell *cell = [colorPickersMatrix cellAtRow: 0 column: i]; [_colorPickers addObject: newPicker]; @@ -217,13 +217,14 @@ static NSUInteger _pickerMask = 0; [opacityTextField setFloatValue: alpha * 100.f]; [[NSNotificationQueue defaultQueue] - enqueueNotification: - [NSNotification - notificationWithName: NSColorPanelColorDidChangeNotification - object: self] - postingStyle: NSPostNow - coalesceMask: NSNotificationCoalescingOnName - forModes: nil]; + enqueueNotification: + [NSNotification + notificationWithName: + NSColorPanelColorDidChangeNotification + object: self] + postingStyle: NSPostNow + coalesceMask: NSNotificationCoalescingOnName + forModes: nil]; } - (void) setMode: (NSColorPanelMode) mode { diff --git a/AppKit/NSColorPicker.subproj/NSColorPickerColorList.m b/AppKit/NSColorPicker.subproj/NSColorPickerColorList.m index cdbbe09b..f4de85fe 100644 --- a/AppKit/NSColorPicker.subproj/NSColorPickerColorList.m +++ b/AppKit/NSColorPicker.subproj/NSColorPickerColorList.m @@ -28,7 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ colorPanel: (NSColorPanel *) colorPanel { NSEnumerator *colorListsEnumerator = - [[NSColorList availableColorLists] objectEnumerator]; + [[NSColorList availableColorLists] objectEnumerator]; NSColorList *colorList; [super initWithPickerMask: mask colorPanel: colorPanel]; @@ -50,20 +50,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) colorListPopUpClicked: (id) sender { [_pickedColorList release]; _pickedColorList = [[NSColorList - colorListNamed: [[sender itemAtIndex: [sender indexOfSelectedItem]] - title]] retain]; + colorListNamed: [[sender itemAtIndex: [sender indexOfSelectedItem]] + title]] retain]; [colorBrowser reloadColumn: 0]; } - (void) colorListBrowserClicked: (id) sender { [[NSColorPanel sharedColorPanel] - setColor: [_pickedColorList - colorWithKey: [[sender selectedCell] stringValue]]]; + setColor: [_pickedColorList colorWithKey: [[sender selectedCell] + stringValue]]]; } - (NSInteger) browser: (NSBrowser *) sender - numberOfRowsInColumn: (NSInteger) column + numberOfRowsInColumn: (NSInteger) column { return [[_pickedColorList allKeys] count]; } @@ -73,15 +73,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) browser: (NSBrowser *) sender - willDisplayCell: (id) cell - atRow: (NSInteger) row - column: (NSInteger) column + willDisplayCell: (id) cell + atRow: (NSInteger) row + column: (NSInteger) column { [cell setStringValue: [[_pickedColorList allKeys] objectAtIndex: row]]; [cell setLeaf: YES]; [cell setLoaded: YES]; - [cell setColor: [_pickedColorList colorWithKey: [[_pickedColorList allKeys] - objectAtIndex: row]]]; + [cell setColor: [_pickedColorList + colorWithKey: [[_pickedColorList allKeys] + objectAtIndex: row]]]; } - (void) setColor: (NSColor *) color { diff --git a/AppKit/NSColorPicker.subproj/NSColorPickerSliders.m b/AppKit/NSColorPicker.subproj/NSColorPickerSliders.m index e8c7ebd7..f15b39f4 100644 --- a/AppKit/NSColorPicker.subproj/NSColorPickerSliders.m +++ b/AppKit/NSColorPicker.subproj/NSColorPickerSliders.m @@ -87,10 +87,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ color = [color colorUsingColorSpaceName: NSDeviceCMYKColorSpace]; [color getCyan: &cyan - magenta: &magenta - yellow: &yellow - black: &black - alpha: &alpha]; + magenta: &magenta + yellow: &yellow + black: &black + alpha: &alpha]; [_cyanSlider setIntValue: cyan * 100]; [_magentaSlider setIntValue: magenta * 100]; @@ -111,9 +111,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ color = [color colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [color getHue: &hue - saturation: &saturation - brightness: &brightness - alpha: &alpha]; + saturation: &saturation + brightness: &brightness + alpha: &alpha]; [_hueSlider setIntValue: hue * 359]; [_saturationSlider setIntValue: saturation * 100]; @@ -193,9 +193,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [greyscaleSlider setIntValue: intValue]; [[self colorPanel] - setColor: [NSColor - colorWithCalibratedWhite: intValue / 100.0 - alpha: [[self colorPanel] alpha]]]; + setColor: [NSColor colorWithCalibratedWhite: intValue / 100.0 + alpha: [[self colorPanel] + alpha]]]; } - (void) grayscaleConstant: sender { @@ -223,10 +223,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [[rgbTextFieldMatrix cellAtRow: 2 column: 0] setIntValue: [blue intValue]]; [[self colorPanel] - setColor: [NSColor colorWithCalibratedRed: [red doubleValue] / 255.0 - green: [green doubleValue] / 255.0 - blue: [blue doubleValue] / 255.0 - alpha: [[self colorPanel] alpha]]]; + setColor: [NSColor + colorWithCalibratedRed: [red doubleValue] / 255.0 + green: [green doubleValue] / + 255.0 + blue: [blue doubleValue] / 255.0 + alpha: [[self colorPanel] + alpha]]]; } - (void) rgbSliderChanged: sender { @@ -254,11 +257,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [_blackSlider setIntValue: [black intValue]]; [[self colorPanel] - setColor: [NSColor colorWithDeviceCyan: [cyan doubleValue] / 100.0 - magenta: [magenta doubleValue] / 100.0 - yellow: [yellow doubleValue] / 100.0 - black: [black doubleValue] / 100.0 - alpha: [[self colorPanel] alpha]]]; + setColor: [NSColor + colorWithDeviceCyan: [cyan doubleValue] / 100.0 + magenta: [magenta doubleValue] / 100.0 + yellow: [yellow doubleValue] / 100.0 + black: [black doubleValue] / 100.0 + alpha: [[self colorPanel] alpha]]]; } - (void) cmykSliderChanged: sender { @@ -287,23 +291,26 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [_brightnessSlider setIntValue: [brightness intValue]]; [[self colorPanel] - setColor: [NSColor - colorWithCalibratedHue: [hue doubleValue] / 359.0 - saturation: [saturation doubleValue] / 100.0 - brightness: [brightness doubleValue] / 100.0 - alpha: [[self colorPanel] alpha]]]; + setColor: [NSColor + colorWithCalibratedHue: [hue doubleValue] / 359.0 + saturation: [saturation doubleValue] / + 100.0 + brightness: [brightness doubleValue] / + 100.0 + alpha: [[self colorPanel] + alpha]]]; } - (void) hsbSliderChanged: sender { [self _updateHue: _hueSlider - saturation: _saturationSlider - brightness: _brightnessSlider]; + saturation: _saturationSlider + brightness: _brightnessSlider]; } - (void) hsbTextChanged: sender { [self _updateHue: [hsbTextFieldMatrix cellAtRow: 0 column: 0] - saturation: [hsbTextFieldMatrix cellAtRow: 1 column: 0] - brightness: [hsbTextFieldMatrix cellAtRow: 2 column: 0]]; + saturation: [hsbTextFieldMatrix cellAtRow: 1 column: 0] + brightness: [hsbTextFieldMatrix cellAtRow: 2 column: 0]]; } @end diff --git a/AppKit/NSColorPicker.subproj/NSColorPickerWheel.m b/AppKit/NSColorPicker.subproj/NSColorPickerWheel.m index fc5e416f..964f415e 100644 --- a/AppKit/NSColorPicker.subproj/NSColorPickerWheel.m +++ b/AppKit/NSColorPicker.subproj/NSColorPickerWheel.m @@ -21,9 +21,9 @@ color = [color colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [color getHue: &hue - saturation: &saturation - brightness: &brightness - alpha: &alpha]; + saturation: &saturation + brightness: &brightness + alpha: &alpha]; [_wheelView setHue: hue * 360]; [_wheelView setSaturation: saturation * 100]; @@ -47,10 +47,11 @@ { [[self colorPanel] - setColor: [NSColor colorWithCalibratedHue: hue / 360.0 - saturation: saturation / 100.0 - brightness: brightness / 100.0 - alpha: [[self colorPanel] alpha]]]; + setColor: [NSColor colorWithCalibratedHue: hue / 360.0 + saturation: saturation / 100.0 + brightness: brightness / 100.0 + alpha: [[self colorPanel] + alpha]]]; } - (void) setColor: (NSColor *) color { diff --git a/AppKit/NSColorPicker.subproj/NSColorPickerWheelView.m b/AppKit/NSColorPicker.subproj/NSColorPickerWheelView.m index b1989f04..4be9533d 100644 --- a/AppKit/NSColorPicker.subproj/NSColorPickerWheelView.m +++ b/AppKit/NSColorPicker.subproj/NSColorPickerWheelView.m @@ -120,13 +120,13 @@ location.y -= center.y; CGFloat relativeDistanceFromCenter = - hypot(location.x, location.y) / colorWheelRadius; + hypot(location.x, location.y) / colorWheelRadius; if (relativeDistanceFromCenter > 1) relativeDistanceFromCenter = 1; // Get the angle and ensure it's in 0..2*PI - CGFloat angle = - fmod(atan2(location.y, location.x) - M_PI_2 + M_PI * 2.f, M_PI * 2.f); + CGFloat angle = fmod(atan2(location.y, location.x) - M_PI_2 + M_PI * 2.f, + M_PI * 2.f); // Hue is stored in degrees _hueValue = angle * 180.f / M_PI; diff --git a/AppKit/NSColorSpace.m b/AppKit/NSColorSpace.m index e2260e99..0d8c0b1b 100644 --- a/AppKit/NSColorSpace.m +++ b/AppKit/NSColorSpace.m @@ -24,14 +24,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSColorSpace *) sRGBColorSpace { CGColorSpaceRef srgb = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); NSColorSpace *colorSpace = - [[[self alloc] initWithCGColorSpace: srgb] autorelease]; + [[[self alloc] initWithCGColorSpace: srgb] autorelease]; return colorSpace; } + (NSColorSpace *) deviceRGBColorSpace { CGColorSpaceRef device = CGColorSpaceCreateDeviceRGB(); NSColorSpace *result = - [[[self alloc] initWithCGColorSpace: device] autorelease]; + [[[self alloc] initWithCGColorSpace: device] autorelease]; CGColorSpaceRelease(device); diff --git a/AppKit/NSColorWell.m b/AppKit/NSColorWell.m index 91f504c0..e44efadf 100644 --- a/AppKit/NSColorWell.m +++ b/AppKit/NSColorWell.m @@ -49,7 +49,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // private NSNotificationName _NSColorWellDidBecomeExclusiveNotification = - @"_NSColorWellDidBecomeExclusiveNotification"; + @"_NSColorWellDidBecomeExclusiveNotification"; - (void) encodeWithCoder: (NSCoder *) coder { NSUnimplementedMethod(); @@ -81,15 +81,15 @@ NSNotificationName _NSColorWellDidBecomeExclusiveNotification = _color = [[NSColor whiteColor] copy]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(colorPanelWillClose:) - name: NSWindowWillCloseNotification - object: [NSColorPanel sharedColorPanel]]; + addObserver: self + selector: @selector(colorPanelWillClose:) + name: NSWindowWillCloseNotification + object: [NSColorPanel sharedColorPanel]]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(colorWellDidBecomeExclusive:) - name: _NSColorWellDidBecomeExclusiveNotification - object: nil]; + addObserver: self + selector: @selector(colorWellDidBecomeExclusive:) + name: _NSColorWellDidBecomeExclusiveNotification + object: nil]; [self registerForDraggedTypes: @[ NSColorPboardType ]]; @@ -99,15 +99,15 @@ NSNotificationName _NSColorWellDidBecomeExclusiveNotification = - (void) awakeFromNib { // this should be moved the nib initWithCoder: [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(colorPanelWillClose:) - name: NSWindowWillCloseNotification - object: [NSColorPanel sharedColorPanel]]; + addObserver: self + selector: @selector(colorPanelWillClose:) + name: NSWindowWillCloseNotification + object: [NSColorPanel sharedColorPanel]]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(colorWellDidBecomeExclusive:) - name: _NSColorWellDidBecomeExclusiveNotification - object: nil]; + addObserver: self + selector: @selector(colorWellDidBecomeExclusive:) + name: _NSColorWellDidBecomeExclusiveNotification + object: nil]; [self registerForDraggedTypes: @[ NSColorPboardType ]]; } @@ -196,20 +196,20 @@ NSNotificationName _NSColorWellDidBecomeExclusiveNotification = if (exclusive) { NSNotification *notification = [NSNotification - notificationWithName: _NSColorWellDidBecomeExclusiveNotification - object: self]; + notificationWithName: _NSColorWellDidBecomeExclusiveNotification + object: self]; [[NSNotificationQueue defaultQueue] - enqueueNotification: notification - postingStyle: NSPostNow - coalesceMask: NSNotificationCoalescingOnName - forModes: nil]; + enqueueNotification: notification + postingStyle: NSPostNow + coalesceMask: NSNotificationCoalescingOnName + forModes: nil]; } [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(changeColorWhenActive:) - name: NSColorPanelColorDidChangeNotification - object: [NSColorPanel sharedColorPanel]]; + addObserver: self + selector: @selector(changeColorWhenActive:) + name: NSColorPanelColorDidChangeNotification + object: [NSColorPanel sharedColorPanel]]; // Update the color panel with our color. [[NSColorPanel sharedColorPanel] setColor: [self color]]; @@ -225,9 +225,9 @@ NSNotificationName _NSColorWellDidBecomeExclusiveNotification = _isActive = NO; [[NSNotificationCenter defaultCenter] - removeObserver: self - name: NSColorPanelColorDidChangeNotification - object: [NSColorPanel sharedColorPanel]]; + removeObserver: self + name: NSColorPanelColorDidChangeNotification + object: [NSColorPanel sharedColorPanel]]; [self setNeedsDisplay: YES]; } @@ -284,8 +284,8 @@ NSNotificationName _NSColorWellDidBecomeExclusiveNotification = BOOL wasActive = [self isActive]; NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil]; - BOOL mouseInBorder = - !NSMouseInRect(point, NSInsetRect(_bounds, 8, 8), [self isFlipped]); + BOOL mouseInBorder = !NSMouseInRect(point, NSInsetRect(_bounds, 8, 8), + [self isFlipped]); BOOL canStartDrag = !mouseInBorder; if (mouseInBorder) { // Toggle the initial state. @@ -297,12 +297,12 @@ NSNotificationName _NSColorWellDidBecomeExclusiveNotification = BOOL shouldStartDrag = NO; do { - event = - [[self window] nextEventMatchingMask: NSLeftMouseUpMask | - NSLeftMouseDraggedMask]; + event = [[self window] + nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; point = [self convertPoint: [event locationInWindow] fromView: nil]; BOOL mouseInBounds = - NSMouseInRect(point, _bounds, [self isFlipped]); + NSMouseInRect(point, _bounds, [self isFlipped]); if ([event type] == NSLeftMouseDragged) { if (canStartDrag) { // Get dragging the color. diff --git a/AppKit/NSComboBox.m b/AppKit/NSComboBox.m index f15c09e9..275664bc 100644 --- a/AppKit/NSComboBox.m +++ b/AppKit/NSComboBox.m @@ -24,13 +24,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSComboBoxSelectionDidChangeNotification = - @"NSComboBoxSelectionDidChangeNotification"; + @"NSComboBoxSelectionDidChangeNotification"; NSString *const NSComboBoxSelectionIsChangingNotification = - @"NSComboBoxSelectionIsChangingNotification"; + @"NSComboBoxSelectionIsChangingNotification"; NSString *const NSComboBoxWillDismissNotification = - @"NSComboBoxWillDismissNotification"; + @"NSComboBoxWillDismissNotification"; NSString *const NSComboBoxWillPopUpNotification = - @"NSComboBoxWillPopUpNotification"; + @"NSComboBoxWillPopUpNotification"; @implementation NSComboBox @@ -195,7 +195,7 @@ NSString *const NSComboBoxWillPopUpNotification = // objectValue index 0... - (BOOL) textView: (NSTextView *) textView doCommandBySelector: (SEL) selector { NSInteger index = - [[self cell] indexOfItemWithObjectValue: [self objectValue]]; + [[self cell] indexOfItemWithObjectValue: [self objectValue]]; id objectCache = nil; if ([textView rangeForUserCompletion].location != NSNotFound) @@ -226,12 +226,12 @@ NSString *const NSComboBoxWillPopUpNotification = } - (NSArray *) textView: (NSTextView *) textView - completions: (NSArray *) words - forPartialWordRange: (NSRange) range - indexOfSelectedItem: (NSInteger *) index + completions: (NSArray *) words + forPartialWordRange: (NSRange) range + indexOfSelectedItem: (NSInteger *) index { NSString *string = [[self cell] - completedString: [[textView string] substringWithRange: range]]; + completedString: [[textView string] substringWithRange: range]]; // NSLog(@"NSComboBox delegate OK: %@", string); diff --git a/AppKit/NSComboBoxCell.m b/AppKit/NSComboBoxCell.m index d42d182f..45095e34 100644 --- a/AppKit/NSComboBoxCell.m +++ b/AppKit/NSComboBoxCell.m @@ -38,11 +38,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _dataSource = [keyed decodeObjectForKey: @"NSDataSource"]; _objectValues = [[NSMutableArray alloc] - initWithArray: [keyed decodeObjectForKey: @"NSPopUpListData"]]; + initWithArray: [keyed decodeObjectForKey: @"NSPopUpListData"]]; _numberOfVisibleItems = [keyed decodeIntForKey: @"NSVisibleItemCount"]; _usesDataSource = [keyed decodeBoolForKey: @"NSUsesDataSource"]; _hasVerticalScroller = - [keyed decodeBoolForKey: @"NSHasVerticalScroller"]; + [keyed decodeBoolForKey: @"NSHasVerticalScroller"]; _completes = [keyed decodeBoolForKey: @"NSCompletes"]; _isButtonBordered = YES; _buttonEnabled = YES; @@ -238,7 +238,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_usesDataSource == YES) // not supported yet, well... if ([_dataSource respondsToSelector: @selector(comboBoxCell: - completedString:)] == YES) + completedString:)] == YES) return [_dataSource comboBoxCell: self completedString: string]; for (i = 0; i < count; ++i) { @@ -271,9 +271,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) cellFrame - ofView: (NSView *) controlView - untilMouseUp: (BOOL) flag + inRect: (NSRect) cellFrame + ofView: (NSView *) controlView + untilMouseUp: (BOOL) flag { NSComboBoxWindow *window; NSPoint origin = [controlView bounds].origin; @@ -281,7 +281,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSPoint check = [controlView convertPoint: [event locationInWindow] fromView: nil]; NSUInteger selectedIndex = - [_objectValues indexOfObject: [self objectValue]]; + [_objectValues indexOfObject: [self objectValue]]; if ([_objectValues count] == 0) return NO; @@ -329,7 +329,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ else if ([object respondsToSelector: @selector (descriptionWithLocale:)]) string = [object - descriptionWithLocale: [NSLocale currentLocale]]; + descriptionWithLocale: [NSLocale currentLocale]]; else if ([object respondsToSelector: @selector(description)]) string = [object description]; else @@ -337,7 +337,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (attstr) [[(NSTextView *) editor textStorage] - setAttributedString: attstr]; + setAttributedString: attstr]; else [editor setString: string]; @@ -345,8 +345,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [self endEditing: editor]; if (_sendsActionOnEndEditing) [(NSControl *) controlView - sendAction: [(NSControl *) controlView action] - to: [(NSControl *) controlView target]]; + sendAction: [(NSControl *) controlView action] + to: [(NSControl *) controlView target]]; } } @@ -372,10 +372,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [super drawWithFrame: frame inView: controlView]; [[controlView graphicsStyle] - drawComboBoxButtonInRect: [self buttonRectForBounds: frame] - enabled: _buttonEnabled - bordered: _isButtonBordered - pressed: _buttonPressed]; + drawComboBoxButtonInRect: [self buttonRectForBounds: frame] + enabled: _buttonEnabled + bordered: _isButtonBordered + pressed: _buttonPressed]; } @end diff --git a/AppKit/NSComboBoxView.m b/AppKit/NSComboBoxView.m index 3324fb16..b36cef30 100644 --- a/AppKit/NSComboBoxView.m +++ b/AppKit/NSComboBoxView.m @@ -60,14 +60,14 @@ enum { KEYBOARD_INACTIVE, KEYBOARD_ACTIVE, KEYBOARD_OK, KEYBOARD_CANCEL }; - (NSDictionary *) itemAttributes { return [NSDictionary - dictionaryWithObjectsAndKeys: _font, NSFontAttributeName, nil]; + dictionaryWithObjectsAndKeys: _font, NSFontAttributeName, nil]; } - (NSDictionary *) selectedItemAttributes { return [NSDictionary - dictionaryWithObjectsAndKeys: _font, NSFontAttributeName, - [NSColor selectedTextColor], - NSForegroundColorAttributeName, nil]; + dictionaryWithObjectsAndKeys: _font, NSFontAttributeName, + [NSColor selectedTextColor], + NSForegroundColorAttributeName, nil]; } - (NSSize) sizeForContents { @@ -250,8 +250,8 @@ enum { KEYBOARD_INACTIVE, KEYBOARD_ACTIVE, KEYBOARD_OK, KEYBOARD_CANCEL }; [[self window] flushWindow]; event = [[self window] - nextEventMatchingMask: NSLeftMouseDownMask | NSLeftMouseUpMask | - NSLeftMouseDraggedMask | NSKeyDownMask]; + nextEventMatchingMask: NSLeftMouseDownMask | NSLeftMouseUpMask | + NSLeftMouseDraggedMask | NSKeyDownMask]; if ([event type] == NSKeyDown) { [self interpretKeyEvents: [NSArray arrayWithObject: event]]; switch (_keyboardUIState) { @@ -279,7 +279,7 @@ enum { KEYBOARD_INACTIVE, KEYBOARD_ACTIVE, KEYBOARD_OK, KEYBOARD_CANCEL }; point = [event locationInWindow]; point = [[event window] convertBaseToScreen: point]; screenVisible = - NSInsetRect([[[self window] screen] visibleFrame], 4, 4); + NSInsetRect([[[self window] screen] visibleFrame], 4, 4); if (NSPointInRect(point, [[self window] frame]) && !NSPointInRect(point, screenVisible)) { NSPoint origin = [[self window] frame].origin; diff --git a/AppKit/NSComboBoxWindow.m b/AppKit/NSComboBoxWindow.m index 01d3d042..1c4af124 100644 --- a/AppKit/NSComboBoxWindow.m +++ b/AppKit/NSComboBoxWindow.m @@ -69,10 +69,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (int) runTrackingWithEvent: (NSEvent *) event { NSSize size = [_view sizeForContents]; NSSize scrollViewSize = [NSScrollView - frameSizeForContentSize: size - hasHorizontalScroller: [_scrollView hasHorizontalScroller] - hasVerticalScroller: [_scrollView hasVerticalScroller] - borderType: NSLineBorder]; + frameSizeForContentSize: size + hasHorizontalScroller: [_scrollView hasHorizontalScroller] + hasVerticalScroller: [_scrollView hasVerticalScroller] + borderType: NSLineBorder]; NSRect frame; frame = [self frame]; diff --git a/AppKit/NSControl.m b/AppKit/NSControl.m index ab34a6c8..620a6c7e 100644 --- a/AppKit/NSControl.m +++ b/AppKit/NSControl.m @@ -34,11 +34,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSControlTextDidBeginEditingNotification = - @"NSControlTextDidBeginEditingNotification"; + @"NSControlTextDidBeginEditingNotification"; NSString *const NSControlTextDidChangeNotification = - @"NSControlTextDidChangeNotification"; + @"NSControlTextDidChangeNotification"; NSString *const NSControlTextDidEndEditingNotification = - @"NSControlTextDidEndEditingNotification"; + @"NSControlTextDidEndEditingNotification"; @implementation NSControl @@ -74,7 +74,7 @@ static NSMutableDictionary *cellClassDictionary = nil; [_aux setTag: [keyed decodeIntegerForKey: @"NSTag"]]; SEL sel = NSSelectorFromString( - [keyed decodeObjectForKey: @"NSControlAction"]); + [keyed decodeObjectForKey: @"NSControlAction"]); if (sel) [_aux setAction: sel]; [_aux setTarget: [keyed decodeObjectForKey: @"NSControlTarget"]]; @@ -511,7 +511,7 @@ static NSMutableDictionary *cellClassDictionary = nil; NSTextView *textview = (NSTextView *) _currentEditor; NSAttributedString *text = [textview textStorage]; NSAttributedString *string = [[[NSAttributedString alloc] - initWithAttributedString: text] autorelease]; + initWithAttributedString: text] autorelease]; [[self selectedCell] setAttributedStringValue: string]; } else { [[self selectedCell] setStringValue: string]; @@ -577,11 +577,12 @@ static NSMutableDictionary *cellClassDictionary = nil; return; [[NSNotificationCenter defaultCenter] - postNotificationName: NSControlTextDidBeginEditingNotification - object: self - userInfo: [NSDictionary - dictionaryWithObject: [note object] - forKey: @"NSFieldEditor"]]; + postNotificationName: NSControlTextDidBeginEditingNotification + object: self + userInfo: [NSDictionary + dictionaryWithObject: [note object] + forKey: @"NSFieldEdito" + @"r"]]; // If this control's value is bound to an object that conforms to // NSEditorRegistration, register as an editor. @@ -589,7 +590,7 @@ static NSMutableDictionary *cellClassDictionary = nil; if (bindingInfo) { id observedObject = [bindingInfo objectForKey: NSObservedObjectKey]; if ([observedObject - respondsToSelector: @selector(objectDidBeginEditing:)]) + respondsToSelector: @selector(objectDidBeginEditing:)]) [observedObject objectDidBeginEditing: self]; } } @@ -602,11 +603,12 @@ static NSMutableDictionary *cellClassDictionary = nil; [[self selectedCell] setStringValue: [[note object] string]]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSControlTextDidChangeNotification - object: self - userInfo: [NSDictionary - dictionaryWithObject: [note object] - forKey: @"NSFieldEditor"]]; + postNotificationName: NSControlTextDidChangeNotification + object: self + userInfo: [NSDictionary + dictionaryWithObject: [note object] + forKey: @"NSFieldEdito" + @"r"]]; } - (void) textDidEndEditing: (NSNotification *) note { @@ -619,11 +621,12 @@ static NSMutableDictionary *cellClassDictionary = nil; [self abortEditing]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSControlTextDidEndEditingNotification - object: self - userInfo: [NSDictionary - dictionaryWithObject: [note object] - forKey: @"NSFieldEditor"]]; + postNotificationName: NSControlTextDidEndEditingNotification + object: self + userInfo: [NSDictionary + dictionaryWithObject: [note object] + forKey: @"NSFieldEdito" + @"r"]]; // If this control's value is bound to an object that conforms to // NSEditorRegistration, unregister as an editor. @@ -631,7 +634,7 @@ static NSMutableDictionary *cellClassDictionary = nil; if (bindingInfo) { id observedObject = [bindingInfo objectForKey: NSObservedObjectKey]; if ([observedObject - respondsToSelector: @selector(objectDidEndEditing:)]) + respondsToSelector: @selector(objectDidEndEditing:)]) [observedObject objectDidEndEditing: self]; } @@ -660,10 +663,10 @@ static NSMutableDictionary *cellClassDictionary = nil; [self setNeedsDisplay: YES]; if ([_cell trackMouse: event - inRect: [self bounds] - ofView: self - untilMouseUp: - [[_cell class] prefersTrackingUntilMouseUp]]) { + inRect: [self bounds] + ofView: self + untilMouseUp: + [[_cell class] prefersTrackingUntilMouseUp]]) { [_cell setState: ![_cell state]]; [self setNeedsDisplay: YES]; sendAction = YES; @@ -675,8 +678,8 @@ static NSMutableDictionary *cellClassDictionary = nil; } [[self window] flushWindow]; - event = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while ([event type] != NSLeftMouseUp); [self unlockFocus]; diff --git a/AppKit/NSController/NSArrayController.m b/AppKit/NSController/NSArrayController.m index a880e6c1..30208427 100644 --- a/AppKit/NSController/NSArrayController.m +++ b/AppKit/NSController/NSArrayController.m @@ -68,41 +68,41 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (void) initialize { [self setKeys: [NSArray arrayWithObjects: @"content", nil] - triggerChangeNotificationsForDependentKey: @"contentArray"]; + triggerChangeNotificationsForDependentKey: @"contentArray"]; [self setKeys: [NSArray arrayWithObjects: @"content", @"contentArray", @"selectionIndexes", nil] - triggerChangeNotificationsForDependentKey: @"selection"]; + triggerChangeNotificationsForDependentKey: @"selection"]; [self setKeys: [NSArray arrayWithObjects: @"content", @"contentArray", @"selectionIndexes", @"selection", nil] - triggerChangeNotificationsForDependentKey: @"selectionIndex"]; + triggerChangeNotificationsForDependentKey: @"selectionIndex"]; [self setKeys: [NSArray arrayWithObjects: @"content", @"contentArray", @"selectionIndexes", @"selection", nil] - triggerChangeNotificationsForDependentKey: @"selectedObjects"]; + triggerChangeNotificationsForDependentKey: @"selectedObjects"]; [self setKeys: [NSArray arrayWithObjects: @"selectionIndexes", nil] - triggerChangeNotificationsForDependentKey: @"canRemove"]; + triggerChangeNotificationsForDependentKey: @"canRemove"]; [self setKeys: [NSArray arrayWithObjects: @"selectionIndexes", nil] - triggerChangeNotificationsForDependentKey: @"canSelectNext"]; + triggerChangeNotificationsForDependentKey: @"canSelectNext"]; [self setKeys: [NSArray arrayWithObjects: @"selectionIndexes", nil] - triggerChangeNotificationsForDependentKey: @"canSelectPrevious"]; + triggerChangeNotificationsForDependentKey: @"canSelectPrevious"]; } - (id) initWithCoder: (NSCoder *) coder { if ((self = [super initWithCoder: coder])) { _flags.avoidsEmptySelection = - [coder decodeBoolForKey: @"NSAvoidsEmptySelection"]; + [coder decodeBoolForKey: @"NSAvoidsEmptySelection"]; _flags.clearsFilterPredicateOnInsertion = - [coder decodeBoolForKey: @"NSClearsFilterPredicateOnInsertion"]; + [coder decodeBoolForKey: @"NSClearsFilterPredicateOnInsertion"]; _flags.filterRestrictsInsertion = - [coder decodeBoolForKey: @"NSFilterRestrictsInsertion"]; + [coder decodeBoolForKey: @"NSFilterRestrictsInsertion"]; _flags.preservesSelection = - [coder decodeBoolForKey: @"NSPreservesSelection"]; + [coder decodeBoolForKey: @"NSPreservesSelection"]; _flags.selectsInsertedObjects = - [coder decodeBoolForKey: @"NSSelectsInsertedObjects"]; + [coder decodeBoolForKey: @"NSSelectsInsertedObjects"]; _flags.alwaysUsesMultipleValuesMarker = - [coder decodeBoolForKey: @"NSAlwaysUsesMultipleValuesMarker"]; + [coder decodeBoolForKey: @"NSAlwaysUsesMultipleValuesMarker"]; id declaredKeys = [coder decodeObjectForKey: @"NSDeclaredKeys"]; @@ -173,13 +173,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ id sortedObjects = objects; if ([self filterPredicate]) { - sortedObjects = - [sortedObjects filteredArrayUsingPredicate: [self filterPredicate]]; + sortedObjects = [sortedObjects + filteredArrayUsingPredicate: [self filterPredicate]]; } if ([self sortDescriptors]) { - sortedObjects = - [sortedObjects sortedArrayUsingDescriptors: [self sortDescriptors]]; + sortedObjects = [sortedObjects + sortedArrayUsingDescriptors: [self sortDescriptors]]; } return sortedObjects; @@ -381,8 +381,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ id set = [NSMutableIndexSet indexSet]; int i, count = [objects count]; for (i = 0; i < [objects count]; i++) { - NSUInteger idx = - [[self arrangedObjects] indexOfObject: [objects objectAtIndex: i]]; + NSUInteger idx = [[self arrangedObjects] + indexOfObject: [objects objectAtIndex: i]]; if (idx != NSNotFound) { [set addIndex: idx]; } @@ -499,7 +499,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Don't check canAdd here as this can be used programmatically to add // objects [self insertObject: object - atArrangedObjectIndex: [[self arrangedObjects] count]]; + atArrangedObjectIndex: [[self arrangedObjects] count]]; } - (void) addObjects: (NSArray *) objects { @@ -530,7 +530,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) insertObjects: (NSArray *) objects - atArrangedObjectIndexes: (NSIndexSet *) indices + atArrangedObjectIndexes: (NSIndexSet *) indices { if (_flags.clearsFilterPredicateOnInsertion) { [self setFilterPredicate: nil]; @@ -677,8 +677,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: @"<%@ %x> content: %@ arrangedObjects: %@", - [self class], self, _content, _arrangedObjects]; + stringWithFormat: @"<%@ %x> content: %@ arrangedObjects: %@", + [self class], self, _content, _arrangedObjects]; } @end diff --git a/AppKit/NSController/NSController.m b/AppKit/NSController/NSController.m index da442142..d148e0a2 100644 --- a/AppKit/NSController/NSController.m +++ b/AppKit/NSController/NSController.m @@ -36,11 +36,11 @@ BOOL NSIsControllerMarker(id object) { + (void) initialize { if (self == [NSController class]) { NSNoSelectionMarker = [[_NSControllerMarker alloc] - initWithString: @"NSNoSelectionMarker"]; + initWithString: @"NSNoSelectionMarker"]; NSMultipleValuesMarker = [[_NSControllerMarker alloc] - initWithString: @"NSMultipleValuesMarker"]; + initWithString: @"NSMultipleValuesMarker"]; NSNotApplicableMarker = [[_NSControllerMarker alloc] - initWithString: @"NSNotApplicableMarker"]; + initWithString: @"NSNotApplicableMarker"]; } } diff --git a/AppKit/NSController/NSControllerSelectionProxy.m b/AppKit/NSController/NSControllerSelectionProxy.m index dd653d4d..eebe6b75 100644 --- a/AppKit/NSController/NSControllerSelectionProxy.m +++ b/AppKit/NSController/NSControllerSelectionProxy.m @@ -50,7 +50,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (id) observableSelection { if (!_observableSelection) _observableSelection = [[_NSControllerArray alloc] - initWithArray: [_controller selectedObjects]]; + initWithArray: [_controller selectedObjects]]; return _observableSelection; } @@ -62,12 +62,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [_observableSelection release]; if ([_observationProxies count] > 0) - [NSException - raise: NSInvalidArgumentException - format: - @"NSControllerSelectionProxy still being observed by %@ on %@", - [[_observationProxies objectAtIndex: 0] observer], - [[_observationProxies objectAtIndex: 0] keyPath]]; + [NSException raise: NSInvalidArgumentException + format: @"NSControllerSelectionProxy still being observed " + @"by %@ on %@", + [[_observationProxies objectAtIndex: 0] observer], + [[_observationProxies objectAtIndex: 0] keyPath]]; [_observationProxies release]; [super dealloc]; @@ -79,10 +78,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSArray *selectedObjects = [_controller selectedObjects]; for (id obj in selectedObjects) { [obj addObserver: self - forKeyPath: key - options: NSKeyValueObservingOptionOld | - NSKeyValueObservingOptionNew - context: nil]; + forKeyPath: key + options: NSKeyValueObservingOptionOld | + NSKeyValueObservingOptionNew + context: nil]; } } @@ -109,7 +108,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Get all selected objects property values, swizzling nil values with // the nilMarker NSMutableArray *allValues = - [NSMutableArray arrayWithCapacity: [selectedObjects count]]; + [NSMutableArray arrayWithCapacity: [selectedObjects count]]; id en = [selectedObjects objectEnumerator]; id obj; while ((obj = [en nextObject])) { @@ -192,10 +191,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (id obj in selectedObjects) { for (id key in _cachedKeysForKVO) { [obj addObserver: self - forKeyPath: key - options: NSKeyValueObservingOptionOld | - NSKeyValueObservingOptionNew - context: nil]; + forKeyPath: key + options: NSKeyValueObservingOptionOld | + NSKeyValueObservingOptionNew + context: nil]; } } } @@ -251,7 +250,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Pass the change on up to those observing the proxy if ([[change objectForKey: NSKeyValueChangeNotificationIsPriorKey] - boolValue] == YES) { + boolValue] == YES) { [self willChangeValueForKey: keyPath]; } else { [self didChangeValueForKey: keyPath]; @@ -264,9 +263,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ context: (void *) context { _NSObservationProxy *proxy = - [[_NSObservationProxy alloc] initWithKeyPath: keyPath - observer: observer - object: self]; + [[_NSObservationProxy alloc] initWithKeyPath: keyPath + observer: observer + object: self]; [proxy setNotifyObject: YES]; [_observationProxies addObject: proxy]; @@ -282,9 +281,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ forKeyPath: (NSString *) keyPath { _NSObservationProxy *proxy = - [[_NSObservationProxy alloc] initWithKeyPath: keyPath - observer: observer - object: self]; + [[_NSObservationProxy alloc] initWithKeyPath: keyPath + observer: observer + object: self]; NSInteger idx = [_observationProxies indexOfObject: proxy]; if (idx == NSNotFound) { } @@ -293,8 +292,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (idx != NSNotFound) { [[self observableSelection] - removeObserver: [_observationProxies objectAtIndex: idx] - forKeyPath: keyPath]; + removeObserver: [_observationProxies objectAtIndex: idx] + forKeyPath: keyPath]; [_observationProxies removeObjectAtIndex: idx]; } } diff --git a/AppKit/NSController/NSDictionaryController.m b/AppKit/NSController/NSDictionaryController.m index ff9649b0..3f949717 100644 --- a/AppKit/NSController/NSDictionaryController.m +++ b/AppKit/NSController/NSDictionaryController.m @@ -71,9 +71,10 @@ // NSDictionaryController has a default sort descriptor, NSArrayController // does not [self setSortDescriptors: - [NSArray arrayWithObject: [NSSortDescriptor - sortDescriptorWithKey: @"key" - ascending: YES]]]; + [NSArray arrayWithObject: + [NSSortDescriptor + sortDescriptorWithKey: @"key" + ascending: YES]]]; _initialKey = @"key"; _initialValue = @"value"; return self; @@ -86,9 +87,10 @@ _includedKeys = [[coder decodeObjectForKey: @"NSIncludedKeys"] retain]; _excludedKeys = [[coder decodeObjectForKey: @"NSExcludedKeys"] retain]; [self setSortDescriptors: - [NSArray arrayWithObject: [NSSortDescriptor - sortDescriptorWithKey: @"key" - ascending: YES]]]; + [NSArray arrayWithObject: + [NSSortDescriptor + sortDescriptorWithKey: @"key" + ascending: YES]]]; _initialKey = @"key"; _initialValue = @"value"; @@ -132,7 +134,7 @@ for (id key in [_contentDictionary allKeys]) { if (![_excludedKeys containsObject: key]) { NSDictionaryControllerProxy *proxy = - [NSDictionaryControllerProxy new]; + [NSDictionaryControllerProxy new]; proxy.key = key; proxy.dictionary = _contentDictionary; [contentArray addObject: proxy]; diff --git a/AppKit/NSController/NSObjectController.m b/AppKit/NSController/NSObjectController.m index 1028f591..900121c9 100644 --- a/AppKit/NSController/NSObjectController.m +++ b/AppKit/NSController/NSObjectController.m @@ -33,19 +33,19 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSObjectController + (void) initialize { [self setKeys: [NSArray arrayWithObjects: @"editable", nil] - triggerChangeNotificationsForDependentKey: @"canAdd"]; + triggerChangeNotificationsForDependentKey: @"canAdd"]; [self setKeys: [NSArray arrayWithObjects: @"editable", nil] - triggerChangeNotificationsForDependentKey: @"canInsert"]; + triggerChangeNotificationsForDependentKey: @"canInsert"]; [self setKeys: [NSArray arrayWithObjects: @"editable", @"selection", nil] - triggerChangeNotificationsForDependentKey: @"canRemove"]; + triggerChangeNotificationsForDependentKey: @"canRemove"]; [self setKeys: [NSArray arrayWithObjects: @"content", nil] - triggerChangeNotificationsForDependentKey: @"contentObject"]; + triggerChangeNotificationsForDependentKey: @"contentObject"]; } - (id) init { if ((self = [super init])) { _selection = - [[NSControllerSelectionProxy alloc] initWithController: self]; + [[NSControllerSelectionProxy alloc] initWithController: self]; } return self; } @@ -59,7 +59,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _observedKeys = [[NSCountedSet alloc] init]; _selection = - [[NSControllerSelectionProxy alloc] initWithController: self]; + [[NSControllerSelectionProxy alloc] initWithController: self]; } return self; @@ -69,17 +69,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ((self = [super init])) { _objectClassName = - [[coder decodeObjectForKey: @"NSObjectClassName"] copy]; + [[coder decodeObjectForKey: @"NSObjectClassName"] copy]; if (_objectClassName == nil) _objectClassName = @"NSMutableDictionary"; _editable = [coder decodeBoolForKey: @"NSEditable"]; _automaticallyPreparesContent = - [coder decodeBoolForKey: @"NSAutomaticallyPreparesContent"]; + [coder decodeBoolForKey: @"NSAutomaticallyPreparesContent"]; _observedKeys = [[NSCountedSet alloc] init]; _selection = - [[NSControllerSelectionProxy alloc] initWithController: self]; + [[NSControllerSelectionProxy alloc] initWithController: self]; } return self; } diff --git a/AppKit/NSController/NSObservationProxy.m b/AppKit/NSController/NSObservationProxy.m index 9c535c91..fcff3540 100644 --- a/AppKit/NSController/NSObservationProxy.m +++ b/AppKit/NSController/NSObservationProxy.m @@ -101,8 +101,8 @@ void NSStringKVCSplitOnDot(NSString *self, NSString **before, NSString **after) } - (NSString *) description { - return - [NSString stringWithFormat: @"observation proxy for %@ on key path %@", - _observer, _keyPath]; + return [NSString + stringWithFormat: @"observation proxy for %@ on key path %@", + _observer, _keyPath]; } @end diff --git a/AppKit/NSController/NSUserDefaultsController.m b/AppKit/NSController/NSUserDefaultsController.m index 05e34c4e..0e3ebea8 100644 --- a/AppKit/NSController/NSUserDefaultsController.m +++ b/AppKit/NSController/NSUserDefaultsController.m @@ -38,7 +38,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithDefaults: (NSUserDefaults *) defaults - initialValues: (NSDictionary *) values + initialValues: (NSDictionary *) values { if (defaults == nil) defaults = [NSUserDefaults standardUserDefaults]; @@ -47,7 +47,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _initialValues = [values copy]; _appliesImmediately = YES; _valueProxy = - [[NSUserDefaultsControllerProxy alloc] initWithController: self]; + [[NSUserDefaultsControllerProxy alloc] initWithController: self]; return self; } @@ -99,7 +99,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Be sure to retain the shared object - the caller must be able to // call release on it when done self = [[NSUserDefaultsController sharedUserDefaultsController] - retain]; + retain]; } else { self = [self init]; } diff --git a/AppKit/NSController/NSUserDefaultsControllerProxy.m b/AppKit/NSController/NSUserDefaultsControllerProxy.m index 635c44d7..195c9c5e 100644 --- a/AppKit/NSController/NSUserDefaultsControllerProxy.m +++ b/AppKit/NSController/NSUserDefaultsControllerProxy.m @@ -22,10 +22,10 @@ _controller = controller; _cachedValues = [NSMutableDictionary new]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(userDefaultsDidChange:) - name: NSUserDefaultsDidChangeNotification - object: [_controller defaults]]; + addObserver: self + selector: @selector(userDefaultsDidChange:) + name: NSUserDefaultsDidChangeNotification + object: [_controller defaults]]; } return self; } diff --git a/AppKit/NSController/_NSControllerArray.m b/AppKit/NSController/_NSControllerArray.m index ea810838..0ac733f9 100644 --- a/AppKit/NSController/_NSControllerArray.m +++ b/AppKit/NSController/_NSControllerArray.m @@ -28,10 +28,10 @@ - (void) dealloc { if ([_observationProxies count] > 0) [NSException - raise: NSInvalidArgumentException - format: @"_NSControllerArray still being observed by %@ on %@", - [[_observationProxies objectAtIndex: 0] observer], - [[_observationProxies objectAtIndex: 0] keyPath]]; + raise: NSInvalidArgumentException + format: @"_NSControllerArray still being observed by %@ on %@", + [[_observationProxies objectAtIndex: 0] observer], + [[_observationProxies objectAtIndex: 0] keyPath]]; [_observationProxies release]; [_array release]; @@ -46,9 +46,9 @@ { // init the proxy _NSObservationProxy *proxy = - [[_NSObservationProxy alloc] initWithKeyPath: keyPath - observer: observer - object: self]; + [[_NSObservationProxy alloc] initWithKeyPath: keyPath + observer: observer + object: self]; proxy->_options = options; proxy->_context = context; @@ -61,7 +61,7 @@ idxs = _roi; else idxs = [NSIndexSet - indexSetWithIndexesInRange: NSMakeRange(0, [_array count])]; + indexSetWithIndexesInRange: NSMakeRange(0, [_array count])]; // is this an operator? if ([keyPath hasPrefix: @"@"]) { @@ -78,25 +78,25 @@ // for that path keyPath = rest; idxs = [NSIndexSet - indexSetWithIndexesInRange: NSMakeRange(0, [_array count])]; + indexSetWithIndexesInRange: NSMakeRange(0, [_array count])]; } // add observer proxy for all relevant indexes if ([_array count] && keyPath) { [_array addObserver: proxy - toObjectsAtIndexes: idxs - forKeyPath: keyPath - options: options - context: context]; + toObjectsAtIndexes: idxs + forKeyPath: keyPath + options: options + context: context]; } } - (void) removeObserver: (id) observer forKeyPath: (NSString *) keyPath { // find the proxy again _NSObservationProxy *proxy = - [[_NSObservationProxy alloc] initWithKeyPath: keyPath - observer: observer - object: self]; + [[_NSObservationProxy alloc] initWithKeyPath: keyPath + observer: observer + object: self]; int idx = [_observationProxies indexOfObject: proxy]; [proxy release]; proxy = [[[_observationProxies objectAtIndex: idx] retain] autorelease]; @@ -109,7 +109,7 @@ idxs = _roi; else idxs = [NSIndexSet - indexSetWithIndexesInRange: NSMakeRange(0, [_array count])]; + indexSetWithIndexesInRange: NSMakeRange(0, [_array count])]; // operator? if ([keyPath hasPrefix: @"@"]) { @@ -121,12 +121,12 @@ // remove dependent key path from all children keyPath = rest; idxs = [NSIndexSet - indexSetWithIndexesInRange: NSMakeRange(0, [_array count])]; + indexSetWithIndexesInRange: NSMakeRange(0, [_array count])]; } if ([_array count] && keyPath) { [_array removeObserver: proxy - fromObjectsAtIndexes: idxs - forKeyPath: keyPath]; + fromObjectsAtIndexes: idxs + forKeyPath: keyPath]; } } @@ -144,15 +144,15 @@ // if dependencies: observe these in any case if (rest) [obj addObserver: proxy - forKeyPath: rest - options: [proxy options] - context: [proxy context]]; + forKeyPath: rest + options: [proxy options] + context: [proxy context]]; } else if (!_roi) { // only observe if no ROI [obj addObserver: proxy - forKeyPath: keyPath - options: [proxy options] - context: [proxy context]]; + forKeyPath: keyPath + options: [proxy options] + context: [proxy context]]; } } @@ -222,18 +222,18 @@ [old removeObserver: proxy forKeyPath: [proxy keyPath]]; [obj addObserver: proxy - forKeyPath: rest - options: [proxy options] - context: [proxy context]]; + forKeyPath: rest + options: [proxy options] + context: [proxy context]]; } } else { if (!_roi || [_roi containsIndex: idx]) { [old removeObserver: proxy forKeyPath: [proxy keyPath]]; [obj addObserver: proxy - forKeyPath: [proxy keyPath] - options: [proxy options] - context: [proxy context]]; + forKeyPath: [proxy keyPath] + options: [proxy options] + context: [proxy context]]; } } } @@ -262,9 +262,9 @@ for (_NSObservationProxy *proxy in proxies) { [self addObserver: [proxy observer] - forKeyPath: [proxy keyPath] - options: [proxy options] - context: [proxy context]]; + forKeyPath: [proxy keyPath] + options: [proxy options] + context: [proxy context]]; } [proxies release]; diff --git a/AppKit/NSCursor.m b/AppKit/NSCursor.m index 5fc95c56..0d2203b3 100644 --- a/AppKit/NSCursor.m +++ b/AppKit/NSCursor.m @@ -44,14 +44,14 @@ id NSPlatformCreateCursorImpWithImage(NSImage *image, NSPoint hotSpot) { CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef context = CGBitmapContextCreate( - NULL, width, height, 8, 0, colorSpace, - kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); + NULL, width, height, 8, 0, colorSpace, + kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); CGColorSpaceRelease(colorSpace); NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSGraphicsContext *graphicsContext = - [NSGraphicsContext graphicsContextWithGraphicsPort: context - flipped: NO]; + [NSGraphicsContext graphicsContextWithGraphicsPort: context + flipped: NO]; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext: graphicsContext]; @@ -372,9 +372,9 @@ static NSMutableArray *_cursorStack = nil; } - initWithImage: (NSImage *) image - foregroundColorHint: (NSColor *) foregroundHint - backgroundColorHint: (NSColor *) backgroundHint - hotSpot: (NSPoint) hotSpot + foregroundColorHint: (NSColor *) foregroundHint + backgroundColorHint: (NSColor *) backgroundHint + hotSpot: (NSPoint) hotSpot { // the hints are unused per doc.s return [self initWithImage: image hotSpot: hotSpot]; diff --git a/AppKit/NSDatePickerCell.m b/AppKit/NSDatePickerCell.m index 8e6a7218..08d30823 100644 --- a/AppKit/NSDatePickerCell.m +++ b/AppKit/NSDatePickerCell.m @@ -201,8 +201,8 @@ static void drawRoundedSelection(NSRect rect) { - (NSArray *) _attributedStrings { NSMutableArray *result = [NSMutableArray array]; - NSMutableParagraphStyle *style = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; + NSMutableParagraphStyle *style = [[[NSParagraphStyle defaultParagraphStyle] + mutableCopy] autorelease]; NSMutableDictionary *attributes = [NSMutableDictionary dictionary]; NSMutableDictionary *separatorAttributes; @@ -221,72 +221,76 @@ static void drawRoundedSelection(NSRect rect) { if ((_elements & NSYearMonthDayDatePickerElementFlag) == NSYearMonthDayDatePickerElementFlag) { NSUInteger flags = - NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit; + NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit; NSDateComponents *components = [_calendar components: flags fromDate: [self dateValue]]; NSString *month = - [NSString stringWithFormat: @"%d", [components month]]; + [NSString stringWithFormat: @"%d", [components month]]; NSString *day = [NSString stringWithFormat: @"%d", [components day]]; NSString *year = [NSString stringWithFormat: @"%d", [components year]]; [attributes - setObject: [NSNumber numberWithUnsignedInteger: [components month]] - forKey: @"_value"]; + setObject: [NSNumber numberWithUnsignedInteger: [components + month]] + forKey: @"_value"]; [attributes setObject: [NSNumber numberWithUnsignedInteger: 1] forKey: @"_min"]; [attributes setObject: [NSNumber numberWithUnsignedInteger: 12] forKey: @"_max"]; - [attributes - setObject: [NSNumber numberWithUnsignedInteger: NSMonthCalendarUnit] - forKey: @"_unit"]; + [attributes setObject: [NSNumber numberWithUnsignedInteger: + NSMonthCalendarUnit] + forKey: @"_unit"]; [attributes setObject: [NSNumber numberWithFloat: digitWidth * 2] forKey: @"_width"]; [result addObject: [[[NSAttributedString alloc] - initWithString: month - attributes: attributes] autorelease]]; + initWithString: month + attributes: attributes] autorelease]]; - [result - addObject: [[[NSAttributedString alloc] - initWithString: @"/" - attributes: separatorAttributes] autorelease]]; + [result addObject: [[[NSAttributedString alloc] + initWithString: @"/" + attributes: separatorAttributes] + autorelease]]; [attributes - setObject: [NSNumber numberWithUnsignedInteger: [components day]] - forKey: @"_value"]; + setObject: [NSNumber + numberWithUnsignedInteger: [components day]] + forKey: @"_value"]; [attributes setObject: [NSNumber numberWithUnsignedInteger: 1] forKey: @"_min"]; [attributes setObject: [NSNumber numberWithUnsignedInteger: 31] forKey: @"_max"]; [attributes - setObject: [NSNumber numberWithUnsignedInteger: NSDayCalendarUnit] - forKey: @"_unit"]; + setObject: [NSNumber + numberWithUnsignedInteger: NSDayCalendarUnit] + forKey: @"_unit"]; [attributes setObject: [NSNumber numberWithFloat: digitWidth * 2] forKey: @"_width"]; [result addObject: [[[NSAttributedString alloc] - initWithString: day - attributes: attributes] autorelease]]; + initWithString: day + attributes: attributes] autorelease]]; - [result - addObject: [[[NSAttributedString alloc] - initWithString: @"/" - attributes: separatorAttributes] autorelease]]; + [result addObject: [[[NSAttributedString alloc] + initWithString: @"/" + attributes: separatorAttributes] + autorelease]]; [attributes - setObject: [NSNumber numberWithUnsignedInteger: [components year]] - forKey: @"_value"]; + setObject: [NSNumber + numberWithUnsignedInteger: [components year]] + forKey: @"_value"]; [attributes setObject: [NSNumber numberWithUnsignedInteger: 0] forKey: @"_min"]; [attributes setObject: [NSNumber numberWithUnsignedInteger: 9999] forKey: @"_max"]; - [attributes - setObject: [NSNumber numberWithUnsignedInteger: NSYearCalendarUnit] - forKey: @"_unit"]; + [attributes setObject: [NSNumber numberWithUnsignedInteger: + NSYearCalendarUnit] + forKey: @"_unit"]; [attributes setObject: [NSNumber numberWithFloat: digitWidth * 4] forKey: @"_width"]; [result addObject: [[[NSAttributedString alloc] - initWithString: year - attributes: attributes] autorelease]]; + initWithString: year + attributes: attributes] autorelease]]; } return result; @@ -370,24 +374,24 @@ static void getRectsInFrameForAttributesStrings(NSRect *rects, NSRect frame, NSArray *array = [self _attributedStrings]; NSInteger i, count = [array count]; NSDateComponents *components = - [[[NSDateComponents alloc] init] autorelease]; + [[[NSDateComponents alloc] init] autorelease]; for (i = 0; i < count; i++) { NSAttributedString *string = [array objectAtIndex: i]; NSDictionary *attributes = [string attributesAtIndex: 0 effectiveRange: NULL]; NSUInteger unit = - [[attributes objectForKey: @"_unit"] unsignedIntegerValue]; + [[attributes objectForKey: @"_unit"] unsignedIntegerValue]; if (unit == 0) continue; NSUInteger value = - [[attributes objectForKey: @"_value"] unsignedIntegerValue]; + [[attributes objectForKey: @"_value"] unsignedIntegerValue]; NSUInteger min = - [[attributes objectForKey: @"_min"] unsignedIntegerValue]; + [[attributes objectForKey: @"_min"] unsignedIntegerValue]; NSUInteger max = - [[attributes objectForKey: @"_max"] unsignedIntegerValue]; + [[attributes objectForKey: @"_max"] unsignedIntegerValue]; if (unit == _selectedUnit) { value *= multiply; @@ -444,17 +448,19 @@ static void getRectsInFrameForAttributesStrings(NSRect *rects, NSRect frame, [self drawInteriorWithFrame: frame inView: view]; [[_controlView graphicsStyle] - drawStepperButtonInRect: [self _upArrowFrameForStepperFrame: stepper] - clipRect: stepper - enabled: [self isEnabled] - highlighted: _isUpHighlighted - upNotDown: YES]; + drawStepperButtonInRect: + [self _upArrowFrameForStepperFrame: stepper] + clipRect: stepper + enabled: [self isEnabled] + highlighted: _isUpHighlighted + upNotDown: YES]; [[_controlView graphicsStyle] - drawStepperButtonInRect: [self _downArrowFrameForStepperFrame: stepper] - clipRect: stepper - enabled: [self isEnabled] - highlighted: _isDownHighlighted - upNotDown: NO]; + drawStepperButtonInRect: + [self _downArrowFrameForStepperFrame: stepper] + clipRect: stepper + enabled: [self isEnabled] + highlighted: _isDownHighlighted + upNotDown: NO]; } - (void) selectComponentUnderPoint: (NSPoint) point inView: (NSView *) view { @@ -472,7 +478,7 @@ static void getRectsInFrameForAttributesStrings(NSRect *rects, NSRect frame, NSDictionary *attributes = [string attributesAtIndex: 0 effectiveRange: NULL]; NSUInteger unit = - [[attributes objectForKey: @"_unit"] unsignedIntegerValue]; + [[attributes objectForKey: @"_unit"] unsignedIntegerValue]; if (unit != 0) { _selectedUnit = unit; diff --git a/AppKit/NSDisplay.m b/AppKit/NSDisplay.m index 012e36a7..6c0204b6 100644 --- a/AppKit/NSDisplay.m +++ b/AppKit/NSDisplay.m @@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSDictionary *modifierMapping = @{@"NSModifierFlagMapping" : map}; [[NSUserDefaults standardUserDefaults] - registerDefaults: modifierMapping]; + registerDefaults: modifierMapping]; } } @@ -83,11 +83,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } // None of the backends can be used. - [NSException - raise: NSWindowServerCommunicationException - format: - @"Failed to connect to a window server. Available backends are: %@", - backends]; + [NSException raise: NSWindowServerCommunicationException + format: @"Failed to connect to a window server. Available " + @"backends are: %@", + backends]; [backends release]; return nil; @@ -225,7 +224,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ standard: (NSEventModifierFlags) standard { NSDictionary *modmap = [[NSUserDefaults standardUserDefaults] - dictionaryForKey: @"NSModifierFlagMapping"]; + dictionaryForKey: @"NSModifierFlagMapping"]; NSString *remap = modmap[key]; if ([remap isEqualToString: @"Command"]) @@ -263,7 +262,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (int) runModalPrintPanelWithPrintInfoDictionary: - (NSMutableDictionary *) attributes + (NSMutableDictionary *) attributes { NSInvalidAbstractInvocation(); return 0; @@ -271,7 +270,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (CGContextRef) graphicsPortForPrintOperationWithView: (NSView *) view printInfo: - (NSPrintInfo *) printInfo + (NSPrintInfo *) printInfo pageRange: (NSRange) pageRange { NSInvalidAbstractInvocation(); @@ -283,17 +282,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (int) savePanel: (NSSavePanel *) savePanel - runModalForDirectory: (NSString *) directory - file: (NSString *) file + runModalForDirectory: (NSString *) directory + file: (NSString *) file { NSInvalidAbstractInvocation(); return 0; } - (int) openPanel: (NSOpenPanel *) openPanel - runModalForDirectory: (NSString *) directory - file: (NSString *) file - types: (NSArray *) types + runModalForDirectory: (NSString *) directory + file: (NSString *) file + types: (NSArray *) types { NSInvalidAbstractInvocation(); return 0; @@ -315,14 +314,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (CGRect) insetRect: (CGRect) frame - forNativeWindowBorderWithStyle: (NSUInteger) styleMask + forNativeWindowBorderWithStyle: (NSUInteger) styleMask { NSInvalidAbstractInvocation(); return frame; } - (CGRect) outsetRect: (CGRect) frame - forNativeWindowBorderWithStyle: (NSUInteger) styleMask + forNativeWindowBorderWithStyle: (NSUInteger) styleMask { NSInvalidAbstractInvocation(); return frame; diff --git a/AppKit/NSDocument.m b/AppKit/NSDocument.m index 3bf6a95a..145d31af 100644 --- a/AppKit/NSDocument.m +++ b/AppKit/NSDocument.m @@ -37,13 +37,13 @@ static int untitled_document_number = 0; + (NSArray *) readableTypes { NSArray *knownDocTypes = - [[NSBundle mainBundle] infoDictionary][@"CFBundleDocumentTypes"]; + [[NSBundle mainBundle] infoDictionary][@"CFBundleDocumentTypes"]; NSMutableArray *readableTypes = [NSMutableArray array]; for (NSDictionary *typeDict in knownDocTypes) { NSString *typeRole = typeDict[@"CFBundleTypeRole"]; Class documentClass = - NSClassFromString((NSString *) typeDict[@"NSDocumentClass"]); + NSClassFromString((NSString *) typeDict[@"NSDocumentClass"]); if (documentClass == self && ([typeRole isEqualToString: @"Viewer"] || [typeRole isEqualToString: @"Editor"])) { NSString *typeName = typeDict[@"CFBundleTypeName"]; @@ -57,13 +57,13 @@ static int untitled_document_number = 0; + (NSArray *) writableTypes { NSArray *knownDocTypes = - [[NSBundle mainBundle] infoDictionary][@"CFBundleDocumentTypes"]; + [[NSBundle mainBundle] infoDictionary][@"CFBundleDocumentTypes"]; NSMutableArray *writableTypes = [NSMutableArray array]; for (NSDictionary *typeDict in knownDocTypes) { NSString *typeRole = typeDict[@"CFBundleTypeRole"]; Class documentClass = - NSClassFromString((NSString *) typeDict[@"NSDocumentClass"]); + NSClassFromString((NSString *) typeDict[@"NSDocumentClass"]); if (documentClass == self && [typeRole isEqualToString: @"Editor"]) { NSString *typeName = typeDict[@"CFBundleTypeName"]; if (typeName) @@ -77,13 +77,13 @@ static int untitled_document_number = 0; + (BOOL) isNativeType: (NSString *) type { BOOL result = NO; NSArray *knownDocTypes = - [[NSBundle mainBundle] infoDictionary][@"CFBundleDocumentTypes"]; + [[NSBundle mainBundle] infoDictionary][@"CFBundleDocumentTypes"]; for (NSDictionary *typeDict in knownDocTypes) { NSString *typeRole = typeDict[@"CFBundleTypeRole"]; NSString *typeName = typeDict[@"CFBundleTypeName"]; Class documentClass = - NSClassFromString((NSString *) typeDict[@"NSDocumentClass"]); + NSClassFromString((NSString *) typeDict[@"NSDocumentClass"]); result |= documentClass == self && [typeRole isEqualToString: @"Editor"] && [typeName isEqualToString: type]; @@ -255,17 +255,17 @@ static int untitled_document_number = 0; - (void) setUndoManager: (NSUndoManager *) undoManager { if (_undoManager != nil) { [[NSNotificationCenter defaultCenter] - removeObserver: self - name: NSUndoManagerDidUndoChangeNotification - object: _undoManager]; + removeObserver: self + name: NSUndoManagerDidUndoChangeNotification + object: _undoManager]; [[NSNotificationCenter defaultCenter] - removeObserver: self - name: NSUndoManagerDidRedoChangeNotification - object: _undoManager]; + removeObserver: self + name: NSUndoManagerDidRedoChangeNotification + object: _undoManager]; [[NSNotificationCenter defaultCenter] - removeObserver: self - name: NSUndoManagerWillCloseUndoGroupNotification - object: _undoManager]; + removeObserver: self + name: NSUndoManagerWillCloseUndoGroupNotification + object: _undoManager]; [_undoManager release]; } @@ -274,20 +274,20 @@ static int untitled_document_number = 0; if (undoManager) { // Only add observers if we have an undoManager we're concerned about [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(_undoManagerDidUndoChange:) - name: NSUndoManagerDidUndoChangeNotification - object: _undoManager]; + addObserver: self + selector: @selector(_undoManagerDidUndoChange:) + name: NSUndoManagerDidUndoChangeNotification + object: _undoManager]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(_undoManagerDidRedoChange:) - name: NSUndoManagerDidRedoChangeNotification - object: _undoManager]; + addObserver: self + selector: @selector(_undoManagerDidRedoChange:) + name: NSUndoManagerDidRedoChangeNotification + object: _undoManager]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(_undoManagerDidCloseGroup:) - name: NSUndoManagerWillCloseUndoGroupNotification - object: _undoManager]; + addObserver: self + selector: @selector(_undoManagerDidCloseGroup:) + name: NSUndoManagerWillCloseUndoGroupNotification + object: _undoManager]; } } @@ -339,8 +339,8 @@ static int untitled_document_number = 0; if (nibName != nil) { NSWindowController *controller = [[[NSWindowController alloc] - initWithWindowNibName: nibName - owner: self] autorelease]; + initWithWindowNibName: nibName + owner: self] autorelease]; [self addWindowController: controller]; } @@ -364,16 +364,16 @@ static int untitled_document_number = 0; - (NSString *) displayName { if (_fileURL == nil) { NSString *untitledName = NSLocalizedStringFromTableInBundle( - @"Untitled", nil, [NSBundle bundleForClass: [NSDocument class]], - @"The name of a untitled document"); + @"Untitled", nil, [NSBundle bundleForClass: [NSDocument class]], + @"The name of a untitled document"); if (_untitledNumber != 0) return [NSString - stringWithFormat: @"%@ %d", untitledName, _untitledNumber]; + stringWithFormat: @"%@ %d", untitledName, _untitledNumber]; else return untitledName; } else { - return - [[NSFileManager defaultManager] displayNameAtPath: [_fileURL path]]; + return [[NSFileManager defaultManager] + displayNameAtPath: [_fileURL path]]; } } @@ -455,8 +455,8 @@ static int untitled_document_number = 0; if ([self _isSelectorOverridden: @selector(readFromFile:ofType:)]) { return [self readFromFile: [url path] ofType: type]; } else { - NSFileWrapper *fileWrapper = - [[[NSFileWrapper alloc] initWithPath: [url path]] autorelease]; + NSFileWrapper *fileWrapper = [[[NSFileWrapper alloc] + initWithPath: [url path]] autorelease]; return [self readFromFileWrapper: fileWrapper ofType: type @@ -490,8 +490,8 @@ static int untitled_document_number = 0; - (NSFileWrapper *) fileWrapperOfType: (NSString *) type error: (NSError **) error { - if ([self - _isSelectorOverridden: @selector(fileWrapperRepresentationOfType:)]) + if ([self _isSelectorOverridden: @selector + (fileWrapperRepresentationOfType:)]) return [self fileWrapperRepresentationOfType: type]; else { NSData *data = [self dataOfType: type error: error]; @@ -500,7 +500,7 @@ static int untitled_document_number = 0; return nil; return [[[NSFileWrapper alloc] initRegularFileWithContents: data] - autorelease]; + autorelease]; } } @@ -517,8 +517,8 @@ static int untitled_document_number = 0; return NO; if (![wrapper writeToFile: [url path] - atomically: YES - updateFilenames: YES]) + atomically: YES + updateFilenames: YES]) return NO; return YES; @@ -526,14 +526,14 @@ static int untitled_document_number = 0; } - (BOOL) writeToURL: (NSURL *) url - ofType: (NSString *) type - forSaveOperation: (NSSaveOperationType) operation - originalContentsURL: (NSURL *) contentsURL - error: (NSError **) error + ofType: (NSString *) type + forSaveOperation: (NSSaveOperationType) operation + originalContentsURL: (NSURL *) contentsURL + error: (NSError **) error { BOOL status = NO; if ([self _isSelectorOverridden: @selector - (writeToFile:ofType:originalFile:saveOperation:)]) { + (writeToFile:ofType:originalFile:saveOperation:)]) { status = [self writeToFile: [url path] ofType: type originalFile: [contentsURL path] @@ -545,7 +545,7 @@ static int untitled_document_number = 0; // It's a new file that's been successfully saved to a url... // so note it for the open recent menu [[NSDocumentController sharedDocumentController] - noteNewRecentDocumentURL: url]; + noteNewRecentDocumentURL: url]; } return status; } @@ -556,10 +556,10 @@ static int untitled_document_number = 0; error: (NSError **) error { if (![self writeToURL: url - ofType: type - forSaveOperation: operation - originalContentsURL: url - error: error]) + ofType: type + forSaveOperation: operation + originalContentsURL: url + error: error]) return NO; NSDictionary *attributes = [self fileAttributesToWriteToURL: url @@ -597,10 +597,10 @@ static int untitled_document_number = 0; NSError *error; if (![self writeToURL: [self autosavedContentsFileURL] - ofType: [self autosavingFileType] - forSaveOperation: NSAutosaveOperation - originalContentsURL: [self fileURL] - error: &error]) { + ofType: [self autosavingFileType] + forSaveOperation: NSAutosaveOperation + originalContentsURL: [self fileURL] + error: &error]) { } NSUnimplementedMethod(); @@ -613,21 +613,21 @@ static int untitled_document_number = 0; - (BOOL) presentError: (NSError *) error { return [[NSDocumentController sharedDocumentController] - presentError: [self willPresentError: error]]; + presentError: [self willPresentError: error]]; } - (void) presentError: (NSError *) error - modalForWindow: (NSWindow *) window - delegate: delegate - didPresentSelector: (SEL) selector - contextInfo: (void *) info + modalForWindow: (NSWindow *) window + delegate: delegate + didPresentSelector: (SEL) selector + contextInfo: (void *) info { [[NSDocumentController sharedDocumentController] - presentError: [self willPresentError: error] - modalForWindow: window - delegate: delegate - didPresentSelector: selector - contextInfo: info]; + presentError: [self willPresentError: error] + modalForWindow: window + delegate: delegate + didPresentSelector: selector + contextInfo: info]; } - (NSArray *) writableTypesForSaveOperation: (NSSaveOperationType) operation { @@ -676,7 +676,7 @@ static int untitled_document_number = 0; NSString *extension = [path pathExtension]; if ([extension length] == 0) { extension = [[[NSDocumentController sharedDocumentController] - fileExtensionsFromType: [self fileType]] objectAtIndex: 0]; + fileExtensionsFromType: [self fileType]] objectAtIndex: 0]; } NSSavePanel *savePanel = [NSSavePanel savePanel]; [savePanel setRequiredFileType: extension]; @@ -697,14 +697,14 @@ static int untitled_document_number = 0; if (_fileURL) { // Suggest saving alongside the original file saveResult = [savePanel - runModalForDirectory: [path stringByDeletingLastPathComponent] - file: [path lastPathComponent]]; + runModalForDirectory: [path stringByDeletingLastPathComponent] + file: [path lastPathComponent]]; } else { NSString *directory = [savePanel directory]; if (directory == nil) { // Suggest saving in some reasonable directory directory = [[NSDocumentController sharedDocumentController] - currentDirectory]; + currentDirectory]; } saveResult = [savePanel runModalForDirectory: directory file: [self displayName]]; @@ -713,29 +713,30 @@ static int untitled_document_number = 0; NSString *savePath = [savePanel filename]; NSString *extension = [savePath pathExtension]; NSString *fileType = [[NSDocumentController sharedDocumentController] - typeFromFileExtension: extension]; + typeFromFileExtension: extension]; [[NSUserDefaults standardUserDefaults] - setObject: [savePath stringByDeletingLastPathComponent] - forKey: @"NSNavLastRootDirectory"]; + setObject: [savePath stringByDeletingLastPathComponent] + forKey: @"NSNavLastRootDirectory"]; // Try the various saving methods that can be implemented by the // document subclass if ([self _isSelectorOverridden: @selector - (saveToFile: - saveOperation:delegate:didSaveSelector:contextInfo:)]) { + (saveToFile: + saveOperation:delegate:didSaveSelector:contextInfo + :)]) { [self saveToFile: savePath - saveOperation: operation - delegate: delegate - didSaveSelector: selector - contextInfo: context]; + saveOperation: operation + delegate: delegate + didSaveSelector: selector + contextInfo: context]; } else { [self saveToURL: [savePanel URL] - ofType: fileType - forSaveOperation: operation - delegate: delegate - didSaveSelector: selector - contextInfo: context]; + ofType: fileType + forSaveOperation: operation + delegate: delegate + didSaveSelector: selector + contextInfo: context]; } } else { // User cancelled the save panel... @@ -743,8 +744,8 @@ static int untitled_document_number = 0; // Tell delegate that file couldn't be saved. void (*delegateMethod)(id, SEL, id, BOOL, void *); delegateMethod = - (void (*)(id, SEL, id, BOOL, - void *)) [delegate methodForSelector: selector]; + (void (*)(id, SEL, id, BOOL, + void *)) [delegate methodForSelector: selector]; delegateMethod(delegate, selector, self, NO, context); } } @@ -768,29 +769,32 @@ static int untitled_document_number = 0; NSDictionary *attributes = [fileManager fileAttributesAtPath: path traverseLink: YES]; NSDate *dateModified = - [attributes objectForKey: NSFileModificationDate]; + [attributes objectForKey: NSFileModificationDate]; if (attributes != nil && ![dateModified isEqualToDate: _fileModificationDate]) { int result = NSRunAlertPanel( - [self displayName], - NSLocalizedStringFromTableInBundle( - @"Another user or process has changed this document's file " - @"on disk.\n\nIf you save now, those changes will be lost. " - @"Save anyway?", - nil, [NSBundle bundleForClass: [NSDocument class]], @""), - NSLocalizedStringFromTableInBundle( - @"Don't Save", nil, - [NSBundle bundleForClass: [NSDocument class]], @""), - NSLocalizedStringFromTableInBundle( - @"Save", nil, [NSBundle bundleForClass: [NSDocument class]], - @""), - nil); + [self displayName], + NSLocalizedStringFromTableInBundle( + @"Another user or process has changed this " + @"document's file " + @"on disk.\n\nIf you save now, those changes will " + @"be lost. " + @"Save anyway?", + nil, [NSBundle bundleForClass: [NSDocument class]], + @""), + NSLocalizedStringFromTableInBundle( + @"Don't Save", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"Save", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + nil); if (result == NSAlertDefaultReturn) { // The user canceled the save operation. if ([delegate respondsToSelector: selector]) { void (*delegateMethod)(id, SEL, id, BOOL, void *); delegateMethod = (void (*)(id, SEL, id, BOOL, void *)) - [delegate methodForSelector: selector]; + [delegate methodForSelector: selector]; delegateMethod(delegate, selector, self, NO, info); } return; @@ -798,20 +802,21 @@ static int untitled_document_number = 0; } if ([self _isSelectorOverridden: @selector - (saveToFile: - saveOperation:delegate:didSaveSelector:contextInfo:)]) { + (saveToFile: + saveOperation:delegate:didSaveSelector:contextInfo + :)]) { [self saveToFile: [_fileURL path] - saveOperation: NSSaveOperation - delegate: delegate - didSaveSelector: selector - contextInfo: info]; + saveOperation: NSSaveOperation + delegate: delegate + didSaveSelector: selector + contextInfo: info]; } else { [self saveToURL: _fileURL - ofType: [self fileType] - forSaveOperation: NSSaveOperation - delegate: delegate - didSaveSelector: selector - contextInfo: info]; + ofType: [self fileType] + forSaveOperation: NSSaveOperation + delegate: delegate + didSaveSelector: selector + contextInfo: info]; } } else { [self runModalSavePanelForSaveOperation: NSSaveOperation @@ -822,9 +827,9 @@ static int untitled_document_number = 0; } - (BOOL) saveToURL: (NSURL *) url - ofType: (NSString *) type - forSaveOperation: (NSSaveOperationType) operation - error: (NSError **) error + ofType: (NSString *) type + forSaveOperation: (NSSaveOperationType) operation + error: (NSError **) error { if (url == nil) { return NO; @@ -847,11 +852,11 @@ static int untitled_document_number = 0; } - (void) saveToURL: (NSURL *) url - ofType: (NSString *) type - forSaveOperation: (NSSaveOperationType) operation - delegate: delegate - didSaveSelector: (SEL) selector - contextInfo: (void *) info + ofType: (NSString *) type + forSaveOperation: (NSSaveOperationType) operation + delegate: delegate + didSaveSelector: (SEL) selector + contextInfo: (void *) info { NSError *error = nil; BOOL success = [self saveToURL: url @@ -865,8 +870,9 @@ static int untitled_document_number = 0; if ([delegate respondsToSelector: selector]) { void (*delegateMethod)(id, SEL, id, BOOL, void *); - delegateMethod = (void (*)( - id, SEL, id, BOOL, void *)) [delegate methodForSelector: selector]; + delegateMethod = + (void (*)(id, SEL, id, BOOL, + void *)) [delegate methodForSelector: selector]; delegateMethod(delegate, selector, self, success, info); } } @@ -890,8 +896,9 @@ static int untitled_document_number = 0; if ([delegate respondsToSelector: selector]) { // Tell delegate if the print info was updated. void (*delegateMethod)(id, SEL, id, BOOL, void *); - delegateMethod = (void (*)( - id, SEL, id, BOOL, void *)) [delegate methodForSelector: selector]; + delegateMethod = + (void (*)(id, SEL, id, BOOL, + void *)) [delegate methodForSelector: selector]; delegateMethod(delegate, selector, self, button == NSOKButton, info); } } @@ -961,20 +968,21 @@ static int untitled_document_number = 0; if (fileName == nil) fileName = [self displayName]; int result = NSRunAlertPanel( - [[[NSBundle mainBundle] infoDictionary] - objectForKey: @"CFBundleName"], - NSLocalizedStringFromTableInBundle( - @"Save changes to %@?", nil, - [NSBundle bundleForClass: [NSDocument class]], @""), - NSLocalizedStringFromTableInBundle( - @"Yes", nil, [NSBundle bundleForClass: [NSDocument class]], - @""), - NSLocalizedStringFromTableInBundle( - @"No", nil, [NSBundle bundleForClass: [NSDocument class]], @""), - NSLocalizedStringFromTableInBundle( - @"Cancel", nil, [NSBundle bundleForClass: [NSDocument class]], - @""), - fileName); + [[[NSBundle mainBundle] infoDictionary] + objectForKey: @"CFBundleName"], + NSLocalizedStringFromTableInBundle( + @"Save changes to %@?", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"Yes", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"No", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"Cancel", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + fileName); if (result == NSAlertDefaultReturn) { [self saveDocumentWithDelegate: delegate didSaveSelector: selector @@ -994,8 +1002,9 @@ static int untitled_document_number = 0; if ([delegate respondsToSelector: selector]) { void (*delegateMethod)(id, SEL, id, BOOL, void *); - delegateMethod = (void (*)( - id, SEL, id, BOOL, void *)) [delegate methodForSelector: selector]; + delegateMethod = + (void (*)(id, SEL, id, BOOL, + void *)) [delegate methodForSelector: selector]; delegateMethod(delegate, selector, self, OKToClose, info); } } @@ -1011,23 +1020,27 @@ static int untitled_document_number = 0; contextInfo: info]; } else if ([delegate respondsToSelector: selector]) { void (*delegateMethod)(id, SEL, id, BOOL, void *); - delegateMethod = (void (*)( - id, SEL, id, BOOL, void *)) [delegate methodForSelector: selector]; + delegateMethod = + (void (*)(id, SEL, id, BOOL, + void *)) [delegate methodForSelector: selector]; delegateMethod(delegate, selector, self, YES, info); } } - (void) revertDocumentToSaved: sender { int result = NSRunAlertPanel( - nil, - NSLocalizedStringFromTableInBundle( - @"%@ has been edited. Are you sure you want to undo changes?", nil, - [NSBundle bundleForClass: [NSDocument class]], @""), - NSLocalizedStringFromTableInBundle( - @"Revert", nil, [NSBundle bundleForClass: [NSDocument class]], @""), - NSLocalizedStringFromTableInBundle( - @"Cancel", nil, [NSBundle bundleForClass: [NSDocument class]], @""), - nil, [self displayName]); + nil, + NSLocalizedStringFromTableInBundle( + @"%@ has been edited. Are you sure you want to undo " + @"changes?", + nil, [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"Revert", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"Cancel", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + nil, [self displayName]); if (result == NSAlertDefaultReturn) { for (id editor in [[_activeEditors copy] autorelease]) @@ -1128,7 +1141,7 @@ static int untitled_document_number = 0; } - (NSString *) fileNameFromRunningSavePanelForSaveOperation: - (NSSaveOperationType) operation + (NSSaveOperationType) operation { NSUnimplementedMethod(); return nil; @@ -1140,8 +1153,8 @@ static int untitled_document_number = 0; if (data == nil) return nil; - return - [[[NSFileWrapper alloc] initRegularFileWithContents: data] autorelease]; + return [[[NSFileWrapper alloc] initRegularFileWithContents: data] + autorelease]; } - initWithContentsOfFile: (NSString *) path ofType: (NSString *) type { @@ -1156,13 +1169,14 @@ static int untitled_document_number = 0; error = nil; if (![self readFromURL: url ofType: type error: &error]) { NSRunAlertPanel( - nil, - NSLocalizedStringFromTableInBundle( - @"Can't open file '%@'. Error = %@", nil, - [NSBundle bundleForClass: [NSDocument class]], @""), - NSLocalizedStringFromTableInBundle( - @"OK", nil, [NSBundle bundleForClass: [NSDocument class]], @""), - nil, nil, path, error); + nil, + NSLocalizedStringFromTableInBundle( + @"Can't open file '%@'. Error = %@", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"OK", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + nil, nil, path, error); [self dealloc]; return nil; } @@ -1181,13 +1195,14 @@ static int untitled_document_number = 0; [self setFileType: type]; if (![self readFromURL: url ofType: type error: &error]) { NSRunAlertPanel( - nil, - NSLocalizedStringFromTableInBundle( - @"Can't open file '%@'. Error = %@", nil, - [NSBundle bundleForClass: [NSDocument class]], @""), - NSLocalizedStringFromTableInBundle( - @"OK", nil, [NSBundle bundleForClass: [NSDocument class]], @""), - nil, nil, url, error); + nil, + NSLocalizedStringFromTableInBundle( + @"Can't open file '%@'. Error = %@", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"OK", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + nil, nil, url, error); [self dealloc]; return nil; } @@ -1273,10 +1288,10 @@ static int untitled_document_number = 0; } - (void) saveToFile: (NSString *) path - saveOperation: (NSSaveOperationType) operation - delegate: delegate - didSaveSelector: (SEL) selector - contextInfo: (void *) context + saveOperation: (NSSaveOperationType) operation + delegate: delegate + didSaveSelector: (SEL) selector + contextInfo: (void *) context { if (path != nil) { BOOL success = [self writeWithBackupToFile: path @@ -1292,8 +1307,8 @@ static int untitled_document_number = 0; if ([delegate respondsToSelector: selector]) { void (*delegateMethod)(id, SEL, id, BOOL, void *); delegateMethod = - (void (*)(id, SEL, id, BOOL, - void *)) [delegate methodForSelector: selector]; + (void (*)(id, SEL, id, BOOL, + void *)) [delegate methodForSelector: selector]; delegateMethod(delegate, selector, self, success, context); } } @@ -1321,9 +1336,9 @@ static int untitled_document_number = 0; } - (BOOL) writeToFile: (NSString *) path - ofType: (NSString *) type - originalFile: (NSString *) original - saveOperation: (NSSaveOperationType) operation + ofType: (NSString *) type + originalFile: (NSString *) original + saveOperation: (NSSaveOperationType) operation { NSUnimplementedMethod(); return 0; @@ -1370,22 +1385,23 @@ static int untitled_document_number = 0; - (BOOL) windowShouldClose: sender { if ([[NSUserDefaults standardUserDefaults] boolForKey: @"useSheets"]) { NSBeginAlertSheet( - nil, - NSLocalizedStringFromTableInBundle( - @"Yes", nil, [NSBundle bundleForClass: [NSDocument class]], - @""), - NSLocalizedStringFromTableInBundle( - @"No", nil, [NSBundle bundleForClass: [NSDocument class]], @""), - NSLocalizedStringFromTableInBundle( - @"Cancel", nil, [NSBundle bundleForClass: [NSDocument class]], - @""), - sender, self, - @selector(didEndShouldCloseSheet:returnCode:contextInfo:), NULL, - sender, - NSLocalizedStringFromTableInBundle( - @"Save changes to %@?", nil, - [NSBundle bundleForClass: [NSDocument class]], @""), - [self displayName]); + nil, + NSLocalizedStringFromTableInBundle( + @"Yes", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"No", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"Cancel", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + sender, self, + @selector(didEndShouldCloseSheet:returnCode:contextInfo:), NULL, + sender, + NSLocalizedStringFromTableInBundle( + @"Save changes to %@?", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + [self displayName]); return NO; } else { @@ -1393,20 +1409,20 @@ static int untitled_document_number = 0; return YES; else { int result = NSRunAlertPanel( - nil, - NSLocalizedStringFromTableInBundle( - @"Save changes to %@?", nil, - [NSBundle bundleForClass: [NSDocument class]], @""), - NSLocalizedStringFromTableInBundle( - @"Yes", nil, [NSBundle bundleForClass: [NSDocument class]], - @""), - NSLocalizedStringFromTableInBundle( - @"No", nil, [NSBundle bundleForClass: [NSDocument class]], - @""), - NSLocalizedStringFromTableInBundle( - @"Cancel", nil, - [NSBundle bundleForClass: [NSDocument class]], @""), - [self displayName]); + nil, + NSLocalizedStringFromTableInBundle( + @"Save changes to %@?", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"Yes", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"No", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + NSLocalizedStringFromTableInBundle( + @"Cancel", nil, + [NSBundle bundleForClass: [NSDocument class]], @""), + [self displayName]); switch (result) { case NSAlertDefaultReturn: diff --git a/AppKit/NSDocumentController.m b/AppKit/NSDocumentController.m index c8f36ebf..a95f9041 100644 --- a/AppKit/NSDocumentController.m +++ b/AppKit/NSDocumentController.m @@ -59,7 +59,7 @@ static NSDocumentController *shared = nil; _documents = [NSMutableArray new]; _fileTypes = [[[[NSBundle mainBundle] infoDictionary] - objectForKey: @"CFBundleDocumentTypes"] retain]; + objectForKey: @"CFBundleDocumentTypes"] retain]; _autosavingDelay = 0; return self; } @@ -84,7 +84,7 @@ static NSDocumentController *shared = nil; return nil; return [(NSDictionary *) [_fileTypes objectAtIndex: 0] - objectForKey: @"CFBundleTypeName"]; + objectForKey: @"CFBundleTypeName"]; } - (NSArray *) documentClassNames { @@ -93,7 +93,7 @@ static NSDocumentController *shared = nil; for (i = 0; i < count; i++) [result addObject: [(NSDictionary *) [_fileTypes objectAtIndex: i] - objectForKey: @"NSDocumentClass"]]; + objectForKey: @"NSDocumentClass"]]; return [result allObjects]; } @@ -141,7 +141,7 @@ static NSDocumentController *shared = nil; for (i = 0; i < count; i++) { NSArray *add = [(NSDictionary *) [_fileTypes objectAtIndex: i] - objectForKey: @"CFBundleTypeExtensions"]; + objectForKey: @"CFBundleTypeExtensions"]; [set addObjectsFromArray: add]; } @@ -212,7 +212,7 @@ static NSDocumentController *shared = nil; } NSString *lastOpenPanelDirectory = [[NSUserDefaults standardUserDefaults] - stringForKey: @"NSNavLastRootDirectory"]; + stringForKey: @"NSNavLastRootDirectory"]; if (lastOpenPanelDirectory != nil) return lastOpenPanelDirectory; @@ -268,9 +268,9 @@ static NSDocumentController *shared = nil; } - makeDocumentForURL: (NSURL *) url - withContentsOfURL: (NSURL *) contentsURL - ofType: (NSString *) type - error: (NSError **) error + withContentsOfURL: (NSURL *) contentsURL + ofType: (NSString *) type + error: (NSError **) error { id result; Class class = [self documentClassForType: type]; @@ -308,9 +308,9 @@ static NSDocumentController *shared = nil; if this class is a subclass that has this method overridden. */ IMP mine = [NSDocumentController - instanceMethodForSelector: @selector(makeUntitledDocumentOfType:)]; + instanceMethodForSelector: @selector(makeUntitledDocumentOfType:)]; IMP theirs = - [self methodForSelector: @selector(makeUntitledDocumentOfType:)]; + [self methodForSelector: @selector(makeUntitledDocumentOfType:)]; if (mine != theirs) { return [self makeUntitledDocumentOfType: type]; } @@ -359,7 +359,7 @@ static NSDocumentController *shared = nil; IMP mine = [NSDocumentController instanceMethodForSelector: @selector (openUntitledDocumentOfType:display:)]; IMP theirs = [self - methodForSelector: @selector(openUntitledDocumentOfType:display:)]; + methodForSelector: @selector(openUntitledDocumentOfType:display:)]; if (mine != theirs) { return [self openUntitledDocumentOfType: type display: display]; } @@ -402,8 +402,8 @@ static NSDocumentController *shared = nil; { IMP mine = [NSDocumentController instanceMethodForSelector: @selector (openDocumentWithContentsOfFile:display:)]; - IMP theirs = [self - methodForSelector: @selector(openDocumentWithContentsOfFile:display:)]; + IMP theirs = [self methodForSelector: @selector + (openDocumentWithContentsOfFile:display:)]; if ([url isFileURL] && mine != theirs) return [self openDocumentWithContentsOfFile: [url path] @@ -452,11 +452,11 @@ static NSDocumentController *shared = nil; [document close]; if ([_documents count] > 0) { [[_documents lastObject] - canCloseDocumentWithDelegate: self - shouldCloseSelector: @selector - (_closeDocumentsStartingWith: - shouldClose:closeAllContext:) - contextInfo: context]; + canCloseDocumentWithDelegate: self + shouldCloseSelector: @selector + (_closeDocumentsStartingWith: + shouldClose:closeAllContext:) + contextInfo: context]; return; } } @@ -468,8 +468,9 @@ static NSDocumentController *shared = nil; [context release]; if ([delegate respondsToSelector: selector]) { void (*delegateMethod)(id, SEL, id, BOOL, void *); - delegateMethod = (void (*)( - id, SEL, id, BOOL, void *)) [delegate methodForSelector: selector]; + delegateMethod = + (void (*)(id, SEL, id, BOOL, + void *)) [delegate methodForSelector: selector]; delegateMethod(delegate, selector, self, ([_documents count] == 0), info); } @@ -480,10 +481,10 @@ static NSDocumentController *shared = nil; contextInfo: (void *) info { NSDictionary *closeAllContext = [[NSDictionary alloc] - initWithObjectsAndKeys: delegate, @"delegate", - NSStringFromSelector(selector), @"selector", - [NSValue valueWithPointer: info], - @"contextInfo", nil]; + initWithObjectsAndKeys: delegate, @"delegate", + NSStringFromSelector(selector), @"selector", + [NSValue valueWithPointer: info], + @"contextInfo", nil]; [self _closeDocumentsStartingWith: nil shouldClose: YES closeAllContext: closeAllContext]; @@ -508,16 +509,16 @@ static NSDocumentController *shared = nil; } - (void) presentError: (NSError *) error - modalForWindow: (NSWindow *) window - delegate: delegate - didPresentSelector: (SEL) selector - contextInfo: (void *) info + modalForWindow: (NSWindow *) window + delegate: delegate + didPresentSelector: (SEL) selector + contextInfo: (void *) info { [NSApp presentError: [self willPresentError: error] - modalForWindow: window - delegate: delegate - didPresentSelector: selector - contextInfo: info]; + modalForWindow: window + delegate: delegate + didPresentSelector: selector + contextInfo: info]; } - (int) runModalOpenPanel: (NSOpenPanel *) openPanel @@ -528,8 +529,8 @@ static NSDocumentController *shared = nil; types: extensions]; if (result) [[NSUserDefaults standardUserDefaults] - setObject: [openPanel directory] - forKey: @"NSNavLastRootDirectory"]; + setObject: [openPanel directory] + forKey: @"NSNavLastRootDirectory"]; return result; } @@ -557,8 +558,8 @@ static NSDocumentController *shared = nil; - (NSMutableArray *) _recentDocumentPaths { NSFileManager *fileManager = [NSFileManager defaultManager]; NSMutableArray *paths = [NSMutableArray - arrayWithArray: [[NSUserDefaults standardUserDefaults] - arrayForKey: @"NSRecentDocumentPaths"]]; + arrayWithArray: [[NSUserDefaults standardUserDefaults] + arrayForKey: @"NSRecentDocumentPaths"]]; int i, count = [paths count]; for (i = count - 1; i >= 0; i--) @@ -567,8 +568,8 @@ static NSDocumentController *shared = nil; if ([paths count] != count) [[NSUserDefaults standardUserDefaults] - setObject: paths - forKey: @"NSRecentDocumentPaths"]; + setObject: paths + forKey: @"NSRecentDocumentPaths"]; return paths; } @@ -591,8 +592,8 @@ static NSDocumentController *shared = nil; if ([appDelegate respondsToSelector: @selector(application: openFiles:)]) { [appDelegate - application: NSApp - openFiles: [NSArray arrayWithObject: [url path]]]; + application: NSApp + openFiles: [NSArray arrayWithObject: [url path]]]; } else if ([appDelegate respondsToSelector: @selector (application:openFile:)]) { [appDelegate application: NSApp openFile: [url path]]; @@ -635,12 +636,12 @@ static NSDocumentController *shared = nil; // Shorten entries to the last path component, but not for then-duplicates. for (i = 0; i < count; i++) { NSString *lastPath = - [(NSString *) [array objectAtIndex: i] lastPathComponent]; + [(NSString *) [array objectAtIndex: i] lastPathComponent]; NSInteger occurences = 0; for (j = 0; j < count; j++) { if ([[(NSString *) [array objectAtIndex: j] lastPathComponent] - isEqualToString: lastPath]) + isEqualToString: lastPath]) occurences++; } if (occurences > 1) @@ -651,10 +652,10 @@ static NSDocumentController *shared = nil; while (--count >= 0) { NSString *path = [lastPathArray objectAtIndex: count]; - NSMenuItem *item = - [[[NSMenuItem alloc] initWithTitle: path - action: @selector(_openRecentDocument:) - keyEquivalent: nil] autorelease]; + NSMenuItem *item = [[[NSMenuItem alloc] + initWithTitle: path + action: @selector(_openRecentDocument:) + keyEquivalent: nil] autorelease]; [item setTag: count]; [menu insertItem: item atIndex: 0]; @@ -675,7 +676,7 @@ static NSDocumentController *shared = nil; - (unsigned) maximumRecentDocumentCount { NSString *value = [[NSUserDefaults standardUserDefaults] - stringForKey: @"NSRecentDocumentMaximum"]; + stringForKey: @"NSRecentDocumentMaximum"]; return (value == nil) ? 10 : [value intValue]; } diff --git a/AppKit/NSDrawer.subproj/NSDrawer.m b/AppKit/NSDrawer.subproj/NSDrawer.m index 261325d7..c9434503 100644 --- a/AppKit/NSDrawer.subproj/NSDrawer.m +++ b/AppKit/NSDrawer.subproj/NSDrawer.m @@ -28,7 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSString *const NSDrawerWillOpenNotification = @"NSDrawerWillOpenNotification"; NSString *const NSDrawerDidOpenNotification = @"NSDrawerDidOpenNotification"; NSString *const NSDrawerWillCloseNotification = - @"NSDrawerWillCloseNotification"; + @"NSDrawerWillCloseNotification"; NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; @implementation NSDrawer @@ -53,24 +53,24 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; { NSRect parentFrame = [parentWindow frame]; NSRect parentContentRect = - [parentWindow contentRectForFrameRect: parentFrame]; - NSRect drawerFrame = - [NSWindow frameRectForContentRect: NSMakeRect(0, 0, contentSize.width, - contentSize.height) - styleMask: NSDrawerWindowMask]; + [parentWindow contentRectForFrameRect: parentFrame]; + NSRect drawerFrame = [NSWindow + frameRectForContentRect: NSMakeRect(0, 0, contentSize.width, + contentSize.height) + styleMask: NSDrawerWindowMask]; if (edge == NSMinXEdge || edge == NSMaxXEdge) { drawerFrame.origin.x = parentFrame.origin.x - 12.0; drawerFrame.origin.y = - parentContentRect.origin.y + trailingOffset - 12.0; + parentContentRect.origin.y + trailingOffset - 12.0; drawerFrame.size.height = parentContentRect.size.height - (leadingOffset + trailingOffset) + 9.0; } else { drawerFrame.origin.x = - parentContentRect.origin.x + leadingOffset - 12.0; + parentContentRect.origin.x + leadingOffset - 12.0; drawerFrame.origin.y = parentContentRect.origin.y - 12.0; drawerFrame.size.width = - parentContentRect.size.width - (leadingOffset + trailingOffset); + parentContentRect.size.width - (leadingOffset + trailingOffset); } // Initially I was only computing the open-state frame. Code added to @@ -168,37 +168,36 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; _state = 0; _edge = 0; if ([keyed containsValueForKey: @"NSPreferredEdge"]) - [self - setPreferredEdge: [keyed decodeIntForKey: @"NSPreferredEdge"]]; + [self setPreferredEdge: + [keyed decodeIntForKey: @"NSPreferredEdge"]]; else _preferredEdge = 0; if ([keyed containsValueForKey: @"NSLeadingOffset"]) - [self setLeadingOffset: [keyed - decodeFloatForKey: @"NSLeadingOffset"]]; + [self setLeadingOffset: + [keyed decodeFloatForKey: @"NSLeadingOffset"]]; else _leadingOffset = 0; if ([keyed containsValueForKey: @"NSTrailingOffset"]) - [self - setTrailingOffset: [keyed - decodeFloatForKey: @"NSTrailingOffset"]]; + [self setTrailingOffset: + [keyed decodeFloatForKey: @"NSTrailingOffset"]]; else _trailingOffset = 0; _drawerWindow = [[[NSDrawerWindow alloc] - initWithContentRect: NSMakeRect(0, 0, _contentSize.width, - _contentSize.height) - styleMask: NSDrawerWindowMask - backing: NSBackingStoreBuffered - defer: NO] retain]; + initWithContentRect: NSMakeRect(0, 0, _contentSize.width, + _contentSize.height) + styleMask: NSDrawerWindowMask + backing: NSBackingStoreBuffered + defer: NO] retain]; [_drawerWindow setDrawer: self]; [self setContentSize: _contentSize]; _parentWindow = _nextParentWindow = nil; if ([keyed containsValueForKey: @"NSParentWindow"]) - [self - setParentWindow: [keyed decodeObjectForKey: @"NSParentWindow"]]; + [self setParentWindow: + [keyed decodeObjectForKey: @"NSParentWindow"]]; if ([keyed containsValueForKey: @"NSDelegate"]) [self setDelegate: [keyed decodeObjectForKey: @"NSDelegate"]]; @@ -206,18 +205,16 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; _delegate = nil; if ([keyed containsValueForKey: @"NSMinContentSize"]) { - [self - setMinContentSize: [keyed - decodeSizeForKey: @"NSMinContentSize"]]; + [self setMinContentSize: + [keyed decodeSizeForKey: @"NSMinContentSize"]]; _minContentSize.width += 12.0; _minContentSize.height += 12.0; } else _minContentSize = NSZeroSize; if ([keyed containsValueForKey: @"NSMaxContentSize"]) { - [self - setMaxContentSize: [keyed - decodeSizeForKey: @"NSMaxContentSize"]]; + [self setMaxContentSize: + [keyed decodeSizeForKey: @"NSMaxContentSize"]]; _maxContentSize.width += 12.0; _maxContentSize.height += 12.0; } else @@ -231,11 +228,11 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; preferredEdge: (NSRectEdge) edge { _drawerWindow = [[NSDrawerWindow alloc] - initWithContentRect: NSMakeRect(0, 0, contentSize.width, - contentSize.height) - styleMask: NSDrawerWindowMask - backing: NSBackingStoreBuffered - defer: NO]; + initWithContentRect: NSMakeRect(0, 0, contentSize.width, + contentSize.height) + styleMask: NSDrawerWindowMask + backing: NSBackingStoreBuffered + defer: NO]; [_drawerWindow setDrawer: self]; [self setContentSize: contentSize]; [self setPreferredEdge: edge]; @@ -379,10 +376,10 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; } - (void) open { - [self - openOnEdge: [[self class] visibleEdgeWithPreferredEdge: _preferredEdge - parentWindow: _parentWindow - drawerWindow: _drawerWindow]]; + [self openOnEdge: [[self class] + visibleEdgeWithPreferredEdge: _preferredEdge + parentWindow: _parentWindow + drawerWindow: _drawerWindow]]; } - (void) _resetWindowOrdering: sender { @@ -403,14 +400,14 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; // if we've moved to a different edge, recompute... if (_edge != edge) [self setContentSize: [self drawerWindow: _drawerWindow - constrainSize: [self contentSize] - edge: edge]]; + constrainSize: [self contentSize] + edge: edge]]; _edge = edge; [[NSNotificationCenter defaultCenter] - postNotificationName: NSDrawerWillOpenNotification - object: self]; + postNotificationName: NSDrawerWillOpenNotification + object: self]; frame = [[self class] drawerFrameWithContentSize: [self contentSize] parentWindow: [self parentWindow] @@ -437,10 +434,10 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; [_drawerWindow setFrame: start display: YES animate: NO]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(drawerDidOpen:) - name: NSWindowDidAnimateNotification - object: _drawerWindow]; + addObserver: self + selector: @selector(drawerDidOpen:) + name: NSWindowDidAnimateNotification + object: _drawerWindow]; _state = NSDrawerOpeningState; [self _resetWindowOrdering: nil]; [_drawerWindow setFrame: frame display: YES animate: YES]; @@ -469,14 +466,14 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; edge: _edge]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSDrawerWillCloseNotification - object: self]; + postNotificationName: NSDrawerWillCloseNotification + object: self]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(drawerDidClose:) - name: NSWindowDidAnimateNotification - object: _drawerWindow]; + addObserver: self + selector: @selector(drawerDidClose:) + name: NSWindowDidAnimateNotification + object: _drawerWindow]; _state = NSDrawerClosingState; [_drawerWindow setFrame: frame display: YES animate: YES]; @@ -528,12 +525,12 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; - (void) parentWindowDidChangeFrame: (NSWindow *) window { if (_state == NSDrawerOpenState) { NSRect frame = - [[self class] drawerFrameWithContentSize: [self contentSize] - parentWindow: [self parentWindow] - leadingOffset: _leadingOffset - trailingOffset: _trailingOffset - edge: _edge - state: _state]; + [[self class] drawerFrameWithContentSize: [self contentSize] + parentWindow: [self parentWindow] + leadingOffset: _leadingOffset + trailingOffset: _trailingOffset + edge: _edge + state: _state]; if (_edge == NSMinXEdge || _edge == NSMaxXEdge) { if (frame.size.width > _maxContentSize.width && @@ -620,8 +617,8 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; [[NSNotificationCenter defaultCenter] removeObserver: self]; _state = NSDrawerOpenState; [[NSNotificationCenter defaultCenter] - postNotificationName: NSDrawerDidOpenNotification - object: self]; + postNotificationName: NSDrawerDidOpenNotification + object: self]; } - (void) drawerDidClose: (NSNotification *) nilObject { @@ -629,8 +626,8 @@ NSString *const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; [_drawerWindow orderOut: nil]; _state = NSDrawerClosedState; [[NSNotificationCenter defaultCenter] - postNotificationName: NSDrawerDidCloseNotification - object: self]; + postNotificationName: NSDrawerDidCloseNotification + object: self]; if (_nextParentWindow != nil) [self setNextParentWindow]; diff --git a/AppKit/NSDrawer.subproj/NSDrawerWindow.m b/AppKit/NSDrawer.subproj/NSDrawerWindow.m index 5689a60e..486d7913 100644 --- a/AppKit/NSDrawer.subproj/NSDrawerWindow.m +++ b/AppKit/NSDrawer.subproj/NSDrawerWindow.m @@ -51,7 +51,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // constrain resize size. - (NSSize) platformWindow: (CGWindow *) window - frameSizeWillChange: (NSSize) size + frameSizeWillChange: (NSSize) size { size = [super platformWindow: window frameSizeWillChange: size]; diff --git a/AppKit/NSErrors.m b/AppKit/NSErrors.m index a6cee584..6fd70333 100644 --- a/AppKit/NSErrors.m +++ b/AppKit/NSErrors.m @@ -7,44 +7,44 @@ NSExceptionName NSWordTablesReadException = @"NSWordTablesReadException"; NSExceptionName NSTextReadException = @"NSTextReadException"; NSExceptionName NSTextWriteException = @"NSTextWriteException"; NSExceptionName NSPasteboardCommunicationException = - @"NSPasteboardCommunicationException"; + @"NSPasteboardCommunicationException"; NSExceptionName NSPrintingCommunicationException = - @"NSPrintingCommunicationException"; + @"NSPrintingCommunicationException"; NSExceptionName NSAbortModalException = @"NSAbortModalException"; NSExceptionName NSAbortPrintingException = @"NSAbortPrintingException"; NSExceptionName NSIllegalSelectorException = @"NSIllegalSelectorException"; NSExceptionName NSAppKitVirtualMemoryException = - @"NSAppKitVirtualMemoryException"; + @"NSAppKitVirtualMemoryException"; NSExceptionName NSBadRTFDirectiveException = @"NSBadRTFDirectiveException"; NSExceptionName NSBadRTFFontTableException = @"NSBadRTFFontTableException"; NSExceptionName NSBadRTFStyleSheetException = @"NSBadRTFStyleSheetException"; NSExceptionName NSTypedStreamVersionException = - @"NSTypedStreamVersionException"; + @"NSTypedStreamVersionException"; NSExceptionName NSTIFFException = @"NSTIFFException"; NSExceptionName NSPrintPackageException = @"NSPrintPackageException"; NSExceptionName NSBadRTFColorTableException = @"NSBadRTFColorTableException"; NSExceptionName NSDraggingException = @"NSDraggingException"; NSExceptionName NSColorListIOException = @"NSColorListIOException"; NSExceptionName NSColorListNotEditableException = - @"NSColorListNotEditableException"; + @"NSColorListNotEditableException"; NSExceptionName NSBadBitmapParametersException = - @"NSBadBitmapParametersException"; + @"NSBadBitmapParametersException"; NSExceptionName NSWindowServerCommunicationException = - @"NSWindowServerCommunicationException"; + @"NSWindowServerCommunicationException"; NSExceptionName NSFontUnavailableException = @"NSFontUnavailableException"; NSExceptionName NSPPDIncludeNotFoundException = - @"NSPPDIncludeNotFoundException"; + @"NSPPDIncludeNotFoundException"; NSExceptionName NSPPDParseException = @"NSPPDParseException"; NSExceptionName NSPPDIncludeStackOverflowException = - @"NSPPDIncludeStackOverflowException"; + @"NSPPDIncludeStackOverflowException"; NSExceptionName NSPPDIncludeStackUnderflowException = - @"NSPPDIncludeStackUnderflowException"; + @"NSPPDIncludeStackUnderflowException"; NSExceptionName NSRTFPropertyStackOverflowException = - @"NSRTFPropertyStackOverflowException"; + @"NSRTFPropertyStackOverflowException"; NSExceptionName NSAppKitIgnoredException = @"NSAppKitIgnoredException"; NSExceptionName NSBadComparisonException = @"NSBadComparisonException"; NSExceptionName NSImageCacheException = @"NSImageCacheException"; NSExceptionName NSNibLoadingException = @"NSNibLoadingException"; NSExceptionName NSBrowserIllegalDelegateException = - @"NSBrowserIllegalDelegateException"; + @"NSBrowserIllegalDelegateException"; NSExceptionName NSAccessibilityException = @"NSAccessibilityException"; diff --git a/AppKit/NSEvent.subproj/NSEvent.m b/AppKit/NSEvent.subproj/NSEvent.m index 15a8d42f..ce48cbfb 100644 --- a/AppKit/NSEvent.subproj/NSEvent.m +++ b/AppKit/NSEvent.subproj/NSEvent.m @@ -125,13 +125,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + (instancetype) keyEventWithType: (NSEventType) type - location: (NSPoint) location - modifierFlags: (NSEventModifierFlags) modifierFlags - window: (NSWindow *) window - characters: (NSString *) characters - charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers - isARepeat: (BOOL) isARepeat - keyCode: (unsigned short) keyCode + location: (NSPoint) location + modifierFlags: (NSEventModifierFlags) modifierFlags + window: (NSWindow *) window + characters: (NSString *) characters + charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers + isARepeat: (BOOL) isARepeat + keyCode: (unsigned short) keyCode { return [[[NSEvent_keyboard alloc] initWithType: type location: location @@ -144,26 +144,26 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + (instancetype) keyEventWithType: (NSEventType) type - location: (NSPoint) location - modifierFlags: (NSEventModifierFlags) modifierFlags - timestamp: (NSTimeInterval) timestamp - windowNumber: (NSInteger) windowNumber - context: (NSGraphicsContext *) context - characters: (NSString *) characters - charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers - isARepeat: (BOOL) isARepeat - keyCode: (unsigned short) keyCode + location: (NSPoint) location + modifierFlags: (NSEventModifierFlags) modifierFlags + timestamp: (NSTimeInterval) timestamp + windowNumber: (NSInteger) windowNumber + context: (NSGraphicsContext *) context + characters: (NSString *) characters + charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers + isARepeat: (BOOL) isARepeat + keyCode: (unsigned short) keyCode { return [[[NSEvent_keyboard alloc] - initWithType: type - location: location - modifierFlags: modifierFlags - window: [NSApp - windowWithWindowNumber: windowNumber] - characters: characters - charactersIgnoringModifiers: charactersIgnoringModifiers - isARepeat: isARepeat - keyCode: keyCode] autorelease]; + initWithType: type + location: location + modifierFlags: modifierFlags + window: [NSApp windowWithWindowNumber: + windowNumber] + characters: characters + charactersIgnoringModifiers: charactersIgnoringModifiers + isARepeat: isARepeat + keyCode: keyCode] autorelease]; } + (instancetype) otherEventWithType: (NSEventType) type @@ -241,13 +241,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: @"", - (unsigned long) [self type], - [self locationInWindow].x, [self locationInWindow].y, - [self timestamp], - (unsigned long) [self modifierFlags], [self window], - (unsigned long) [self windowNumber]]; + stringWithFormat: + @"", + (unsigned long) [self type], [self locationInWindow].x, + [self locationInWindow].y, [self timestamp], + (unsigned long) [self modifierFlags], [self window], + (unsigned long) [self windowNumber]]; } static NSTimer *_periodicTimer = nil; diff --git a/AppKit/NSEvent.subproj/NSEvent_CoreGraphics.m b/AppKit/NSEvent.subproj/NSEvent_CoreGraphics.m index a3e53fc2..b0fea344 100644 --- a/AppKit/NSEvent.subproj/NSEvent_CoreGraphics.m +++ b/AppKit/NSEvent.subproj/NSEvent_CoreGraphics.m @@ -23,18 +23,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithCoreGraphicsEvent: (CGEvent *) event window: (NSWindow *) window { [super initWithType: NSPlatformSpecific - location: NSMakePoint(0, 0) - modifierFlags: 0 - window: window]; + location: NSMakePoint(0, 0) + modifierFlags: 0 + window: window]; _coreGraphicsEvent = [event retain]; return self; } - initWithDisplayEvent: (CGEvent *) event { [super initWithType: NSPlatformSpecificDisplayEvent - location: NSMakePoint(0, 0) - modifierFlags: 0 - window: nil]; + location: NSMakePoint(0, 0) + modifierFlags: 0 + window: nil]; _coreGraphicsEvent = [event retain]; return self; } diff --git a/AppKit/NSEvent.subproj/NSEvent_keyboard.h b/AppKit/NSEvent.subproj/NSEvent_keyboard.h index c96722df..7dd80d15 100644 --- a/AppKit/NSEvent.subproj/NSEvent_keyboard.h +++ b/AppKit/NSEvent.subproj/NSEvent_keyboard.h @@ -27,12 +27,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (instancetype) initWithType: (NSEventType) type - location: (NSPoint) location - modifierFlags: (NSEventModifierFlags) flags - window: (NSWindow *) window - characters: (NSString *) characters - charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers - isARepeat: (BOOL) isARepeat - keyCode: (unsigned short) keyCode; + location: (NSPoint) location + modifierFlags: (NSEventModifierFlags) flags + window: (NSWindow *) window + characters: (NSString *) characters + charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers + isARepeat: (BOOL) isARepeat + keyCode: (unsigned short) keyCode; @end diff --git a/AppKit/NSEvent.subproj/NSEvent_keyboard.m b/AppKit/NSEvent.subproj/NSEvent_keyboard.m index 9b218a4e..4e6eb0db 100644 --- a/AppKit/NSEvent.subproj/NSEvent_keyboard.m +++ b/AppKit/NSEvent.subproj/NSEvent_keyboard.m @@ -23,18 +23,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSEvent_keyboard - (instancetype) initWithType: (NSEventType) type - location: (NSPoint) location - modifierFlags: (NSEventModifierFlags) modifierFlags - window: (NSWindow *) window - characters: (NSString *) characters - charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers - isARepeat: (BOOL) isARepeat - keyCode: (unsigned short) keyCode + location: (NSPoint) location + modifierFlags: (NSEventModifierFlags) modifierFlags + window: (NSWindow *) window + characters: (NSString *) characters + charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers + isARepeat: (BOOL) isARepeat + keyCode: (unsigned short) keyCode { [super initWithType: type - location: location - modifierFlags: modifierFlags - window: window]; + location: location + modifierFlags: modifierFlags + window: window]; _characters = [characters copy]; _charactersIgnoringModifiers = [charactersIgnoringModifiers copy]; diff --git a/AppKit/NSEvent.subproj/NSEvent_mouse.m b/AppKit/NSEvent.subproj/NSEvent_mouse.m index af90cebf..31c65aac 100644 --- a/AppKit/NSEvent.subproj/NSEvent_mouse.m +++ b/AppKit/NSEvent.subproj/NSEvent_mouse.m @@ -30,9 +30,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ deltaY: (CGFloat) deltaY { [super initWithType: type - location: location - modifierFlags: modifierFlags - window: window]; + location: location + modifierFlags: modifierFlags + window: window]; _clickCount = clickCount; _deltaX = deltaX; @@ -52,9 +52,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ deltaY: (CGFloat) deltaY { [super initWithType: type - location: location - modifierFlags: modifierFlags - window: window]; + location: location + modifierFlags: modifierFlags + window: window]; _deltaY = deltaY; @@ -93,9 +93,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ pressure: (float) pressure { [super initWithType: type - location: location - modifierFlags: modifierFlags - window: (id) windowNumber]; + location: location + modifierFlags: modifierFlags + window: (id) windowNumber]; _clickCount = clickCount; return self; } diff --git a/AppKit/NSEvent.subproj/NSEvent_other.h b/AppKit/NSEvent.subproj/NSEvent_other.h index c55056e0..16a3fbc7 100644 --- a/AppKit/NSEvent.subproj/NSEvent_other.h +++ b/AppKit/NSEvent.subproj/NSEvent_other.h @@ -26,13 +26,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithType: (NSEventType) type - location: (NSPoint) location - modifierFlags: (NSUInteger) modifierFlags - timestamp: (NSTimeInterval) time - windowNumber: (NSInteger) windowNum - context: (NSGraphicsContext *) context - subtype: (short) subtype - data1: (NSInteger) data1 - data2: (NSInteger) data2; + location: (NSPoint) location + modifierFlags: (NSUInteger) modifierFlags + timestamp: (NSTimeInterval) time + windowNumber: (NSInteger) windowNum + context: (NSGraphicsContext *) context + subtype: (short) subtype + data1: (NSInteger) data1 + data2: (NSInteger) data2; @end diff --git a/AppKit/NSEvent.subproj/NSEvent_other.m b/AppKit/NSEvent.subproj/NSEvent_other.m index 66577bd0..0c6ca767 100644 --- a/AppKit/NSEvent.subproj/NSEvent_other.m +++ b/AppKit/NSEvent.subproj/NSEvent_other.m @@ -21,14 +21,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSEvent_other - initWithType: (NSEventType) type - location: (NSPoint) location - modifierFlags: (NSUInteger) modifierFlags - timestamp: (NSTimeInterval) time - windowNumber: (NSInteger) windowNum - context: (NSGraphicsContext *) context - subtype: (short) subtype - data1: (NSInteger) data1 - data2: (NSInteger) data2 + location: (NSPoint) location + modifierFlags: (NSUInteger) modifierFlags + timestamp: (NSTimeInterval) time + windowNumber: (NSInteger) windowNum + context: (NSGraphicsContext *) context + subtype: (short) subtype + data1: (NSInteger) data1 + data2: (NSInteger) data2 { _type = type; _locationInWindow = location; diff --git a/AppKit/NSEvent_keyboard.h b/AppKit/NSEvent_keyboard.h index c96722df..7dd80d15 100644 --- a/AppKit/NSEvent_keyboard.h +++ b/AppKit/NSEvent_keyboard.h @@ -27,12 +27,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (instancetype) initWithType: (NSEventType) type - location: (NSPoint) location - modifierFlags: (NSEventModifierFlags) flags - window: (NSWindow *) window - characters: (NSString *) characters - charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers - isARepeat: (BOOL) isARepeat - keyCode: (unsigned short) keyCode; + location: (NSPoint) location + modifierFlags: (NSEventModifierFlags) flags + window: (NSWindow *) window + characters: (NSString *) characters + charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers + isARepeat: (BOOL) isARepeat + keyCode: (unsigned short) keyCode; @end diff --git a/AppKit/NSEvent_other.h b/AppKit/NSEvent_other.h index c55056e0..16a3fbc7 100644 --- a/AppKit/NSEvent_other.h +++ b/AppKit/NSEvent_other.h @@ -26,13 +26,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithType: (NSEventType) type - location: (NSPoint) location - modifierFlags: (NSUInteger) modifierFlags - timestamp: (NSTimeInterval) time - windowNumber: (NSInteger) windowNum - context: (NSGraphicsContext *) context - subtype: (short) subtype - data1: (NSInteger) data1 - data2: (NSInteger) data2; + location: (NSPoint) location + modifierFlags: (NSUInteger) modifierFlags + timestamp: (NSTimeInterval) time + windowNumber: (NSInteger) windowNum + context: (NSGraphicsContext *) context + subtype: (short) subtype + data1: (NSInteger) data1 + data2: (NSInteger) data2; @end diff --git a/AppKit/NSFont.m b/AppKit/NSFont.m index d454762e..2137b09a 100644 --- a/AppKit/NSFont.m +++ b/AppKit/NSFont.m @@ -31,9 +31,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSNotificationName NSFontSetChangedNotification = - @"NSFontSetChangedNotification"; + @"NSFontSetChangedNotification"; NSNotificationName NSAntialiasThresholdChangedNotification = - @"NSAntialiasThresholdChangedNotification"; + @"NSAntialiasThresholdChangedNotification"; FOUNDATION_EXPORT char *NSUnicodeToSymbol(const unichar *characters, NSUInteger length, BOOL lossy, @@ -121,8 +121,8 @@ static NSLock *_cacheLock = nil; if (self == [NSFont class]) { _fontCacheCapacity = 4; _fontCacheSize = 0; - _fontCache = - NSZoneMalloc([self zone], sizeof(NSFont *) * _fontCacheCapacity); + _fontCache = NSZoneMalloc([self zone], + sizeof(NSFont *) * _fontCacheCapacity); #ifndef DARLING _nibFontTranslator = [[NSNibFontNameTranslator alloc] init]; #endif @@ -234,9 +234,9 @@ static NSLock *_cacheLock = nil; [ctFont release]; [name release]; } else { - result = [NSFont - fontWithName: [O2Font postscriptNameForDisplayName: fallbackName] - size: size]; + result = [NSFont fontWithName: [O2Font postscriptNameForDisplayName: + fallbackName] + size: size]; } O2FontLog(@"asked for type: %d got font: %@", type, result); return result; @@ -299,15 +299,15 @@ static NSLock *_cacheLock = nil; } + (NSFont *) userFontOfSize: (CGFloat) size { - return [NSFont - fontWithName: [O2Font postscriptNameForDisplayName: @"San Francisco"] - size: (size == 0) ? 12.0 : size]; + return [NSFont fontWithName: [O2Font postscriptNameForDisplayName: + @"San Francisco"] + size: (size == 0) ? 12.0 : size]; } + (NSFont *) userFixedPitchFontOfSize: (CGFloat) size { return [NSFont - fontWithName: [O2Font postscriptNameForDisplayName: @"Courier New"] - size: (size == 0) ? 12.0 : size]; + fontWithName: [O2Font postscriptNameForDisplayName: @"Courier New"] + size: (size == 0) ? 12.0 : size]; } + (void) setUserFont: (NSFont *) value { @@ -330,7 +330,7 @@ static NSLock *_cacheLock = nil; if ([coder allowsKeyedCoding]) { #ifndef DARLING [coder encodeObject: [[NSFont nibFontTranslator] - translateToNibFontName: _name] + translateToNibFontName: _name] forKey: @"NSName"]; #else [coder encodeObject: _name forKey: @"NSName"]; @@ -359,8 +359,8 @@ static NSLock *_cacheLock = nil; // int flags=[keyed decodeIntForKey:@"NSfFlags"]; // ? NSUInteger matrixLen; const uint32_t *matrixBytes = - (const uint32_t *) [keyed decodeBytesForKey: @"NSMatrix" - returnedLength: &matrixLen]; + (const uint32_t *) [keyed decodeBytesForKey: @"NSMatrix" + returnedLength: &matrixLen]; if (matrixLen >= 6 * sizeof(float) && matrixBytes) { for (int i = 0; i < 6; i++) { @@ -522,7 +522,7 @@ static NSLock *_cacheLock = nil; NSFontManager *fontMgr = [NSFontManager sharedFontManager]; NSArray *matchingFonts = - [fontMgr availableMembersOfFontFamily: fontFamily]; + [fontMgr availableMembersOfFontFamily: fontFamily]; if ([matchingFonts count] == 1) { // won't find anything better than this @@ -580,7 +580,8 @@ static NSLock *_cacheLock = nil; - (NSAffineTransform *) textTransform { NSAffineTransform *result = [NSAffineTransform transform]; NSAffineTransformStruct fields = { - _matrix[0], _matrix[1], _matrix[2], _matrix[3], _matrix[4], _matrix[5], + _matrix[0], _matrix[1], _matrix[2], + _matrix[3], _matrix[4], _matrix[5], }; [result setTransformStruct: fields]; @@ -603,16 +604,17 @@ static NSLock *_cacheLock = nil; - (NSString *) familyName { NSString *familyName = - [[NSFontFamily fontFamilyWithTypefaceName: _name] name]; + [[NSFontFamily fontFamilyWithTypefaceName: _name] name]; if (familyName == nil) { NSString *blank = @" "; NSMutableArray *nameComponents = [NSMutableArray - arrayWithArray: [_name componentsSeparatedByString: blank]]; + arrayWithArray: [_name componentsSeparatedByString: blank]]; while ([nameComponents count] > 1 && familyName == nil) { [nameComponents removeLastObject]; familyName = [[NSFontFamily - fontFamilyWithName: [nameComponents - componentsJoinedByString: blank]] name]; + fontFamilyWithName: + [nameComponents componentsJoinedByString: blank]] + name]; } } @@ -632,16 +634,16 @@ static NSLock *_cacheLock = nil; NSFontManager *fm = [NSFontManager sharedFontManager]; NSMutableDictionary *traitsDictionary = - [NSMutableDictionary dictionaryWithCapacity: 4]; + [NSMutableDictionary dictionaryWithCapacity: 4]; NSFontFamily *family = - [NSFontFamily fontFamilyWithTypefaceName: [self fontName]]; + [NSFontFamily fontFamilyWithTypefaceName: [self fontName]]; NSFontTypeface *typeface = [family typefaceWithName: [self fontName]]; NSFontTraitMask symbolicTraits = [typeface traits]; [traitsDictionary setObject: [NSNumber numberWithInt: symbolicTraits] forKey: NSFontSymbolicTrait]; [traitsDictionary - setObject: [NSNumber numberWithInt: [fm weightOfFont: self]] - forKey: NSFontWeightTrait]; + setObject: [NSNumber numberWithInt: [fm weightOfFont: self]] + forKey: NSFontWeightTrait]; // [traitsDictionary setObject: [NSNumber numberWithInt: ??] forKey: // NSFontWidthTrait]; // not sure what's put here [traitsDictionary setObject: [NSNumber numberWithDouble: [self italicAngle]] @@ -652,28 +654,29 @@ static NSLock *_cacheLock = nil; - (NSFontDescriptor *) fontDescriptor { NSFontFamily *fontFamily = - [NSFontFamily fontFamilyWithName: [self familyName]]; + [NSFontFamily fontFamilyWithName: [self familyName]]; NSFontTypeface *typeface = [fontFamily typefaceWithName: [self fontName]]; NSDictionary *attributes = [NSDictionary - dictionaryWithObjectsAndKeys: - [self fontName], NSFontNameAttribute, [self familyName], - NSFontFamilyAttribute, - [[NSNumber numberWithDouble: [self pointSize]] stringValue], - NSFontSizeAttribute, - // [self - // matrix], NSFontMatrixAttribute, - //// currently returns nil - // [self coveredCharacterSet], NSFontCharacterSetAttribute, // - // currently returns nil - [self _fontTraitsAsDictionary], NSFontTraitsAttribute, - [typeface traitName], NSFontFaceAttribute, - [NSNumber numberWithDouble: [self maximumAdvancement].width], - NSFontFixedAdvanceAttribute, [self displayName], - NSFontVisibleNameAttribute, nil]; + dictionaryWithObjectsAndKeys: + [self fontName], NSFontNameAttribute, [self familyName], + NSFontFamilyAttribute, + [[NSNumber numberWithDouble: [self pointSize]] stringValue], + NSFontSizeAttribute, + // [self + // matrix], NSFontMatrixAttribute, + //// currently returns nil + // [self coveredCharacterSet], NSFontCharacterSetAttribute, + // // currently returns nil + [self _fontTraitsAsDictionary], NSFontTraitsAttribute, + [typeface traitName], NSFontFaceAttribute, + [NSNumber + numberWithDouble: [self maximumAdvancement].width], + NSFontFixedAdvanceAttribute, [self displayName], + NSFontVisibleNameAttribute, nil]; NSFontDescriptor *descriptor = - [NSFontDescriptor fontDescriptorWithFontAttributes: attributes]; + [NSFontDescriptor fontDescriptorWithFontAttributes: attributes]; return descriptor; } @@ -885,7 +888,7 @@ static NSLock *_cacheLock = nil; - (NSString *) description { return [NSString - stringWithFormat: @"<%@ %@ %f>", [self class], _name, _pointSize]; + stringWithFormat: @"<%@ %@ %f>", [self class], _name, _pointSize]; } NSInteger NSConvertGlyphsToPackedGlyphs(NSGlyph *glyphs, NSInteger length, diff --git a/AppKit/NSFontDescriptor.m b/AppKit/NSFontDescriptor.m index bf666773..7ddd4ce3 100644 --- a/AppKit/NSFontDescriptor.m +++ b/AppKit/NSFontDescriptor.m @@ -33,7 +33,7 @@ NSString *const NSFontFixedAdvanceAttribute = @"NSFontFixedAdvanceAttribute"; NSString *const NSFontVisibleNameAttribute = @"NSFontVisibleNameAttribute"; NSString *const NSFontCascadeListAttribute = @"NSCTFontCascadeListAttribute"; NSString *const NSFontFeatureSettingsAttribute = - @"NSCTFontFeatureSettingsAttribute"; + @"NSCTFontFeatureSettingsAttribute"; NSString *const NSFontVariationAttribute = @"NSCTFontVariationAttribute"; NSString *const NSFontSymbolicTrait = @"NSFontSymbolicTrait"; @@ -73,28 +73,28 @@ const NSFontWeight NSFontWeightRegular = 0x0000000000000000; + fontDescriptorWithFontAttributes: (NSDictionary *) attributes { return [[[self allocWithZone: NULL] initWithFontAttributes: attributes] - autorelease]; + autorelease]; } + fontDescriptorWithName: (NSString *) name matrix: (NSAffineTransform *) matrix { NSDictionary *attributes = [NSDictionary - dictionaryWithObjectsAndKeys: name, NSFontNameAttribute, matrix, - NSFontMatrixAttribute, nil]; + dictionaryWithObjectsAndKeys: name, NSFontNameAttribute, matrix, + NSFontMatrixAttribute, nil]; return [[[self allocWithZone: NULL] initWithFontAttributes: attributes] - autorelease]; + autorelease]; } + fontDescriptorWithName: (NSString *) name size: (CGFloat) pointSize { NSDictionary *attributes = [NSDictionary - dictionaryWithObjectsAndKeys: name, NSFontNameAttribute, - [[NSNumber numberWithFloat: pointSize] - stringValue], - NSFontSizeAttribute, nil]; + dictionaryWithObjectsAndKeys: name, NSFontNameAttribute, + [[NSNumber numberWithFloat: pointSize] + stringValue], + NSFontSizeAttribute, nil]; return [[[self allocWithZone: NULL] initWithFontAttributes: attributes] - autorelease]; + autorelease]; } - (NSDictionary *) fontAttributes { @@ -115,15 +115,15 @@ const NSFontWeight NSFontWeightRegular = 0x0000000000000000; - (NSFontSymbolicTraits) symbolicTraits { NSDictionary *fontTraits = - [_attributes objectForKey: NSFontTraitsAttribute]; + [_attributes objectForKey: NSFontTraitsAttribute]; return [[fontTraits objectForKey: NSFontSymbolicTrait] unsignedIntValue]; } - (NSFontDescriptor *) fontDescriptorByAddingAttributes: - (NSDictionary *) attributes + (NSDictionary *) attributes { NSMutableDictionary *copy = - [NSMutableDictionary dictionaryWithDictionary: _attributes]; + [NSMutableDictionary dictionaryWithDictionary: _attributes]; [copy addEntriesFromDictionary: attributes]; @@ -132,7 +132,7 @@ const NSFontWeight NSFontWeightRegular = 0x0000000000000000; - (NSFontDescriptor *) fontDescriptorWithFace: (NSString *) face { NSMutableDictionary *copy = - [NSMutableDictionary dictionaryWithDictionary: _attributes]; + [NSMutableDictionary dictionaryWithDictionary: _attributes]; [copy setObject: face forKey: NSFontFaceAttribute]; @@ -141,7 +141,7 @@ const NSFontWeight NSFontWeightRegular = 0x0000000000000000; - (NSFontDescriptor *) fontDescriptorWithFamily: (NSString *) family { NSMutableDictionary *copy = - [NSMutableDictionary dictionaryWithDictionary: _attributes]; + [NSMutableDictionary dictionaryWithDictionary: _attributes]; [copy setObject: family forKey: NSFontFamilyAttribute]; @@ -150,7 +150,7 @@ const NSFontWeight NSFontWeightRegular = 0x0000000000000000; - (NSFontDescriptor *) fontDescriptorWithMatrix: (NSAffineTransform *) matrix { NSMutableDictionary *copy = - [NSMutableDictionary dictionaryWithDictionary: _attributes]; + [NSMutableDictionary dictionaryWithDictionary: _attributes]; [copy setObject: matrix forKey: NSFontMatrixAttribute]; @@ -159,7 +159,7 @@ const NSFontWeight NSFontWeightRegular = 0x0000000000000000; - (NSFontDescriptor *) fontDescriptorWithSize: (CGFloat) pointSize { NSMutableDictionary *copy = - [NSMutableDictionary dictionaryWithDictionary: _attributes]; + [NSMutableDictionary dictionaryWithDictionary: _attributes]; [copy setObject: [NSNumber numberWithFloat: pointSize] forKey: NSFontSizeAttribute]; @@ -168,14 +168,14 @@ const NSFontWeight NSFontWeightRegular = 0x0000000000000000; } - (NSFontDescriptor *) fontDescriptorWithSymbolicTraits: - (NSFontSymbolicTraits) traits + (NSFontSymbolicTraits) traits { NSMutableDictionary *copy = - [NSMutableDictionary dictionaryWithDictionary: _attributes]; + [NSMutableDictionary dictionaryWithDictionary: _attributes]; NSMutableDictionary *traitsCopy = [NSMutableDictionary - dictionaryWithDictionary: [_attributes - objectForKey: NSFontTraitsAttribute]]; + dictionaryWithDictionary: + [_attributes objectForKey: NSFontTraitsAttribute]]; [traitsCopy setObject: [NSNumber numberWithUnsignedInt: traits] forKey: NSFontSymbolicTrait]; [copy setObject: traitsCopy forKey: NSFontTraitsAttribute]; diff --git a/AppKit/NSFontFamily.m b/AppKit/NSFontFamily.m index d5ff1a7f..eb2f73b2 100644 --- a/AppKit/NSFontFamily.m +++ b/AppKit/NSFontFamily.m @@ -62,7 +62,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSFontFamily *family = [[self alloc] initWithName: familyName]; [self addFontFamily: family]; NSArray *typefaces = - [[NSDisplay currentDisplay] fontTypefacesForFamilyName: familyName]; + [[NSDisplay currentDisplay] fontTypefacesForFamilyName: familyName]; [family addTypefaces: typefaces]; return [family autorelease]; } diff --git a/AppKit/NSFontManager.m b/AppKit/NSFontManager.m index 52bf0443..345689e9 100644 --- a/AppKit/NSFontManager.m +++ b/AppKit/NSFontManager.m @@ -130,7 +130,7 @@ static Class _fontPanelFactory; NSArray *families = [NSFontFamily allFontFamilyNames]; if (![_delegate respondsToSelector: @selector(fontManager: - willIncludeFont:)]) + willIncludeFont:)]) return families; else { NSMutableArray *result = [NSMutableArray array]; @@ -139,7 +139,7 @@ static Class _fontPanelFactory; for (i = 0; i < count; i++) { NSString *familyName = [families objectAtIndex: i]; NSFontFamily *family = - [NSFontFamily fontFamilyWithName: familyName]; + [NSFontFamily fontFamilyWithName: familyName]; NSArray *typefaces = [family typefaces]; int t, tcount = [typefaces count]; @@ -170,18 +170,19 @@ static Class _fontPanelFactory; NSString *traitName = [typeface traitName]; // Callers expect an array of four objects - [result - addObject: [NSArray arrayWithObjects: name, traitName, - [NSNumber numberWithInt: 0], - [NSNumber numberWithInt: 0], - nil]]; + [result addObject: [NSArray arrayWithObjects: name, traitName, + [NSNumber + numberWithInt: 0], + [NSNumber + numberWithInt: 0], + nil]]; } return result; } - (NSArray *) availableFontNamesMatchingFontDescriptor: - (NSFontDescriptor *) descriptor + (NSFontDescriptor *) descriptor { NSUnimplementedMethod(); return nil; @@ -247,7 +248,7 @@ static Class _fontPanelFactory; - (NSFontTraitMask) traitsOfFont: (NSFont *) font { NSFontTypeface *typeface = - [NSFontFamily fontTypefaceWithName: [font fontName]]; + [NSFontFamily fontTypefaceWithName: [font fontName]]; return [typeface traits]; } @@ -318,34 +319,38 @@ static Class _fontPanelFactory; if (traits & NSItalicFontMask) { [item setTag: NSUnitalicFontMask]; [item setTitle: NSLocalizedStringFromTableInBundle( - @"Unitalic", nil, - [NSBundle bundleForClass: [NSFontManager + @"Unitalic", nil, + [NSBundle bundleForClass: + [NSFontManager class]], - @"Remove the italic font trait")]; + @"Remove the italic font trait")]; } else { [item setTag: NSItalicFontMask]; [item setTitle: NSLocalizedStringFromTableInBundle( - @"Italic", nil, - [NSBundle bundleForClass: [NSFontManager + @"Italic", nil, + [NSBundle bundleForClass: + [NSFontManager class]], - @"Add the italic font trait")]; + @"Add the italic font trait")]; } } if (tag & (NSBoldFontMask | NSUnboldFontMask)) { if (traits & NSBoldFontMask) { [item setTag: NSUnboldFontMask]; [item setTitle: NSLocalizedStringFromTableInBundle( - @"Unbold", nil, - [NSBundle bundleForClass: [NSFontManager + @"Unbold", nil, + [NSBundle bundleForClass: + [NSFontManager class]], - @"Remove the bold font trait")]; + @"Remove the bold font trait")]; } else { [item setTag: NSBoldFontMask]; [item setTitle: NSLocalizedStringFromTableInBundle( - @"Bold", nil, - [NSBundle bundleForClass: [NSFontManager + @"Bold", nil, + [NSBundle bundleForClass: + [NSFontManager class]], - @"Add the bold font trait")]; + @"Add the bold font trait")]; } } } @@ -427,7 +432,7 @@ static Class _fontPanelFactory; toHaveTrait: (NSFontTraitMask) addTraits { NSFontFamily *family = - [NSFontFamily fontFamilyWithTypefaceName: [font fontName]]; + [NSFontFamily fontFamilyWithTypefaceName: [font fontName]]; NSFontTypeface *typeface = [family typefaceWithName: [font fontName]]; NSFontTraitMask traits = [typeface traits]; @@ -459,7 +464,7 @@ static Class _fontPanelFactory; } NSFontFamily *family = - [NSFontFamily fontFamilyWithTypefaceName: [font fontName]]; + [NSFontFamily fontFamilyWithTypefaceName: [font fontName]]; NSFontTypeface *typeface = [family typefaceWithName: [font fontName]]; NSFontTraitMask traits = [typeface traits]; NSFontTypeface *newface; @@ -526,7 +531,7 @@ static Class _fontPanelFactory; // Get the current traits so we try and match them... NSFontFamily *fontFamily = - [NSFontFamily fontFamilyWithName: [font familyName]]; + [NSFontFamily fontFamilyWithName: [font familyName]]; NSFontTypeface *typeface = [fontFamily typefaceWithName: [font fontName]]; NSFontTraitMask traits = [typeface traits]; return [self fontWithFamily: family diff --git a/AppKit/NSFontMetric.h b/AppKit/NSFontMetric.h index 5284d822..83d2d788 100644 --- a/AppKit/NSFontMetric.h +++ b/AppKit/NSFontMetric.h @@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithSize: (NSSize) size - ascender: (CGFloat) ascender - descender: (CGFloat) descender; + ascender: (CGFloat) ascender + descender: (CGFloat) descender; @end diff --git a/AppKit/NSFontMetric.m b/AppKit/NSFontMetric.m index a4fb00bb..5fe5c9d7 100644 --- a/AppKit/NSFontMetric.m +++ b/AppKit/NSFontMetric.m @@ -23,8 +23,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSFontMetric - initWithSize: (NSSize) size - ascender: (CGFloat) ascender - descender: (CGFloat) descender + ascender: (CGFloat) ascender + descender: (CGFloat) descender { _size = size; _ascender = ascender; diff --git a/AppKit/NSFontPanel.m b/AppKit/NSFontPanel.m index 3fd02761..c208f8a0 100644 --- a/AppKit/NSFontPanel.m +++ b/AppKit/NSFontPanel.m @@ -40,7 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSArray *) availableTraitsInFamily: (NSString *) familyName { NSMutableArray *result = [NSMutableArray array]; NSArray *members = [[NSFontManager sharedFontManager] - availableMembersOfFontFamily: familyName]; + availableMembersOfFontFamily: familyName]; int i, count = [members count]; // (fullName,traitName,size,traits) @@ -131,7 +131,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) selectedFontName { NSArray *members = [[NSFontManager sharedFontManager] - availableMembersOfFontFamily: [self selectedFamilyName]]; + availableMembersOfFontFamily: [self selectedFamilyName]]; int row = [_typefaceMatrix selectedRow]; if (row < 0) @@ -159,7 +159,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ int i, count = [traits count]; int selectRow = 0; NSString *oldTrait = - [[[[_typefaceMatrix selectedCell] stringValue] retain] autorelease]; + [[[[_typefaceMatrix selectedCell] stringValue] retain] autorelease]; [_typefaceMatrix renewRows: count columns: 1]; for (i = 0; i < count; i++) { @@ -194,14 +194,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ CGFloat pointSize = [self selectedPointSize]; [_sampleTextField - setStringValue: [[font displayName] - stringByAppendingFormat: @" %g pt", pointSize]]; + setStringValue: [[font displayName] + stringByAppendingFormat: @" %g pt", + pointSize]]; [_sampleTextField setFont: font]; } - (void) setPanelFont: (NSFont *) font isMultiple: (BOOL) isMultiple { NSFontFamily *family = - [NSFontFamily fontFamilyWithTypefaceName: [font fontName]]; + [NSFontFamily fontFamilyWithTypefaceName: [font fontName]]; NSFontTypeface *typeface = [family typefaceWithName: [font fontName]]; { NSArray *families = [self availableFontFamilies]; NSString *familyName = [family name]; @@ -210,8 +211,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ unsigned traitIndex = [traits indexOfObject: [typeface traitName]]; NSArray *sizes = [self availablePointSizes]; unsigned sizeIndex = [sizes - indexOfObject: [NSString - stringWithFormat: @"%g", [font pointSize]]]; + indexOfObject: [NSString stringWithFormat: @"%g", + [font pointSize]]]; [self buildFamilyMatrix]; [_familyMatrix selectCellAtRow: familyIndex column: 0]; @@ -260,10 +261,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (row >= 0) { [_sizeTextField - setStringValue: [NSString - stringWithFormat: @"%g", - [[sizes objectAtIndex: row] - floatValue]]]; + setStringValue: + [NSString stringWithFormat: @"%g", + [[sizes objectAtIndex: row] + floatValue]]]; } [self buildSampleTextField]; diff --git a/AppKit/NSFontTypeface.h b/AppKit/NSFontTypeface.h index 4811e6c6..bf1b3ff3 100644 --- a/AppKit/NSFontTypeface.h +++ b/AppKit/NSFontTypeface.h @@ -30,12 +30,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithName: (NSString *) name - traitName: (NSString *) traitName - traits: (NSFontTraitMask) traits; + traitName: (NSString *) traitName + traits: (NSFontTraitMask) traits; - initWithName: (NSString *) name - displayName: (NSString *) displayName - traitName: (NSString *) traitName - traits: (NSFontTraitMask) traits; + displayName: (NSString *) displayName + traitName: (NSString *) traitName + traits: (NSFontTraitMask) traits; - (NSString *) name; - (NSString *) displayName; diff --git a/AppKit/NSFontTypeface.m b/AppKit/NSFontTypeface.m index 244d7cad..c0c410f3 100644 --- a/AppKit/NSFontTypeface.m +++ b/AppKit/NSFontTypeface.m @@ -24,9 +24,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSFontTypeface - initWithName: (NSString *) name - displayName: (NSString *) displayName - traitName: (NSString *) traitName - traits: (NSFontTraitMask) traits + displayName: (NSString *) displayName + traitName: (NSString *) traitName + traits: (NSFontTraitMask) traits { _name = [name copy]; _displayName = [displayName copy]; @@ -37,8 +37,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithName: (NSString *) name - traitName: (NSString *) traitName - traits: (NSFontTraitMask) traits + traitName: (NSString *) traitName + traits: (NSFontTraitMask) traits { return [self initWithName: name displayName: name diff --git a/AppKit/NSFormCell.m b/AppKit/NSFormCell.m index b86e8efc..44b1ca10 100644 --- a/AppKit/NSFormCell.m +++ b/AppKit/NSFormCell.m @@ -172,7 +172,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSAttributedString *) attributedStringValue { NSMutableDictionary *attributes = [NSMutableDictionary dictionary]; NSMutableParagraphStyle *paraStyle = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; + [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] + autorelease]; NSFont *font = [self font]; if (font != nil) @@ -189,9 +190,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [paraStyle setAlignment: _textAlignment]; [attributes setObject: paraStyle forKey: NSParagraphStyleAttributeName]; - return - [[[NSAttributedString alloc] initWithString: [self stringValue] - attributes: attributes] autorelease]; + return [[[NSAttributedString alloc] initWithString: [self stringValue] + attributes: attributes] + autorelease]; } - (void) drawInteriorWithFrame: (NSRect) frame inView: (NSView *) control { @@ -203,7 +204,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ titleRect.origin.x = frame.origin.x; titleRect.origin.y = - frame.origin.y + floor((frame.size.height - titleSize.height) / 2); + frame.origin.y + floor((frame.size.height - titleSize.height) / 2); titleRect.size.width = _titleWidth; titleRect.size.height = titleSize.height; diff --git a/AppKit/NSGlyphGenerator.m b/AppKit/NSGlyphGenerator.m index 7c013ac9..2c4fce53 100644 --- a/AppKit/NSGlyphGenerator.m +++ b/AppKit/NSGlyphGenerator.m @@ -62,13 +62,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [string getCharacters: characterChunk range: NSMakeRange(characterIndex, chunkSize)]; [font getGlyphs: glyphChunk - forCharacters: characterChunk - length: chunkSize]; + forCharacters: characterChunk + length: chunkSize]; [glyphStorage insertGlyphs: glyphChunk - length: chunkSize - forStartingGlyphAtIndex: glyphIndex - characterIndex: characterIndex]; + length: chunkSize + forStartingGlyphAtIndex: glyphIndex + characterIndex: characterIndex]; characterIndex += chunkSize; glyphIndex += chunkSize; diff --git a/AppKit/NSGlyphInfo.m b/AppKit/NSGlyphInfo.m index 957e3574..534ce1b3 100644 --- a/AppKit/NSGlyphInfo.m +++ b/AppKit/NSGlyphInfo.m @@ -37,10 +37,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [super dealloc]; } -+ (NSGlyphInfo *) glyphInfoWithCharacterIdentifier: (NSUInteger) identifier - collection: - (NSCharacterCollection) collection - baseString: (NSString *) baseString ++ (NSGlyphInfo *) + glyphInfoWithCharacterIdentifier: (NSUInteger) identifier + collection: (NSCharacterCollection) collection + baseString: (NSString *) baseString { NSUnimplementedMethod(); return nil; diff --git a/AppKit/NSGradient.m b/AppKit/NSGradient.m index 9bda2092..bdac3891 100644 --- a/AppKit/NSGradient.m +++ b/AppKit/NSGradient.m @@ -73,9 +73,9 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) { for (componentIndex = 0; componentIndex < self->_numberOfComponents; componentIndex++) { output[componentIndex] = - (components[startColorIndex][componentIndex] + - (ratio * (components[endColorIndex][componentIndex] - - components[startColorIndex][componentIndex]))); + (components[startColorIndex][componentIndex] + + (ratio * (components[endColorIndex][componentIndex] - + components[startColorIndex][componentIndex]))); } } @@ -83,7 +83,7 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) { endingColor: (NSColor *) endingColor { NSArray *colors = - [NSArray arrayWithObjects: startingColor, endingColor, nil]; + [NSArray arrayWithObjects: startingColor, endingColor, nil]; CGFloat locations[2] = {0.0, 1.0}; return [self initWithColors: colors @@ -129,8 +129,8 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) { } - initWithColors: (NSArray *) colors - atLocations: (const CGFloat *) locations - colorSpace: (NSColorSpace *) colorSpace + atLocations: (const CGFloat *) locations + colorSpace: (NSColorSpace *) colorSpace { _colorSpace = [[NSColorSpace deviceRGBColorSpace] retain]; _numberOfColors = [colors count]; @@ -145,7 +145,7 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) { color = [color colorUsingColorSpaceName: NSDeviceRGBColorSpace]; _components[i] = - NSZoneMalloc(NULL, sizeof(CGFloat) * _numberOfComponents); + NSZoneMalloc(NULL, sizeof(CGFloat) * _numberOfComponents); [color getComponents: _components[i]]; _locations[i] = locations[i]; @@ -174,8 +174,8 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) { { CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; CGFunctionCallbacks callbacks = {0, evaluate, NULL}; - CGFunctionRef function = - CGFunctionCreate(self, 1, NULL, _numberOfComponents, NULL, &callbacks); + CGFunctionRef function = CGFunctionCreate( + self, 1, NULL, _numberOfComponents, NULL, &callbacks); CGColorSpaceRef colorSpace = [_colorSpace CGColorSpace]; CGShadingRef shading = CGShadingCreateAxial(colorSpace, startingPoint, endingPoint, function, NO, NO); @@ -257,7 +257,7 @@ static void evaluate(void *info, CGFloat const *input, CGFloat *output) { } - (void) drawInBezierPath: (NSBezierPath *) path - relativeCenterPosition: (NSPoint) center + relativeCenterPosition: (NSPoint) center { NSUnimplementedMethod(); } diff --git a/AppKit/NSGraphics.m b/AppKit/NSGraphics.m index 2956cb56..32a90824 100644 --- a/AppKit/NSGraphics.m +++ b/AppKit/NSGraphics.m @@ -52,20 +52,20 @@ NSString *const NSDeviceBitsPerSample = @"NSDeviceBitsPerSample"; static inline CGBlendMode blendModeForCompositeOp(NSCompositingOperation op) { static CGBlendMode table[] = { - kCGBlendModeClear, - kCGBlendModeCopy, - kCGBlendModeNormal, - kCGBlendModeSourceIn, - kCGBlendModeSourceOut, - kCGBlendModeSourceAtop, - kCGBlendModeDestinationOver, - kCGBlendModeDestinationIn, - kCGBlendModeDestinationOut, - kCGBlendModeDestinationAtop, - kCGBlendModeXOR, - kCGBlendModePlusDarker, - kCGBlendModeNormal, // FIXME: highlight - kCGBlendModePlusLighter, + kCGBlendModeClear, + kCGBlendModeCopy, + kCGBlendModeNormal, + kCGBlendModeSourceIn, + kCGBlendModeSourceOut, + kCGBlendModeSourceAtop, + kCGBlendModeDestinationOver, + kCGBlendModeDestinationIn, + kCGBlendModeDestinationOut, + kCGBlendModeDestinationAtop, + kCGBlendModeXOR, + kCGBlendModePlusDarker, + kCGBlendModeNormal, // FIXME: highlight + kCGBlendModePlusLighter, }; if (op < NSCompositeClear || op > NSCompositePlusLighter) diff --git a/AppKit/NSGraphicsContext.m b/AppKit/NSGraphicsContext.m index 8e5a143b..bfb23e3a 100644 --- a/AppKit/NSGraphicsContext.m +++ b/AppKit/NSGraphicsContext.m @@ -61,8 +61,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _isDrawingToScreen = CGContextIsBitmapContext(context); _isFlipped = flipped; _deviceDescription = - [[NSDictionary dictionaryWithObject: [NSNumber numberWithBool: NO] - forKey: NSDeviceIsScreen] copy]; + [[NSDictionary dictionaryWithObject: [NSNumber numberWithBool: NO] + forKey: NSDeviceIsScreen] copy]; _shouldAntialias = YES; _renderingIntent = NSColorRenderingIntentDefault; _compOperation = NSCompositeSourceOver; @@ -78,9 +78,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } _graphicsPort = CGBitmapContextCreate( - [imageRep bitmapData], [imageRep pixelsWide], [imageRep pixelsHigh], - [imageRep bitsPerSample], [imageRep bytesPerRow], colorSpace, - [imageRep CGBitmapInfo]); + [imageRep bitmapData], [imageRep pixelsWide], [imageRep pixelsHigh], + [imageRep bitsPerSample], [imageRep bytesPerRow], colorSpace, + [imageRep CGBitmapInfo]); if (_graphicsPort == nil) { [self dealloc]; @@ -91,8 +91,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _isDrawingToScreen = YES; _isFlipped = NO; _deviceDescription = - [[NSDictionary dictionaryWithObject: [NSNumber numberWithBool: YES] - forKey: NSDeviceIsScreen] copy]; + [[NSDictionary dictionaryWithObject: [NSNumber numberWithBool: YES] + forKey: NSDeviceIsScreen] copy]; return self; } @@ -117,7 +117,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + (NSGraphicsContext *) graphicsContextWithBitmapImageRep: - (NSBitmapImageRep *) imageRep + (NSBitmapImageRep *) imageRep { return [[[self alloc] initWithBitmapImageRep: imageRep] autorelease]; } @@ -233,20 +233,20 @@ NSMutableArray *NSCurrentFocusStack() { - (void) setCompositingOperation: (NSCompositingOperation) value { CGBlendMode blendMode[] = { - kCGBlendModeClear, - kCGBlendModeCopy, - kCGBlendModeNormal, - kCGBlendModeSourceIn, - kCGBlendModeSourceOut, - kCGBlendModeSourceAtop, - kCGBlendModeDestinationOver, - kCGBlendModeDestinationIn, - kCGBlendModeDestinationOut, - kCGBlendModeDestinationAtop, - kCGBlendModeXOR, - kCGBlendModePlusDarker, - kCGBlendModeNormal, - kCGBlendModePlusLighter, + kCGBlendModeClear, + kCGBlendModeCopy, + kCGBlendModeNormal, + kCGBlendModeSourceIn, + kCGBlendModeSourceOut, + kCGBlendModeSourceAtop, + kCGBlendModeDestinationOver, + kCGBlendModeDestinationIn, + kCGBlendModeDestinationOut, + kCGBlendModeDestinationAtop, + kCGBlendModeXOR, + kCGBlendModePlusDarker, + kCGBlendModeNormal, + kCGBlendModePlusLighter, }; if (value < NSCompositeClear || value > NSCompositePlusLighter) return; diff --git a/AppKit/NSImage.m b/AppKit/NSImage.m index c1c6c039..5cf0f62e 100644 --- a/AppKit/NSImage.m +++ b/AppKit/NSImage.m @@ -43,16 +43,16 @@ NSImageName const NSImageNameColumnViewTemplate = @"NSColumnViewTemplate"; NSImageName const NSImageNameComputer = @"NSComputer"; NSImageName const NSImageNameDotMac = @"NSDotMac"; NSImageName const NSImageNameEnterFullScreenTemplate = - @"NSEnterFullScreenTemplate"; + @"NSEnterFullScreenTemplate"; NSImageName const NSImageNameEveryone = @"NSEveryone"; NSImageName const NSImageNameExitFullScreenTemplate = - @"NSExitFullScreenTemplate"; + @"NSExitFullScreenTemplate"; NSImageName const NSImageNameFlowViewTemplate = @"NSFlowViewTemplate"; NSImageName const NSImageNameFolder = @"NSFolder"; NSImageName const NSImageNameFolderBurnable = @"NSFolderBurnable"; NSImageName const NSImageNameFolderSmart = @"NSFolderSmart"; NSImageName const NSImageNameFollowLinkFreestandingTemplate = - @"NSFollowLinkFreestandingTemplate"; + @"NSFollowLinkFreestandingTemplate"; NSImageName const NSImageNameFontPanel = @"NSFontPanel"; NSImageName const NSImageNameGoLeftTemplate = @"NSGoLeftTemplate"; NSImageName const NSImageNameGoRightTemplate = @"NSGoRightTemplate"; @@ -61,14 +61,14 @@ NSImageName const NSImageNameIChatTheaterTemplate = @"NSIChatTheaterTemplate"; NSImageName const NSImageNameIconViewTemplate = @"NSIconViewTemplate"; NSImageName const NSImageNameInfo = @"NSInfo"; NSImageName const NSImageNameInvalidDataFreestandingTemplate = - @"NSInvalidDataFreestandingTemplate"; + @"NSInvalidDataFreestandingTemplate"; NSImageName const NSImageNameLeftFacingTriangleTemplate = - @"NSLeftFacingTriangleTemplate"; + @"NSLeftFacingTriangleTemplate"; NSImageName const NSImageNameListViewTemplate = @"NSListViewTemplate"; NSImageName const NSImageNameLockLockedTemplate = @"NSLockLockedTemplate"; NSImageName const NSImageNameLockUnlockedTemplate = @"NSLockUnlockedTemplate"; NSImageName const NSImageNameMenuMixedStateTemplate = - @"NSMenuMixedStateTemplate"; + @"NSMenuMixedStateTemplate"; NSImageName const NSImageNameMenuOnStateTemplate = @"NSMenuOnStateTemplate"; NSImageName const NSImageNameMobileMe = @"NSMobileMe"; NSImageName const NSImageNameMultipleDocuments = @"NSMultipleDocuments"; @@ -77,23 +77,23 @@ NSImageName const NSImageNamePathTemplate = @"NSPathTemplate"; NSImageName const NSImageNamePreferencesGeneral = @"NSPreferencesGeneral"; NSImageName const NSImageNameQuickLookTemplate = @"NSQuickLookTemplate"; NSImageName const NSImageNameRefreshFreestandingTemplate = - @"NSRefreshFreestandingTemplate"; + @"NSRefreshFreestandingTemplate"; NSImageName const NSImageNameRefreshTemplate = @"NSRefreshTemplate"; NSImageName const NSImageNameRemoveTemplate = @"NSRemoveTemplate"; NSImageName const NSImageNameRevealFreestandingTemplate = - @"NSRevealFreestandingTemplate"; + @"NSRevealFreestandingTemplate"; NSImageName const NSImageNameRightFacingTriangleTemplate = - @"NSRightFacingTriangleTemplate"; + @"NSRightFacingTriangleTemplate"; NSImageName const NSImageNameShareTemplate = @"NSShareTemplate"; NSImageName const NSImageNameSlideshowTemplate = @"NSSlideshowTemplate"; NSImageName const NSImageNameSmartBadgeTemplate = @"NSSmartBadgeTemplate"; NSImageName const NSImageNameStatusAvailable = @"NSStatusAvailable"; NSImageName const NSImageNameStatusNone = @"NSStatusNone"; NSImageName const NSImageNameStatusPartiallyAvailable = - @"NSStatusPartiallyAvailable"; + @"NSStatusPartiallyAvailable"; NSImageName const NSImageNameStatusUnavailable = @"NSStatusUnavailable"; NSImageName const NSImageNameStopProgressFreestandingTemplate = - @"NSStopProgressFreestandingTemplate"; + @"NSStopProgressFreestandingTemplate"; NSImageName const NSImageNameStopProgressTemplate = @"NSStopProgressTemplate"; NSImageName const NSImageNameTrashEmpty = @"NSTrashEmpty"; NSImageName const NSImageNameTrashFull = @"NSTrashFull"; @@ -104,11 +104,11 @@ NSImageName const NSImageNameUserGuest = @"NSUserGuest"; NSImageName const NSImageNameGoBackTemplate = @"NSGoBackTemplate"; NSImageName const NSImageNameGoForwardTemplate = @"NSGoForwardTemplate"; NSImageName const NSImageNameTouchBarDeleteTemplate = - @"NSTouchBarDeleteTemplate"; + @"NSTouchBarDeleteTemplate"; NSImageName const NSImageNameTouchBarPauseTemplate = @"NSTouchBarPauseTemplate"; NSImageName const NSImageNameTouchBarPlayTemplate = @"NSTouchBarPlayTemplate"; NSImageName const NSImageNameTouchBarRecordStopTemplate = - @"NSTouchBarRecordStopTemplate"; + @"NSTouchBarRecordStopTemplate"; // Private class used so the context knows the flipped status of a locked image // 10.4 does something like that - probably for more than just getting the @@ -143,7 +143,7 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = for (i = 0; i < count; i++) [result addObjectsFromArray: [[allClasses objectAtIndex: i] - imageUnfilteredFileTypes]]; + imageUnfilteredFileTypes]]; return result; } @@ -159,28 +159,29 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = for (i = 0; i < count; i++) [result addObjectsFromArray: [[allClasses objectAtIndex: i] - imageUnfilteredPasteboardTypes]]; + imageUnfilteredPasteboardTypes]]; return result; } + (BOOL) canInitWithPasteboard: (NSPasteboard *) pasteboard { NSString *available = [pasteboard - availableTypeFromArray: [self imageUnfilteredPasteboardTypes]]; + availableTypeFromArray: [self imageUnfilteredPasteboardTypes]]; return (available != nil) ? YES : NO; } + (NSArray *) _checkBundles { return [NSArray - arrayWithObjects: [NSBundle mainBundle], // Check the main bundle first - // according to the doc - [NSBundle bundleForClass: self], nil]; + arrayWithObjects: [NSBundle + mainBundle], // Check the main bundle + // first according to the doc + [NSBundle bundleForClass: self], nil]; } + (NSMutableDictionary *) allImages { NSMutableDictionary *result = [[[NSThread currentThread] threadDictionary] - objectForKey: @"__allImages"]; + objectForKey: @"__allImages"]; if (result == nil) { result = [NSMutableDictionary dictionary]; @@ -206,7 +207,7 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = if (path != nil) { image = [[[NSImage alloc] initWithContentsOfFile: path] - autorelease]; + autorelease]; [image setName: name]; if (image) { break; @@ -228,8 +229,8 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = NSKeyedUnarchiver *keyed = (NSKeyedUnarchiver *) coder; NSUInteger length; const unsigned char *tiff = - [keyed decodeBytesForKey: @"NSTIFFRepresentation" - returnedLength: &length]; + [keyed decodeBytesForKey: @"NSTIFFRepresentation" + returnedLength: &length]; NSBitmapImageRep *rep; if (tiff == NULL) { @@ -238,7 +239,7 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = } rep = [NSBitmapImageRep - imageRepWithData: [NSData dataWithBytes: tiff length: length]]; + imageRepWithData: [NSData dataWithBytes: tiff length: length]]; if (rep == nil) { [self release]; return nil; @@ -277,8 +278,8 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = withObject: data]; else if ([repClass respondsToSelector: @selector(imageRepWithData:)]) { NSImageRep *rep = - [repClass performSelector: @selector(imageRepWithData:) - withObject: data]; + [repClass performSelector: @selector(imageRepWithData:) + withObject: data]; if (rep != nil) reps = [NSArray arrayWithObject: rep]; @@ -328,8 +329,8 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = - initWithCGImage: (CGImageRef) cgImage size: (NSSize) size; { if (self = [self initWithSize: size]) { - NSBitmapImageRep *rep = - [[[NSBitmapImageRep alloc] initWithCGImage: cgImage] autorelease]; + NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] + initWithCGImage: cgImage] autorelease]; [_representations addObject: rep]; } return self; @@ -337,8 +338,9 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = - initWithPasteboard: (NSPasteboard *) pasteboard { - NSString *available = [pasteboard - availableTypeFromArray: [[self class] imageUnfilteredPasteboardTypes]]; + NSString *available = + [pasteboard availableTypeFromArray: + [[self class] imageUnfilteredPasteboardTypes]]; NSData *data = [pasteboard dataForType: available]; if (data == nil) { [self release]; @@ -556,10 +558,10 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = } NSCachedImageRep *cached = - [[NSCachedImageRep alloc] initWithSize: [self size] - depth: 0 - separate: _isCachedSeparately - alpha: YES]; + [[NSCachedImageRep alloc] initWithSize: [self size] + depth: 0 + separate: _isCachedSeparately + alpha: YES]; [self addRepresentation: cached]; [cached release]; return cached; @@ -580,8 +582,9 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = } - (NSImageRep *) - _bestUncachedFallbackCachedRepresentationForDevice: (NSDictionary *) device - size: (NSSize) size + _bestUncachedFallbackCachedRepresentationForDevice: + (NSDictionary *) device + size: (NSSize) size { int i, count = [_representations count]; NSImageRep *best = nil; @@ -646,7 +649,7 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = if ([device objectForKey: NSDeviceIsScreen] != nil) { NSImageRep *uncached = - [self _bestUncachedRepresentationForDevice: device]; + [self _bestUncachedRepresentationForDevice: device]; NSImageCacheMode caching = _cacheMode; if (caching == NSImageCacheDefault) { @@ -668,13 +671,14 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = case NSImageCacheBySize: if ([[uncached colorSpaceName] - isEqual: [device objectForKey: NSDeviceColorSpaceName]]) { + isEqual: [device objectForKey: + NSDeviceColorSpaceName]]) { NSSize size = [self size]; if ((size.width == [uncached pixelsWide]) && (size.height == [uncached pixelsHigh])) { - int deviceBPS = - [[device objectForKey: NSDeviceBitsPerSample] intValue]; + int deviceBPS = [[device + objectForKey: NSDeviceBitsPerSample] intValue]; if (deviceBPS == [uncached bitsPerSample]) return uncached; @@ -741,7 +745,7 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = NSRect r = {.origin = NSZeroPoint, .size = check.size}; [self lockFocus]; NSBitmapImageRep *image = - [[NSBitmapImageRep alloc] initWithFocusedViewRect: r]; + [[NSBitmapImageRep alloc] initWithFocusedViewRect: r]; [self unlockFocus]; [bitmaps addObject: image]; @@ -749,16 +753,16 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = } else { NSSize size = [check size]; NSBitmapImageRep *image = [[NSBitmapImageRep alloc] - initWithBitmapDataPlanes: NULL - pixelsWide: size.width - pixelsHigh: size.height - bitsPerSample: 8 - samplesPerPixel: 4 - hasAlpha: YES - isPlanar: NO - colorSpaceName: NSDeviceRGBColorSpace - bytesPerRow: 0 - bitsPerPixel: 32]; + initWithBitmapDataPlanes: NULL + pixelsWide: size.width + pixelsHigh: size.height + bitsPerSample: 8 + samplesPerPixel: 4 + hasAlpha: YES + isPlanar: NO + colorSpaceName: NSDeviceRGBColorSpace + bytesPerRow: 0 + bitsPerPixel: 32]; [self lockFocusOnRepresentation: image]; // we should probably use -draw here but not all reps implement it, @@ -811,12 +815,12 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = if ([representation isKindOfClass: [NSCachedImageRep class]]) context = [NSGraphicsContext - graphicsContextWithWindow: [(NSCachedImageRep *) - representation window]]; + graphicsContextWithWindow: [(NSCachedImageRep *) representation + window]]; else if ([representation isKindOfClass: [NSBitmapImageRep class]]) context = [NSGraphicsContext - graphicsContextWithBitmapImageRep: (NSBitmapImageRep *) - representation]; + graphicsContextWithBitmapImageRep: (NSBitmapImageRep *) + representation]; if (context == nil) { [NSException raise: NSInvalidArgumentException @@ -835,7 +839,7 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = // Some fake view, just so the context knows if it's flipped or not NSView *view = [[[NSImageCacheView alloc] initWithFlipped: [self isFlipped]] - autorelease]; + autorelease]; [[context focusStack] addObject: self]; if ([self isFlipped]) { @@ -904,9 +908,9 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = } [self drawInRect: rect - fromRect: source - operation: operation - fraction: fraction]; + fromRect: source + operation: operation + fraction: fraction]; CGContextRestoreGState(context); } @@ -945,9 +949,9 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = NSSize size = [self size]; [self drawInRect: NSMakeRect(point.x, point.y, size.width, size.height) - fromRect: source - operation: operation - fraction: fraction]; + fromRect: source + operation: operation + fraction: fraction]; } - (void) drawInRect: (NSRect) rect @@ -958,15 +962,15 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = // Keep a lid on any intermediate allocations while producing caches NSAutoreleasePool *pool = [NSAutoreleasePool new]; - NSImageRep *any = - [[[self _bestUncachedFallbackCachedRepresentationForDevice: nil - size: rect.size] + NSImageRep *any = [[[self + _bestUncachedFallbackCachedRepresentationForDevice: nil + size: rect.size] retain] autorelease]; NSImageRep *cachedRep = nil; CGContextRef context; NSRect fullRect = {.origin = NSZeroPoint, .size = self.size}; BOOL drawFullImage = - (NSIsEmptyRect(source) || NSEqualRects(source, fullRect)); + (NSIsEmptyRect(source) || NSEqualRects(source, fullRect)); BOOL canCache = drawFullImage && !_isFlipped; if (canCache) { @@ -987,11 +991,11 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = // Create a cached image rep to hold our image NSCachedImageRep *cached = - [[[NSCachedImageRep alloc] initWithSize: cachedSize - depth: 0 - separate: YES - alpha: YES] - autorelease]; // remember that pool we created earlier + [[[NSCachedImageRep alloc] initWithSize: cachedSize + depth: 0 + separate: YES + alpha: YES] + autorelease]; // remember that pool we created earlier // a non-nil object passed here means we need to manually add the rep [self lockFocusOnRepresentation: cached]; @@ -1037,9 +1041,9 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = // fraction uint8_t bytes[1] = {MIN(MAX(0, fraction * 255), 255)}; CGDataProviderRef provider = - CGDataProviderCreateWithData(NULL, bytes, 1, NULL); + CGDataProviderCreateWithData(NULL, bytes, 1, NULL); CGImageRef mask = - CGImageMaskCreate(1, 1, 8, 8, 1, provider, NULL, NO); + CGImageMaskCreate(1, 1, 8, 8, 1, provider, NULL, NO); CGContextClipToMask(context, rect, mask); CGImageRelease(mask); @@ -1060,11 +1064,11 @@ NSImageName const NSImageNameTouchBarRecordStopTemplate = - (NSString *) description { NSSize size = [self size]; - return - [NSString stringWithFormat: - @"<%@[%p] name: %@ size: { %f, %f } representations: %@>", - [self class], self, _name, size.width, size.height, - _representations]; + return [NSString + stringWithFormat: + @"<%@[%p] name: %@ size: { %f, %f } representations: %@>", + [self class], self, _name, size.width, size.height, + _representations]; } @end diff --git a/AppKit/NSImageRep.m b/AppKit/NSImageRep.m index f06a3688..56a1b5a6 100644 --- a/AppKit/NSImageRep.m +++ b/AppKit/NSImageRep.m @@ -91,7 +91,7 @@ static NSMutableArray *_registeredClasses = nil; + (BOOL) canInitWithPasteboard: (NSPasteboard *) pasteboard { NSString *available = [pasteboard - availableTypeFromArray: [self imageUnfilteredPasteboardTypes]]; + availableTypeFromArray: [self imageUnfilteredPasteboardTypes]]; return (available != nil) ? YES : NO; } @@ -345,12 +345,12 @@ static NSMutableArray *_registeredClasses = nil; - (NSString *) description { return [NSString - stringWithFormat: @"<%@[%p] size: { %f, %f } colorSpace: %@ (%dx%d @ " - @"%d bps) alpha: %@ opaque: %@>", - [self class], self, _size.width, _size.height, - _colorSpaceName, _pixelsWide, _pixelsHigh, - _bitsPerSample, _hasAlpha ? @"YES" : @"NO", - _isOpaque ? @"YES" : @"NO"]; + stringWithFormat: + @"<%@[%p] size: { %f, %f } colorSpace: %@ (%dx%d @ " + @"%d bps) alpha: %@ opaque: %@>", + [self class], self, _size.width, _size.height, + _colorSpaceName, _pixelsWide, _pixelsHigh, _bitsPerSample, + _hasAlpha ? @"YES" : @"NO", _isOpaque ? @"YES" : @"NO"]; } @end diff --git a/AppKit/NSImageView.m b/AppKit/NSImageView.m index 722b6078..132f79e8 100644 --- a/AppKit/NSImageView.m +++ b/AppKit/NSImageView.m @@ -101,7 +101,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) setValuePath: (NSString *) path { NSImage *image = - [[[NSImage alloc] initWithContentsOfFile: path] autorelease]; + [[[NSImage alloc] initWithContentsOfFile: path] autorelease]; [_cell setImage: image]; [self setNeedsDisplay: YES]; } diff --git a/AppKit/NSInterfacePart/NSGraphicsStyle.m b/AppKit/NSInterfacePart/NSGraphicsStyle.m index ebc3ab65..c5669ac9 100644 --- a/AppKit/NSInterfacePart/NSGraphicsStyle.m +++ b/AppKit/NSInterfacePart/NSGraphicsStyle.m @@ -39,34 +39,34 @@ static NSDictionary *sScrollerButtonAttributes = nil; if (sNormalMenuTextAttributes == nil) { NSFont *menuFont = [NSFont menuFontOfSize: 0]; sNormalMenuTextAttributes = [[NSDictionary - dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, - [NSColor menuItemTextColor], - NSForegroundColorAttributeName, nil] - retain]; + dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, + [NSColor menuItemTextColor], + NSForegroundColorAttributeName, + nil] retain]; sSelectedMenuTextAttributes = [[NSDictionary - dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, - [NSColor selectedMenuItemTextColor], - NSForegroundColorAttributeName, nil] - retain]; + dictionaryWithObjectsAndKeys: + menuFont, NSFontAttributeName, + [NSColor selectedMenuItemTextColor], + NSForegroundColorAttributeName, nil] retain]; sDimmedMenuTextAttributes = [[NSDictionary - dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, - [NSColor grayColor], - NSForegroundColorAttributeName, nil] - retain]; + dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, + [NSColor grayColor], + NSForegroundColorAttributeName, + nil] retain]; sDimmedMenuTextShadowAttributes = [[NSDictionary - dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, - [NSColor whiteColor], - NSForegroundColorAttributeName, nil] - retain]; + dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, + [NSColor whiteColor], + NSForegroundColorAttributeName, + nil] retain]; sScrollerButtonAttributes = [[NSDictionary - dictionaryWithObjectsAndKeys: [NSFont labelFontOfSize: 8], - NSFontAttributeName, - [NSColor grayColor], - NSForegroundColorAttributeName, nil] - retain]; + dictionaryWithObjectsAndKeys: [NSFont labelFontOfSize: 8], + NSFontAttributeName, + [NSColor grayColor], + NSForegroundColorAttributeName, + nil] retain]; } } @@ -94,7 +94,7 @@ static NSDictionary *sScrollerButtonAttributes = nil; if (sBranchArrow == nil) sBranchArrow = [[NSInterfacePartAttributedString alloc] - initWithMarlettCharacter: 0x34]; + initWithMarlettCharacter: 0x34]; return sBranchArrow; } @@ -103,7 +103,7 @@ static NSDictionary *sScrollerButtonAttributes = nil; if (sCheckMark == nil) sCheckMark = [[NSInterfacePartAttributedString alloc] - initWithMarlettCharacter: 0x61]; + initWithMarlettCharacter: 0x61]; return sCheckMark; } @@ -189,9 +189,9 @@ static NSDictionary *sScrollerButtonAttributes = nil; } - (CGFloat) menuBarHeight { - NSDictionary *attributes = - [NSDictionary dictionaryWithObjectsAndKeys: [NSFont menuFontOfSize: 0], - NSFontAttributeName, nil]; + NSDictionary *attributes = [NSDictionary + dictionaryWithObjectsAndKeys: [NSFont menuFontOfSize: 0], + NSFontAttributeName, nil]; CGFloat result = [@"Menu" sizeWithAttributes: attributes].height; result += 2; // border top/bottom margin @@ -238,7 +238,7 @@ static NSDictionary *sScrollerButtonAttributes = nil; if (enabled) { if (selected) { [string drawInRect: rect - withAttributes: sSelectedMenuTextAttributes]; + withAttributes: sSelectedMenuTextAttributes]; } else { [string drawInRect: rect withAttributes: sNormalMenuTextAttributes]; } @@ -248,7 +248,7 @@ static NSDictionary *sScrollerButtonAttributes = nil; offsetRect.origin.x += 1; offsetRect.origin.y += 1; [string drawInRect: offsetRect - withAttributes: sDimmedMenuTextShadowAttributes]; + withAttributes: sDimmedMenuTextShadowAttributes]; } [string drawInRect: rect withAttributes: sDimmedMenuTextAttributes]; } @@ -277,21 +277,22 @@ static NSDictionary *sScrollerButtonAttributes = nil; if (enabled) { if (!selected) { [mutableString - addAttributes: - [NSDictionary - dictionaryWithObject: [NSColor menuItemTextColor] - forKey: NSForegroundColorAttributeName] - range: range]; + addAttributes: + [NSDictionary + dictionaryWithObject: + [NSColor menuItemTextColor] + forKey: NSForegroundColorAttributeName] + range: range]; } [mutableString drawInRect: rect]; } else { if (!selected) { [mutableString - addAttributes: - [NSDictionary - dictionaryWithObject: [NSColor grayColor] - forKey: NSForegroundColorAttributeName] - range: range]; + addAttributes: + [NSDictionary + dictionaryWithObject: [NSColor grayColor] + forKey: NSForegroundColorAttributeName] + range: range]; NSRect offsetRect = rect; offsetRect.origin.x += 1; offsetRect.origin.y += 1; @@ -315,11 +316,11 @@ static NSDictionary *sScrollerButtonAttributes = nil; else color = [NSColor disabledControlTextColor]; - checkMark = - [[NSInterfacePartAttributedString alloc] initWithCharacter: 0x61 - fontName: @"Marlett" - pointSize: 10 - color: color]; + checkMark = [[NSInterfacePartAttributedString alloc] + initWithCharacter: 0x61 + fontName: @"Marlett" + pointSize: 10 + color: color]; rect.origin.x += margins.left; rect.origin.y += margins.top; @@ -545,8 +546,8 @@ static NSDictionary *sScrollerButtonAttributes = nil; NSRect blockRect = progressRect; int numBlocks; - numBlocks = - (animation * progressRect.size.width) / (BLOCK_WIDTH + BLOCK_SPACING); + numBlocks = (animation * progressRect.size.width) / + (BLOCK_WIDTH + BLOCK_SPACING); if (numBlocks > 0) numBlocks++; @@ -581,7 +582,7 @@ static NSDictionary *sScrollerButtonAttributes = nil; int numBlocks; numBlocks = - (value * progressRect.size.width) / (BLOCK_WIDTH + BLOCK_SPACING); + (value * progressRect.size.width) / (BLOCK_WIDTH + BLOCK_SPACING); if (numBlocks > 0) numBlocks++; @@ -622,11 +623,11 @@ static NSDictionary *sScrollerButtonAttributes = nil; arrow=[[[class alloc] initWithMarlettCharacter:code] autorelease]; */ NSString *arrow = - vertical ? (upOrLeft ? @"â–²" : @"â–¼") : (upOrLeft ? @"â—€" : @"â–¶"); + vertical ? (upOrLeft ? @"â–²" : @"â–¼") : (upOrLeft ? @"â—€" : @"â–¶"); if (!NSIsEmptyRect(rect)) { NSSize arrowSize = - [arrow sizeWithAttributes: sScrollerButtonAttributes]; + [arrow sizeWithAttributes: sScrollerButtonAttributes]; if (pressed) [self drawPushButtonPressedInRect: rect]; @@ -639,7 +640,7 @@ static NSDictionary *sScrollerButtonAttributes = nil; point.x += floor((rect.size.width - arrowSize.width) / 2); point.y += floor((rect.size.height - arrowSize.height) / 2); [arrow drawAtPoint: point - withAttributes: sScrollerButtonAttributes]; + withAttributes: sScrollerButtonAttributes]; } } } @@ -734,10 +735,10 @@ static NSDictionary *sScrollerButtonAttributes = nil; if (enabled) arrow = [[[NSInterfacePartAttributedString alloc] - initWithMarlettCharacter: code] autorelease]; + initWithMarlettCharacter: code] autorelease]; else arrow = [[[NSInterfacePartDisabledAttributedString alloc] - initWithMarlettCharacter: code] autorelease]; + initWithMarlettCharacter: code] autorelease]; if (highlighted) NSDrawWhiteBezel(rect, clipRect); diff --git a/AppKit/NSInterfacePart/NSInterfacePartAttributedString.m b/AppKit/NSInterfacePart/NSInterfacePartAttributedString.m index 59fcfae9..a844578f 100644 --- a/AppKit/NSInterfacePart/NSInterfacePartAttributedString.m +++ b/AppKit/NSInterfacePart/NSInterfacePartAttributedString.m @@ -32,8 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSString *string = [NSString stringWithCharacters: &character length: 1]; NSFont *font = [NSFont fontWithName: fontName size: pointSize]; NSDictionary *attributes = [NSDictionary - dictionaryWithObjectsAndKeys: font, NSFontAttributeName, color, - NSForegroundColorAttributeName, nil]; + dictionaryWithObjectsAndKeys: font, NSFontAttributeName, color, + NSForegroundColorAttributeName, nil]; _attributedString = [[NSAttributedString alloc] initWithString: string attributes: attributes]; diff --git a/AppKit/NSKeyValueBinding.m b/AppKit/NSKeyValueBinding.m index 2ff9105f..d811100c 100644 --- a/AppKit/NSKeyValueBinding.m +++ b/AppKit/NSKeyValueBinding.m @@ -35,7 +35,7 @@ NSString *const NSEnabledBinding = @"enabled"; NSString *const NSHiddenBinding = @"hidden"; NSString *const NSImageBinding = @"image"; NSString *const NSInsertsNullPlaceholderBindingOption = - @"NSInsertsNullPlaceholder"; + @"NSInsertsNullPlaceholder"; NSString *const NSSelectedIndexBinding = @"selectedIndex"; NSString *const NSSelectedObjectBinding = @"selectedObject"; NSString *const NSSelectedObjectsBinding = @"selectedObjects"; @@ -44,7 +44,7 @@ NSString *const NSSelectionIndexesBinding = @"selectionIndexes"; NSString *const NSTitleBinding = @"title"; NSString *const NSValidatesImmediatelyBindingOption = @"NSValidatesImmediately"; NSString *const NSNotApplicablePlaceholderBindingOption = - @"NSNotApplicablePlaceholder"; + @"NSNotApplicablePlaceholder"; NSString *const NSValueBinding = @"value"; NSString *const NSVisibleBinding = @"visible"; NSString *const NSToolTipBinding = @"toolTip"; @@ -52,21 +52,21 @@ NSString *const NSEditableBinding = @"editable"; NSString *const NSNullPlaceholderBindingOption = @"NSNullPlaceholder"; NSString *const NSNoSelectionPlaceholderBindingOption = - @"NSNoSelectionPlaceholder"; + @"NSNoSelectionPlaceholder"; NSString *const NSMultipleValuesPlaceholderBindingOption = - @"NSMultipleValuesPlaceholder"; + @"NSMultipleValuesPlaceholder"; NSString *const NSCreatesSortDescriptorBindingOption = - @"NSCreatesSortDescriptors"; + @"NSCreatesSortDescriptors"; NSString *const NSRaisesForNotApplicableKeysBindingOption = - @"NSRaisesForNotApplicableKeys"; + @"NSRaisesForNotApplicableKeys"; NSString *const NSAllowsEditingMultipleValuesSelectionBindingOption = - @"NSAllowsEditingMultipleValuesSelection"; + @"NSAllowsEditingMultipleValuesSelection"; NSString *const NSValueTransformerNameBindingOption = @"NSValueTransformerName"; NSString *const NSValueTransformerBindingOption = @"NSValueTransformerBinding"; NSString *const NSConditionallySetsEnabledBindingOption = - @"NSConditionallySetsEnabled"; + @"NSConditionallySetsEnabled"; NSString *const NSConditionallySetsEditableBindingOption = - @"NSConditionallySetsEditable"; + @"NSConditionallySetsEditable"; NSString *const NSContinuouslyUpdatesValueBindingOption = - @"NSContinuouslyUpdatesValue"; + @"NSContinuouslyUpdatesValue"; NSString *const NSDisplayPatternBindingOption = @"NSDisplayPattern"; diff --git a/AppKit/NSKeyValueBinding/NSBinder.m b/AppKit/NSKeyValueBinding/NSBinder.m index 58da0132..08314d8d 100644 --- a/AppKit/NSKeyValueBinding/NSBinder.m +++ b/AppKit/NSKeyValueBinding/NSBinder.m @@ -33,35 +33,35 @@ static void *NSBinderChangeContext; @implementation _NSBinder (BindingOptions) - (BOOL) conditionallySetsEditable { return [[_options objectForKey: NSConditionallySetsEditableBindingOption] - boolValue] && + boolValue] && [_source respondsToSelector: @selector(setEditable:)]; } - (BOOL) conditionallySetsEnabled { return [[_options objectForKey: NSConditionallySetsEnabledBindingOption] - boolValue] && + boolValue] && [_source respondsToSelector: @selector(setEnabled:)]; } - (BOOL) allowsEditingMultipleValues { return [[_options - objectForKey: NSAllowsEditingMultipleValuesSelectionBindingOption] - boolValue]; + objectForKey: NSAllowsEditingMultipleValuesSelectionBindingOption] + boolValue]; } - (BOOL) createsSortDescriptor { return [[_options objectForKey: NSCreatesSortDescriptorBindingOption] - boolValue]; + boolValue]; } - (BOOL) raisesForNotApplicableKeys { return [[_options objectForKey: NSRaisesForNotApplicableKeysBindingOption] - boolValue]; + boolValue]; } - (BOOL) continuouslyUpdatesValue { return [[_options objectForKey: NSContinuouslyUpdatesValueBindingOption] - boolValue]; + boolValue]; } - (id) multipleValuesPlaceholder { @@ -93,7 +93,7 @@ static void *NSBinderChangeContext; if (result == nil) { NSString *name = - [_options objectForKey: NSValueTransformerNameBindingOption]; + [_options objectForKey: NSValueTransformerNameBindingOption]; if (name == nil) return nil; @@ -101,11 +101,11 @@ static void *NSBinderChangeContext; result = [NSValueTransformer valueTransformerForName: name]; if (result == nil) { - NSBindingDebugLog( - kNSBindingDebugLogLevel1, - @"[NSValueTransformer valueTransformerForName:%@] failed in " - @"NSBinder.m", - name); + NSBindingDebugLog(kNSBindingDebugLogLevel1, + @"[NSValueTransformer " + @"valueTransformerForName:%@] failed in " + @"NSBinder.m", + name); } if (result != nil) @@ -151,8 +151,8 @@ static void *NSBinderChangeContext; - (void) setSource: (id) value { if (_source != value) { _source = value; - [self - setBindingPath: [_source _replacementKeyPathForBinding: _binding]]; + [self setBindingPath: [_source + _replacementKeyPathForBinding: _binding]]; } } @@ -185,8 +185,8 @@ static void *NSBinderChangeContext; if (_binding != value) { [_binding release]; _binding = [value copy]; - [self - setBindingPath: [_source _replacementKeyPathForBinding: _binding]]; + [self setBindingPath: [_source + _replacementKeyPathForBinding: _binding]]; } } @@ -207,7 +207,7 @@ static void *NSBinderChangeContext; _options = [value mutableCopy]; else _options = - [[self defaultBindingOptionsForBinding: _binding] mutableCopy]; + [[self defaultBindingOptionsForBinding: _binding] mutableCopy]; } - (id) bindingPath { @@ -241,9 +241,9 @@ static void *NSBinderChangeContext; { NSBindingDebugLog( - kNSBindingDebugLogLevel1, - @"keyPath: %@\n object: %@\n change: %@\n context: %p", kp, - object, change, context); + kNSBindingDebugLogLevel1, + @"keyPath: %@\n object: %@\n change: %@\n context: %p", kp, + object, change, context); if ([self allowsReverseTransformation]) { if (context == &NSBinderChangeContext) { @@ -256,8 +256,8 @@ static void *NSBinderChangeContext; NSBindingDebugLog(kNSBindingDebugLogLevel2, @"new value %@", [_source valueForKeyPath: _bindingPath]); NSBindingDebugLog( - kNSBindingDebugLogLevel2, @"DST setting %@, for %@", - [_source valueForKeyPath: _bindingPath], _keyPath); + kNSBindingDebugLogLevel2, @"DST setting %@, for %@", + [_source valueForKeyPath: _bindingPath], _keyPath); id value = [_source valueForKeyPath: _bindingPath]; @@ -329,9 +329,9 @@ static void *NSBinderChangeContext; if ([checkBinding length] == [baseName length] + 1) { // Only keep the binder if it has a 1..9 at the end NSRange numberAtEnd = - NSMakeRange([checkBinding length] - 1, 1); + NSMakeRange([checkBinding length] - 1, 1); if ([[checkBinding substringWithRange: numberAtEnd] - intValue] == 0) { + intValue] == 0) { peer = NO; } } diff --git a/AppKit/NSKeyValueBinding/NSCachingBinder.m b/AppKit/NSKeyValueBinding/NSCachingBinder.m index 0ceef091..225b3dae 100644 --- a/AppKit/NSKeyValueBinding/NSCachingBinder.m +++ b/AppKit/NSKeyValueBinding/NSCachingBinder.m @@ -27,7 +27,7 @@ #import static void *NSCachingBinderChangeContext = - (void *) @"NSCachingBinderChangeContext"; + (void *) @"NSCachingBinderChangeContext"; @implementation _NSCachingBinder @@ -121,7 +121,7 @@ NSString *NSFormatDisplayPattern(NSString *pattern, id *values, if (newValue != nil && ![newValue isKindOfClass: [NSDate class]]) newValue = - [NSDate dateWithTimeIntervalSinceReferenceDate: 0]; + [NSDate dateWithTimeIntervalSinceReferenceDate: 0]; } } [_source setValue: newValue forKeyPath: _bindingPath]; diff --git a/AppKit/NSKeyValueBinding/NSKVOBinder.m b/AppKit/NSKeyValueBinding/NSKVOBinder.m index 9d799253..b719c91f 100644 --- a/AppKit/NSKeyValueBinding/NSKVOBinder.m +++ b/AppKit/NSKeyValueBinding/NSKVOBinder.m @@ -52,11 +52,11 @@ static void *NSKVOBinderChangeContext; - (void) stopObservingChanges { @try { if (_isObserving) { - NSBindingDebugLog( - kNSBindingDebugLogLevel2, - @"stop observing binding between %@.%@ alias %@ and %@.%@ (%@)", - [_source className], _binding, _bindingPath, - [_destination className], _keyPath, self); + NSBindingDebugLog(kNSBindingDebugLogLevel2, + @"stop observing binding between %@.%@ alias %@ " + @"and %@.%@ (%@)", + [_source className], _binding, _bindingPath, + [_destination className], _keyPath, self); [super stopObservingChanges]; [_destination removeObserver: self forKeyPath: _keyPath]; _isObserving = NO; @@ -119,8 +119,8 @@ NSString *NSFormatDisplayPattern(NSString *pattern, id *values, valueIndex--; if (code == '@') { NSString *string = (valueIndex < valueCount) - ? [values[valueIndex] description] - : @""; + ? [values[valueIndex] description] + : @""; NSInteger s, stringLength = [string length]; while (resultCount + stringLength >= resultCapacity) { @@ -153,16 +153,17 @@ NSString *NSFormatDisplayPattern(NSString *pattern, id *values, - (void) writeDestinationToSource { NSArray *peersIncludingSelf = [self peerBinders]; - NSInteger i, - count = (peersIncludingSelf == nil) ? 1 : [peersIncludingSelf count]; + NSInteger i, count = (peersIncludingSelf == nil) + ? 1 + : [peersIncludingSelf count]; id allBinders[count]; id allValues[count]; BOOL isEditable = YES; BOOL containsPlaceholder = NO; if (count > 1) - peersIncludingSelf = - [peersIncludingSelf sortedArrayUsingSelector: @selector(compare:)]; + peersIncludingSelf = [peersIncludingSelf + sortedArrayUsingSelector: @selector(compare:)]; if (peersIncludingSelf == nil) allBinders[0] = self; @@ -195,8 +196,8 @@ NSString *NSFormatDisplayPattern(NSString *pattern, id *values, allValues[i] = dstValue; } - NSString *pattern = - [[allBinders[0] options] objectForKey: NSDisplayPatternBindingOption]; + NSString *pattern = [[allBinders[0] options] + objectForKey: NSDisplayPatternBindingOption]; id value; if (pattern != nil) { @@ -248,8 +249,8 @@ NSString *NSFormatDisplayPattern(NSString *pattern, id *values, BOOL isValidKeyPath = YES; id currentValue = nil; id bindingPath = - [allBinders[0] bindingPath]; // We want the real one - not "xxxx2" fake - // path from non-main peers + [allBinders[0] bindingPath]; // We want the real one - not "xxxx2" + // fake path from non-main peers @try { currentValue = [_source valueForKeyPath: bindingPath]; } @catch (id ex) { @@ -279,9 +280,10 @@ NSString *NSFormatDisplayPattern(NSString *pattern, id *values, } @catch (id ex) { if (isValidKeyPath == NO || [currentValue - isEqualTo: [NSNumber numberWithBool: NO]] == NO) { + isEqualTo: [NSNumber numberWithBool: NO]] == + NO) { [_source setValue: [NSNumber numberWithBool: NO] - forKeyPath: bindingPath]; + forKeyPath: bindingPath]; } } } else { @@ -301,9 +303,9 @@ NSString *NSFormatDisplayPattern(NSString *pattern, id *values, } else { NSBindingDebugLog( - kNSBindingDebugLogLevel2, - @"skipping setting value on _source: %@ forKeyPath: %@", _source, - bindingPath); + kNSBindingDebugLogLevel2, + @"skipping setting value on _source: %@ forKeyPath: %@", + _source, bindingPath); } if ([self conditionallySetsEditable]) @@ -326,9 +328,9 @@ NSString *NSFormatDisplayPattern(NSString *pattern, id *values, context: (void *) context { NSBindingDebugLog( - kNSBindingDebugLogLevel1, - @"keyPath: %@\n object: %@\n change: %@\n context: %p", kp, - object, change, context); + kNSBindingDebugLogLevel1, + @"keyPath: %@\n object: %@\n change: %@\n context: %p", kp, + object, change, context); // We want changes to propogate one way so we stop observing for both our // handling and super's, otherwise our change will generate a change for the diff --git a/AppKit/NSKeyValueBinding/NSMultipleValueBinder.m b/AppKit/NSKeyValueBinding/NSMultipleValueBinder.m index c0393a47..87c2d3ef 100644 --- a/AppKit/NSKeyValueBinding/NSMultipleValueBinder.m +++ b/AppKit/NSKeyValueBinding/NSMultipleValueBinder.m @@ -53,7 +53,7 @@ static void *NSMultipleValueBinderWholeArrayChangeContext; - (void) applyToObject: (id) object inRow: (NSInteger) row keyPath: (id) path { @try { [object setValue: [[_rowValues objectAtIndex: row] - valueForKeyPath: _valueKeyPath] + valueForKeyPath: _valueKeyPath] forKey: path]; } @catch (id e) { NSLog(@"exception %@ while setting value for key path %@ for row %i", e, @@ -120,8 +120,8 @@ static void *NSMultipleValueBinderWholeArrayChangeContext; } else { _valueKeyPath = [components lastObject]; _arrayKeyPath = - [_keyPath substringToIndex: [_keyPath length] - - [_valueKeyPath length] - 1]; + [_keyPath substringToIndex: [_keyPath length] - + [_valueKeyPath length] - 1]; } } [_valueKeyPath retain]; @@ -146,19 +146,21 @@ static void *NSMultipleValueBinderWholeArrayChangeContext; _isObserving = YES; @try { [_destination - addObserver: self - forKeyPath: _arrayKeyPath - options: 0 - context: &NSMultipleValueBinderWholeArrayChangeContext]; + addObserver: self + forKeyPath: _arrayKeyPath + options: 0 + context: &NSMultipleValueBinderWholeArrayChangeContext]; if (![_valueKeyPath hasPrefix: @"@"]) [_rowValues addObserver: self - toObjectsAtIndexes: [NSIndexSet - indexSetWithIndexesInRange: - NSMakeRange( - 0, [_rowValues count])] - forKeyPath: _valueKeyPath - options: 0 - context: &NSMultipleValueBinderChangeContext]; + toObjectsAtIndexes: + [NSIndexSet + indexSetWithIndexesInRange: + NSMakeRange(0, + [_rowValues count])] + forKeyPath: _valueKeyPath + options: 0 + context: & + NSMultipleValueBinderChangeContext]; } @catch (id ex) { NSLog(@"%@", ex); } @@ -172,11 +174,12 @@ static void *NSMultipleValueBinderWholeArrayChangeContext; [_destination removeObserver: self forKeyPath: _arrayKeyPath]; if (![_valueKeyPath hasPrefix: @"@"]) [_rowValues removeObserver: self - fromObjectsAtIndexes: [NSIndexSet - indexSetWithIndexesInRange: - NSMakeRange( - 0, [_rowValues count])] - forKeyPath: _valueKeyPath]; + fromObjectsAtIndexes: + [NSIndexSet + indexSetWithIndexesInRange: + NSMakeRange(0, + [_rowValues count])] + forKeyPath: _valueKeyPath]; } @catch (id ex) { NSLog(@"%@", ex); } @@ -211,7 +214,7 @@ static void *NSMultipleValueBinderWholeArrayChangeContext; [[_source tableView] reloadData]; if ([_destination - respondsToSelector: @selector(_selectionMayHaveChanged)]) + respondsToSelector: @selector(_selectionMayHaveChanged)]) [_destination performSelector: @selector(_selectionMayHaveChanged)]; } } @@ -227,10 +230,10 @@ static void *NSMultipleValueBinderWholeArrayChangeContext; [self startObservingChanges]; if ([self createsSortDescriptor] && [_binding isEqual: @"value"]) { - [_source - setSortDescriptorPrototype: [[[NSSortDescriptor alloc] - initWithKey: _valueKeyPath - ascending: YES] autorelease]]; + [_source setSortDescriptorPrototype: [[[NSSortDescriptor alloc] + initWithKey: _valueKeyPath + ascending: YES] + autorelease]]; } if ([_source respondsToSelector: @selector (_establishBindingsWithDestinationIfUnbound:)]) { @@ -247,14 +250,14 @@ static void *NSMultipleValueBinderWholeArrayChangeContext; - (NSString *) description { return [NSString - stringWithFormat: @"%@ %@", [super description], [self rowValues]]; + stringWithFormat: @"%@ %@", [super description], [self rowValues]]; } - (void) updateRowValues { id value = [_destination valueForKeyPath: _arrayKeyPath]; if (![value respondsToSelector: @selector(objectAtIndex:)]) value = [[[_NSMultipleValueWrapperArray alloc] initWithObject: value] - autorelease]; + autorelease]; [self setRowValues: value]; } @end diff --git a/AppKit/NSKeyValueBinding/NSObject+BindingSupport.h b/AppKit/NSKeyValueBinding/NSObject+BindingSupport.h index 725209da..fcbd1912 100644 --- a/AppKit/NSKeyValueBinding/NSObject+BindingSupport.h +++ b/AppKit/NSKeyValueBinding/NSObject+BindingSupport.h @@ -25,9 +25,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @interface NSObject (BindingSupport) - (void) bind: (id) binding - toObject: (id) destination - withKeyPath: (NSString *) keyPath - options: (NSDictionary *) options; + toObject: (id) destination + withKeyPath: (NSString *) keyPath + options: (NSDictionary *) options; - (NSDictionary *) infoForBinding: (id) binding; - (void) unbind: (id) binding; + (void) exposeBinding: (id) binding; diff --git a/AppKit/NSKeyValueBinding/NSObject+BindingSupport.m b/AppKit/NSKeyValueBinding/NSObject+BindingSupport.m index e8f5eab8..7f5f1416 100644 --- a/AppKit/NSKeyValueBinding/NSObject+BindingSupport.m +++ b/AppKit/NSKeyValueBinding/NSObject+BindingSupport.m @@ -73,7 +73,7 @@ void NSDetermineBindingDebugLoggingLevel(void) { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSBindingDebugLogLevel = - [defaults integerForKey: @"NSBindingDebugLogLevel"]; + [defaults integerForKey: @"NSBindingDebugLogLevel"]; if (NSBindingDebugLogLevel > 0) { NSLog(@"set NSBindingDebugLogLevel to: '%d'", NSBindingDebugLogLevel); @@ -90,16 +90,16 @@ void NSDetermineBindingDebugLoggingLevel(void) { NSString *path = [bundle pathForResource: @"defaultBindingOptions" ofType: @"plist"]; - if ((defaultBindingOptions = - [[NSDictionary alloc] initWithContentsOfFile: path]) == nil) + if ((defaultBindingOptions = [[NSDictionary alloc] + initWithContentsOfFile: path]) == nil) defaultBindingOptions = [NSDictionary new]; } NSString *className = NSStringFromClass(self); NSString *bindingKey = [[className stringByAppendingString: @"."] - stringByAppendingString: binding]; + stringByAppendingString: binding]; NSDictionary *defaults = - [defaultBindingOptionsCache objectForKey: bindingKey]; + [defaultBindingOptionsCache objectForKey: bindingKey]; if (defaults == nil) { NSMutableDictionary *values; @@ -107,12 +107,12 @@ void NSDetermineBindingDebugLoggingLevel(void) { if (self == [NSObject class]) values = [NSMutableDictionary dictionary]; else - values = - [[[[self superclass] _defaultBindingOptionsForBinding: binding] - mutableCopy] autorelease]; + values = [[[[self superclass] + _defaultBindingOptionsForBinding: binding] mutableCopy] + autorelease]; [values addEntriesFromDictionary: [defaultBindingOptions - objectForKey: bindingKey]]; + objectForKey: bindingKey]]; if (defaultBindingOptionsCache == nil) defaultBindingOptionsCache = [NSMutableDictionary new]; @@ -152,8 +152,8 @@ void NSDetermineBindingDebugLoggingLevel(void) { id binder = [ownBinders objectForKey: binding]; if (!binder && create) { - binder = - [[[[self class] _binderClassForBinding: binding] new] autorelease]; + binder = [[[[self class] _binderClassForBinding: binding] new] + autorelease]; [ownBinders setObject: binder forKey: binding]; } @@ -176,14 +176,14 @@ void NSDetermineBindingDebugLoggingLevel(void) { } - (void) bind: (id) binding - toObject: (id) destination - withKeyPath: (NSString *) keyPath - options: (NSDictionary *) options + toObject: (id) destination + withKeyPath: (NSString *) keyPath + options: (NSDictionary *) options { NSBindingDebugLog( - kNSBindingDebugLogLevel1, - @"binding: %@\n toObject: %@\n withKeyPath: %@\n options: %@", - binding, destination, keyPath, options); + kNSBindingDebugLogLevel1, + @"binding: %@\n toObject: %@\n withKeyPath: %@\n options: %@", + binding, destination, keyPath, options); if (![[self class] _binderClassForBinding: binding]) { NSBindingDebugLog(kNSBindingDebugLogLevel1, @@ -243,9 +243,10 @@ void NSDetermineBindingDebugLoggingLevel(void) { - (NSDictionary *) infoForBinding: (id) binding { _NSBinder *binder = [self _binderForBinding: binding create: NO]; NSDictionary *result = [NSDictionary - dictionaryWithObjectsAndKeys: [binder destination], NSObservedObjectKey, - [binder keyPath], NSObservedKeyPathKey, - [binder options], NSOptionsKey, nil]; + dictionaryWithObjectsAndKeys: [binder destination], + NSObservedObjectKey, [binder keyPath], + NSObservedKeyPathKey, + [binder options], NSOptionsKey, nil]; return result; } diff --git a/AppKit/NSKeyValueBinding/NSTextBinder.m b/AppKit/NSKeyValueBinding/NSTextBinder.m index c66c60c0..b2258341 100644 --- a/AppKit/NSKeyValueBinding/NSTextBinder.m +++ b/AppKit/NSKeyValueBinding/NSTextBinder.m @@ -34,33 +34,33 @@ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; if ([_source isKindOfClass: [NSText class]]) { [nc addObserver: self - selector: @selector(textDidEndEditing:) - name: NSTextDidEndEditingNotification - object: _source]; + selector: @selector(textDidEndEditing:) + name: NSTextDidEndEditingNotification + object: _source]; if ([self continuouslyUpdatesValue]) [nc addObserver: self - selector: @selector(textDidChange:) - name: NSTextDidChangeNotification - object: _source]; + selector: @selector(textDidChange:) + name: NSTextDidChangeNotification + object: _source]; } else if ([_source isKindOfClass: [NSControl class]]) { [nc addObserver: self - selector: @selector(textDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: _source]; + selector: @selector(textDidEndEditing:) + name: NSControlTextDidEndEditingNotification + object: _source]; if ([self continuouslyUpdatesValue]) [nc addObserver: self - selector: @selector(textDidChange:) - name: NSControlTextDidChangeNotification - object: _source]; + selector: @selector(textDidChange:) + name: NSControlTextDidChangeNotification + object: _source]; } if ([_source isKindOfClass: [NSView class]]) { NSWindow *window = [_source window]; if (window) [nc addObserver: self - selector: @selector(windowWillClose:) - name: NSWindowWillCloseNotification - object: window]; + selector: @selector(windowWillClose:) + name: NSWindowWillCloseNotification + object: window]; } } diff --git a/AppKit/NSKeyValueBinding/NSTextFieldBinder.m b/AppKit/NSKeyValueBinding/NSTextFieldBinder.m index 8e9424b1..9c9b5752 100644 --- a/AppKit/NSKeyValueBinding/NSTextFieldBinder.m +++ b/AppKit/NSKeyValueBinding/NSTextFieldBinder.m @@ -41,18 +41,18 @@ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; if ([_source isKindOfClass: [NSControl class]]) { [nc addObserver: self - selector: @selector(textDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: _source]; + selector: @selector(textDidEndEditing:) + name: NSControlTextDidEndEditingNotification + object: _source]; [nc addObserver: self - selector: @selector(textDidBeginEditing:) - name: NSControlTextDidBeginEditingNotification - object: _source]; + selector: @selector(textDidBeginEditing:) + name: NSControlTextDidBeginEditingNotification + object: _source]; if ([self continuouslyUpdatesValue]) [nc addObserver: self - selector: @selector(textDidChange:) - name: NSControlTextDidChangeNotification - object: _source]; + selector: @selector(textDidChange:) + name: NSControlTextDidChangeNotification + object: _source]; } } } @@ -90,7 +90,7 @@ [_destination objectDidEndEditing: self]; if ([_source respondsToSelector: @selector(window)]) { NSDocument *document = - [[[_source window] windowController] document]; + [[[_source window] windowController] document]; if (document) [document objectDidEndEditing: self]; } diff --git a/AppKit/NSKeyboardBinding/NSKeyboardBinding.m b/AppKit/NSKeyboardBinding/NSKeyboardBinding.m index 406587ca..b8f03594 100644 --- a/AppKit/NSKeyboardBinding/NSKeyboardBinding.m +++ b/AppKit/NSKeyboardBinding/NSKeyboardBinding.m @@ -67,9 +67,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: - @"<%@[%p] string: %@ modifierMask: %p selectorNames: %@>", - [self class], self, _string, _modifierMask, _selectorNames]; + stringWithFormat: + @"<%@[%p] string: %@ modifierMask: %p selectorNames: %@>", + [self class], self, _string, _modifierMask, _selectorNames]; } @end diff --git a/AppKit/NSKeyboardBinding/NSKeyboardBindingManager.m b/AppKit/NSKeyboardBinding/NSKeyboardBindingManager.m index c8933059..d0fca92a 100644 --- a/AppKit/NSKeyboardBinding/NSKeyboardBindingManager.m +++ b/AppKit/NSKeyboardBinding/NSKeyboardBindingManager.m @@ -30,14 +30,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSArray *) keyBindingPaths { return [NSArray - arrayWithObjects: [[NSBundle - bundleForClass: [NSKeyboardBindingManager class]] - pathForResource: @"StandardKeyBindings" - ofType: @"keyBindings"], - [[NSBundle mainBundle] - pathForResource: @"KeyBindings" - ofType: @"keyBindings"], - nil]; + arrayWithObjects: [[NSBundle + bundleForClass: [NSKeyboardBindingManager + class]] + pathForResource: @"StandardKeyBindings" + ofType: @"keyBindings"], + [[NSBundle mainBundle] + pathForResource: @"KeyBindings" + ofType: @"keyBindings"], + nil]; } + (NSKeyboardBindingManager *) defaultKeyBindingManager { @@ -50,11 +51,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (i = 0; i < count; ++i) { NSString *path = [paths objectAtIndex: i]; NSDictionary *keyBindingDictionary = - [NSDictionary dictionaryWithContentsOfFile: path]; + [NSDictionary dictionaryWithContentsOfFile: path]; if (keyBindingDictionary != nil) { NSKeyboardBindingManager *manager = - [[self alloc] initWithDictionary: keyBindingDictionary]; + [[self alloc] initWithDictionary: keyBindingDictionary]; [manager setNextKeyBindingManager: firstKeyBindingManager]; firstKeyBindingManager = manager; @@ -105,11 +106,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSString *key = [allKeys objectAtIndex: i]; id value = [dict objectForKey: key]; NSMutableArray *keyComponents = - [[[key componentsSeparatedByString: @","] mutableCopy] autorelease]; + [[[key componentsSeparatedByString: @","] mutableCopy] + autorelease]; unsigned short hexCode; unsigned modifierMask = 0, hexInt = 0; NSScanner *scanner = - [NSScanner scannerWithString: [keyComponents lastObject]]; + [NSScanner scannerWithString: [keyComponents lastObject]]; [scanner scanHexInt: &hexInt]; hexCode = hexInt; @@ -123,10 +125,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // we can change this later to support multi-character unicode keyBinding = [NSKeyboardBinding - keyBindingWithString: [NSString stringWithCharacters: &hexCode - length: 1] - modifierMask: modifierMask - selectorNames: value]; + keyBindingWithString: [NSString stringWithCharacters: &hexCode + length: 1] + modifierMask: modifierMask + selectorNames: value]; [keyBindings addObject: keyBinding]; } @@ -139,7 +141,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _dictionary = [dictionary retain]; _keyBindings = [[NSKeyboardBindingManager - keyBindingsFromDictionary: _dictionary] retain]; + keyBindingsFromDictionary: _dictionary] retain]; return self; } diff --git a/AppKit/NSMatrix.m b/AppKit/NSMatrix.m index 29ea7a44..f5cdf767 100644 --- a/AppKit/NSMatrix.m +++ b/AppKit/NSMatrix.m @@ -61,9 +61,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (flags & 0x80000000) _mode = NSHighlightModeMatrix; _backgroundColor = - [[keyed decodeObjectForKey: @"NSBackgroundColor"] retain]; + [[keyed decodeObjectForKey: @"NSBackgroundColor"] retain]; _cellBackgroundColor = - [[keyed decodeObjectForKey: @"NSCellBackgroundColor"] retain]; + [[keyed decodeObjectForKey: @"NSCellBackgroundColor"] retain]; name = [keyed decodeObjectForKey: @"NSCellClass"]; if ((_cellClass = NSClassFromString(name)) == Nil) { if (name) { @@ -74,10 +74,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } _prototype = [[keyed decodeObjectForKey: @"NSProtoCell"] retain]; _cells = [[NSMutableArray alloc] - initWithArray: [keyed decodeObjectForKey: @"NSCells"]]; + initWithArray: [keyed decodeObjectForKey: @"NSCells"]]; id selectedCell = [keyed decodeObjectForKey: @"NSSelectedCell"]; - if ((_selectedIndex = - [_cells indexOfObjectIdenticalTo: selectedCell]) != NSNotFound) + if ((_selectedIndex = [_cells + indexOfObjectIdenticalTo: selectedCell]) != NSNotFound) [self selectCell: selectedCell]; else _selectedIndex = -1; @@ -111,10 +111,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithFrame: (NSRect) frame - mode: (NSMatrixMode) mode - prototype: (NSCell *) prototype - numberOfRows: (NSInteger) rows - numberOfColumns: (NSInteger) columns + mode: (NSMatrixMode) mode + prototype: (NSCell *) prototype + numberOfRows: (NSInteger) rows + numberOfColumns: (NSInteger) columns { NSInteger i; @@ -131,10 +131,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithFrame: (NSRect) frame - mode: (NSMatrixMode) mode - cellClass: (Class) cls - numberOfRows: (NSInteger) rows - numberOfColumns: (NSInteger) columns + mode: (NSMatrixMode) mode + cellClass: (Class) cls + numberOfRows: (NSInteger) rows + numberOfColumns: (NSInteger) columns { NSInteger i; @@ -183,9 +183,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _cellSize.width = frame.size.width; else _cellSize.width = - (frame.size.width - - (_numberOfColumns - 1) * _intercellSpacing.width) / - _numberOfColumns; + (frame.size.width - + (_numberOfColumns - 1) * _intercellSpacing.width) / + _numberOfColumns; } if (_autoresizingMask & NSViewHeightSizable) { @@ -193,9 +193,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _cellSize.height = frame.size.height; else _cellSize.height = - (frame.size.height - - (_numberOfRows - 1) * _intercellSpacing.height) / - _numberOfRows; + (frame.size.height - + (_numberOfRows - 1) * _intercellSpacing.height) / + _numberOfRows; } } } @@ -301,7 +301,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSRect result; result.origin.x = - column * _cellSize.width + column * _intercellSpacing.width; + column * _cellSize.width + column * _intercellSpacing.width; result.origin.y = row * _cellSize.height + row * _intercellSpacing.height; result.size = _cellSize; @@ -324,8 +324,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) getRow: (NSInteger *) row - column: (NSInteger *) column - forPoint: (NSPoint) point + column: (NSInteger *) column + forPoint: (NSPoint) point { NSRect cellFrame; @@ -453,13 +453,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ struct { SEL selector; NSString *name; - } notes[] = { - {@selector(controlTextDidBeginEditing:), - NSControlTextDidBeginEditingNotification}, - {@selector(controlTextDidChange:), NSControlTextDidChangeNotification}, - {@selector(controlTextDidEndEditing:), - NSControlTextDidEndEditingNotification}, - {NULL, nil}}; + } notes[] = {{@selector(controlTextDidBeginEditing:), + NSControlTextDidBeginEditingNotification}, + {@selector(controlTextDidChange:), + NSControlTextDidChangeNotification}, + {@selector(controlTextDidEndEditing:), + NSControlTextDidEndEditingNotification}, + {NULL, nil}}; NSInteger i; if (_delegate != nil) @@ -1053,9 +1053,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [cell setState: nextState]; if ([cell trackMouse: lastMouse - inRect: cellFrame - ofView: self - untilMouseUp: NO]) { + inRect: cellFrame + ofView: self + untilMouseUp: NO]) { _selectedIndex = [_cells indexOfObjectIdenticalTo: cell]; _keyCellIndex = _selectedIndex; [cell highlight: NO withFrame: cellFrame inView: self]; @@ -1098,7 +1098,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSPoint point = [self convertPoint: [lastMouse locationInWindow] fromView: nil]; NSInteger row, column, minSelRow, maxSelRow, minSelColumn, maxSelColumn, - r, c; + r, c; [[self superview] autoscroll: lastMouse]; @@ -1128,10 +1128,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([cell isEnabled]) { NSRect cellFrame = [self cellFrameAtRow: r column: c]; BOOL inSelection = - (r >= minSelRow && r <= maxSelRow && - c >= minSelColumn && c <= maxSelColumn); + (r >= minSelRow && r <= maxSelRow && + c >= minSelColumn && c <= maxSelColumn); BOOL highlight = - inSelection ? firstHighlight : !firstHighlight; + inSelection ? firstHighlight : !firstHighlight; [cell setState: highlight ? NSOnState : NSOffState]; [cell setHighlighted: highlight]; @@ -1172,9 +1172,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSRect cellFrame = [self cellFrameAtRow: row column: column]; if ([cell trackMouse: event - inRect: cellFrame - ofView: self - untilMouseUp: YES]) { + inRect: cellFrame + ofView: self + untilMouseUp: YES]) { [cell setState: [cell nextState]]; [self selectCell: cell]; } diff --git a/AppKit/NSMeasurementUnit.h b/AppKit/NSMeasurementUnit.h index a5f8393e..8b6d8790 100644 --- a/AppKit/NSMeasurementUnit.h +++ b/AppKit/NSMeasurementUnit.h @@ -43,10 +43,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ stepDownCycle: (NSArray *) downCycle; - (id) initWithName: (NSString *) name - abbreviation: (NSString *) abbreviation - pointsPerUnit: (CGFloat) points - stepUpCycle: (NSArray *) upCycle - stepDownCycle: (NSArray *) downCycle; + abbreviation: (NSString *) abbreviation + pointsPerUnit: (CGFloat) points + stepUpCycle: (NSArray *) upCycle + stepDownCycle: (NSArray *) downCycle; - (NSString *) name; - (NSString *) abbreviation; diff --git a/AppKit/NSMeasurementUnit.m b/AppKit/NSMeasurementUnit.m index b5adf60f..5e504093 100644 --- a/AppKit/NSMeasurementUnit.m +++ b/AppKit/NSMeasurementUnit.m @@ -28,13 +28,15 @@ static NSMutableArray *_measurementUnits = nil; + (NSMeasurementUnit *) inchesMeasurementUnit { return [self - measurementUnitWithName: @"Inches" - abbreviation: @"in" - pointsPerUnit: 72.0 - stepUpCycle: [NSArray - arrayWithObject: [NSNumber - numberWithFloat: 2.0]] - stepDownCycle: [NSArray arrayWithObjects: + measurementUnitWithName: @"Inches" + abbreviation: @"in" + pointsPerUnit: 72.0 + stepUpCycle: [NSArray arrayWithObject: + [NSNumber numberWithFloat: + 2.0]] + stepDownCycle: + [NSArray + arrayWithObjects: [NSNumber numberWithFloat: 0.5], [NSNumber numberWithFloat: 0.25], [NSNumber numberWithFloat: 0.125], @@ -43,38 +45,43 @@ static NSMutableArray *_measurementUnits = nil; + (NSMeasurementUnit *) centimetersMeasurementUnit { return [self - measurementUnitWithName: @"Centimeters" - abbreviation: @"cm" - pointsPerUnit: 28.35 - stepUpCycle: [NSArray - arrayWithObject: [NSNumber - numberWithFloat: 2.0]] - stepDownCycle: [NSArray arrayWithObjects: - [NSNumber numberWithFloat: 0.5], - [NSNumber numberWithFloat: 0.2], - nil]]; + measurementUnitWithName: @"Centimeters" + abbreviation: @"cm" + pointsPerUnit: 28.35 + stepUpCycle: [NSArray arrayWithObject: + [NSNumber numberWithFloat: + 2.0]] + stepDownCycle: + [NSArray arrayWithObjects: + [NSNumber numberWithFloat: 0.5], + [NSNumber numberWithFloat: 0.2], + nil]]; } + (NSMeasurementUnit *) pointsMeasurementUnit { return [self - measurementUnitWithName: @"Points" - abbreviation: @"pt" - pointsPerUnit: 1.0 - stepUpCycle: [NSArray arrayWithObject: - [NSNumber numberWithFloat: 10.0]] - stepDownCycle: [NSArray arrayWithObject: - [NSNumber numberWithFloat: 0.5]]]; + measurementUnitWithName: @"Points" + abbreviation: @"pt" + pointsPerUnit: 1.0 + stepUpCycle: [NSArray arrayWithObject: + [NSNumber numberWithFloat: + 10.0]] + stepDownCycle: [NSArray arrayWithObject: + [NSNumber numberWithFloat: + 0.5]]]; } + (NSMeasurementUnit *) picasMeasurementUnit { return [self - measurementUnitWithName: @"Picas" - abbreviation: @"pc" - pointsPerUnit: 12.0 - stepUpCycle: [NSArray arrayWithObject: - [NSNumber numberWithFloat: 10.0]] - stepDownCycle: [NSArray arrayWithObject: - [NSNumber numberWithFloat: 0.5]]]; + measurementUnitWithName: @"Picas" + abbreviation: @"pc" + pointsPerUnit: 12.0 + stepUpCycle: [NSArray arrayWithObject: + [NSNumber numberWithFloat: + 10.0]] + stepDownCycle: [NSArray arrayWithObject: + [NSNumber numberWithFloat: + 0.5]]]; } + (NSArray *) allMeasurementUnits { @@ -119,10 +126,10 @@ static NSMutableArray *_measurementUnits = nil; } - (id) initWithName: (NSString *) name - abbreviation: (NSString *) abbreviation - pointsPerUnit: (CGFloat) points - stepUpCycle: (NSArray *) upCycle - stepDownCycle: (NSArray *) downCycle; + abbreviation: (NSString *) abbreviation + pointsPerUnit: (CGFloat) points + stepUpCycle: (NSArray *) upCycle + stepDownCycle: (NSArray *) downCycle; { _name = [name retain]; _abbreviation = [abbreviation retain]; diff --git a/AppKit/NSMenu.subproj/NSMainMenuView.m b/AppKit/NSMenu.subproj/NSMainMenuView.m index ef684256..ad48f218 100644 --- a/AppKit/NSMenu.subproj/NSMainMenuView.m +++ b/AppKit/NSMenu.subproj/NSMainMenuView.m @@ -36,9 +36,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + (CGFloat) menuHeight { - NSDictionary *attributes = - [NSDictionary dictionaryWithObjectsAndKeys: [self menuFont], - NSFontAttributeName, nil]; + NSDictionary *attributes = [NSDictionary + dictionaryWithObjectsAndKeys: [self menuFont], NSFontAttributeName, + nil]; CGFloat result = [@"Menu" sizeWithAttributes: attributes].height; result += 3; // border top/bottom margin @@ -88,9 +88,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSRect result; NSSize titleSize = [[self graphicsStyle] menuItemTextSize: [item title]]; - result.origin = - NSMakePoint(NSMaxX(previousBorderRect) + 6, - floor(([self bounds].size.height - titleSize.height) / 2)); + result.origin = NSMakePoint( + NSMaxX(previousBorderRect) + 6, + floor(([self bounds].size.height - titleSize.height) / 2)); result.size = titleSize; return result; @@ -161,16 +161,16 @@ static void drawSunkenBorder(NSRect rect) { - (NSImage *) overflowImage { return [[self window] isKeyWindow] - ? [NSImage imageNamed: @"NSMenuViewDoubleRightArrow"] - : [NSImage imageNamed: @"NSMenuViewDoubleRightArrowGray"]; + ? [NSImage imageNamed: @"NSMenuViewDoubleRightArrow"] + : [NSImage imageNamed: @"NSMenuViewDoubleRightArrowGray"]; } - (NSRect) overflowRect { NSRect bounds = [self bounds]; NSImage *image = [self overflowImage]; NSSize size = [image size]; - NSRect rect = - NSInsetRect(NSMakeRect(0, 0, size.width, bounds.size.height), -3, 0); + NSRect rect = NSInsetRect(NSMakeRect(0, 0, size.width, bounds.size.height), + -3, 0); rect.origin.x = NSMaxX(bounds) - rect.size.width; @@ -197,11 +197,10 @@ static void drawSunkenBorder(NSRect rect) { NSRect borderRect = [self borderRectFromTitleRect: titleRect]; [[self graphicsStyle] - drawMenuBarItemBorderInRect: borderRect - hover: - (i == - _selectedItemIndex) /*NSPointInRect(mouseLoc,borderRect)*/ - selected: (i == _selectedItemIndex)]; + drawMenuBarItemBorderInRect: borderRect + hover: (i == + _selectedItemIndex) /*NSPointInRect(mouseLoc,borderRect)*/ + selected: (i == _selectedItemIndex)]; titleRect.origin.x = borderRect.origin.x + (NSWidth(borderRect) - NSWidth(titleRect)) / 2; @@ -351,8 +350,8 @@ static void drawSunkenBorder(NSRect rect) { if (_selectedItemIndex == [items count]) { NSMenuWindow *branch = - [[NSMenuWindow alloc] initWithMenu: [self menu] - overflowAtIndex: [self overflowIndex]]; + [[NSMenuWindow alloc] initWithMenu: [self menu] + overflowAtIndex: [self overflowIndex]]; [self positionBranchForSelectedItem: branch screen: screen]; @@ -366,7 +365,7 @@ static void drawSunkenBorder(NSRect rect) { if ([item hasSubmenu]) { if ([[[item submenu] itemArray] count] > 0) { NSMenuWindow *branch = - [[NSMenuWindow alloc] initWithMenu: [item submenu]]; + [[NSMenuWindow alloc] initWithMenu: [item submenu]]; [self positionBranchForSelectedItem: branch screen: screen]; diff --git a/AppKit/NSMenu.subproj/NSMenu.m b/AppKit/NSMenu.subproj/NSMenu.m index 7d365832..e79625ed 100644 --- a/AppKit/NSMenu.subproj/NSMenu.m +++ b/AppKit/NSMenu.subproj/NSMenu.m @@ -27,7 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import const NSNotificationName NSMenuDidEndTrackingNotification = - @"NSMenuDidEndTrackingNotification"; + @"NSMenuDidEndTrackingNotification"; @implementation NSMenu @@ -76,7 +76,7 @@ const NSNotificationName NSMenuDidEndTrackingNotification = _name = [[keyed decodeObjectForKey: @"NSName"] copy]; _itemArray = [[NSMutableArray alloc] - initWithArray: [keyed decodeObjectForKey: @"NSMenuItems"]]; + initWithArray: [keyed decodeObjectForKey: @"NSMenuItems"]]; _autoenablesItems = ![keyed decodeBoolForKey: @"NSNoAutoenable"]; } else { NSInteger version; @@ -132,8 +132,8 @@ const NSNotificationName NSMenuDidEndTrackingNotification = [coder decodeValueOfObjCType: @encode(int) at: &flags]; - [coder - decodeValuesOfObjCTypes: "@@@", &_title, &_itemArray, &_name]; + [coder decodeValuesOfObjCTypes: "@@@", &_title, &_itemArray, + &_name]; _autoenablesItems = !(flags & 0x80000000); // _excludeMarkColumn = flags & 0x80000; @@ -263,7 +263,7 @@ const NSNotificationName NSMenuDidEndTrackingNotification = for (i = 0; i < count; i++) if ([[(NSMenuItem *) [_itemArray objectAtIndex: i] representedObject] - isEqual: object]) + isEqual: object]) return i; return -1; @@ -321,9 +321,9 @@ const NSNotificationName NSMenuDidEndTrackingNotification = keyEquivalent: (NSString *) keyEquivalent { NSMenuItem *item = - [[[NSMenuItem alloc] initWithTitle: title - action: action - keyEquivalent: keyEquivalent] autorelease]; + [[[NSMenuItem alloc] initWithTitle: title + action: action + keyEquivalent: keyEquivalent] autorelease]; [self addItem: item]; @@ -355,9 +355,9 @@ const NSNotificationName NSMenuDidEndTrackingNotification = atIndex: (NSInteger) index { NSMenuItem *item = - [[[NSMenuItem alloc] initWithTitle: title - action: action - keyEquivalent: keyEquivalent] autorelease]; + [[[NSMenuItem alloc] initWithTitle: title + action: action + keyEquivalent: keyEquivalent] autorelease]; [self insertItem: item atIndex: index]; @@ -382,9 +382,9 @@ BOOL itemIsEnabled(NSMenuItem *item) { enabled = NO; } else if ([target respondsToSelector: @selector(validateMenuItem:)]) { enabled = [target validateMenuItem: item]; - } else if ([target - respondsToSelector: @selector - (validateUserInterfaceItem:)]) { // New validation scheme + } else if ([target respondsToSelector: @selector + (validateUserInterfaceItem:)]) { // New validation + // scheme enabled = [target validateUserInterfaceItem: item]; } else { enabled = YES; @@ -477,8 +477,8 @@ BOOL itemIsEnabled(NSMenuItem *item) { NSInteger i, count = [_itemArray count]; for (i = 0; i < count; i++) { - NSMenu *check = - [[[_itemArray objectAtIndex: i] submenu] _menuWithName: name]; + NSMenu *check = [[[_itemArray objectAtIndex: i] submenu] + _menuWithName: name]; if (check != nil) return check; diff --git a/AppKit/NSMenu.subproj/NSMenuItem.m b/AppKit/NSMenu.subproj/NSMenuItem.m index 99163a4b..9895cb1b 100644 --- a/AppKit/NSMenu.subproj/NSMenuItem.m +++ b/AppKit/NSMenu.subproj/NSMenuItem.m @@ -58,7 +58,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [self setTarget: target]; [self setKeyEquivalentModifierMask: - [keyed decodeIntForKey: @"NSKeyEquivModMask"]]; + [keyed decodeIntForKey: @"NSKeyEquivModMask"]]; [self setSubmenu: [keyed decodeObjectForKey: @"NSSubmenu"]]; _tag = [keyed decodeIntForKey: @"NSTag"]; _hidden = [keyed decodeBoolForKey: @"NSIsHidden"]; @@ -77,8 +77,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithTitle: (NSString *) title - action: (SEL) action - keyEquivalent: (NSString *) keyEquivalent + action: (SEL) action + keyEquivalent: (NSString *) keyEquivalent { _title = [title copy]; _target = nil; @@ -327,7 +327,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) _scanModifierMapFor: (NSString *) key longForm: (BOOL) longForm { NSDictionary *modmap = [[NSUserDefaults standardUserDefaults] - dictionaryForKey: @"NSModifierFlagMapping"]; + dictionaryForKey: @"NSModifierFlagMapping"]; if ([[modmap objectForKey: @"LeftControl"] isEqual: key]) return longForm ? @"LCtrl+" : @"Ctrl+"; @@ -357,9 +357,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSString *keyName; NSString *command = nil, *alt = nil; if (![_keyEquivalent - isEqualToString: lowercaseKey]) // [key - // isEqualToString:uppercaseKey] - // doesn't work for numbers + isEqualToString: lowercaseKey]) // [key + // isEqualToString:uppercaseKey] + // doesn't work for numbers result = @"Shift+"; if (_keyEquivalentModifierMask & NSCommandKeyMask) @@ -390,11 +390,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSString *) description { - return [NSString - stringWithFormat: @"<%@[0x%x]: title: %@ action: %@ hasSubmenu: %@>", - [self class], self, [self title], - NSStringFromSelector(_action), - ([self hasSubmenu] ? @"YES" : @"NO")]; + return [NSString stringWithFormat: + @"<%@[0x%x]: title: %@ action: %@ hasSubmenu: %@>", + [self class], self, [self title], + NSStringFromSelector(_action), + ([self hasSubmenu] ? @"YES" : @"NO")]; } @end diff --git a/AppKit/NSMenu.subproj/NSMenuView.m b/AppKit/NSMenu.subproj/NSMenuView.m index 82c62c0a..76f94002 100644 --- a/AppKit/NSMenu.subproj/NSMenuView.m +++ b/AppKit/NSMenu.subproj/NSMenuView.m @@ -169,8 +169,8 @@ const NSTimeInterval kMouseMovementThreshold = .001f; // so a tactical autorelease pool keeps a lid on things NSAutoreleasePool *pool = [NSAutoreleasePool new]; int count = [viewStack count]; - NSScreen *screen = - [self _screenForPoint: [[event window] convertBaseToScreen: point]]; + NSScreen *screen = [self + _screenForPoint: [[event window] convertBaseToScreen: point]]; point = [[event window] convertBaseToScreen: point]; @@ -191,7 +191,7 @@ const NSTimeInterval kMouseMovementThreshold = .001f; // And find out where the mouse is relative to it NSPoint checkPoint = - [[checkView window] convertScreenToBase: point]; + [[checkView window] convertScreenToBase: point]; checkPoint = [checkView convertPoint: checkPoint fromView: nil]; @@ -203,7 +203,7 @@ const NSTimeInterval kMouseMovementThreshold = .001f; // Which item is the cursor on top of? NSUInteger itemIndex = - [checkView itemIndexAtPoint: checkPoint]; + [checkView itemIndexAtPoint: checkPoint]; MENUDEBUG(@"found an item index: %u", itemIndex); @@ -226,9 +226,9 @@ const NSTimeInterval kMouseMovementThreshold = .001f; // If it's got a cascading menu then push that on the // stack - if ((branch = - [checkView viewAtSelectedIndexPositionOnScreen: - screen]) != nil) { + if ((branch = [checkView + viewAtSelectedIndexPositionOnScreen: + screen]) != nil) { MENUDEBUG(@"adding a new cascading view: %@", branch); [viewStack addObject: branch]; @@ -259,9 +259,9 @@ const NSTimeInterval kMouseMovementThreshold = .001f; // Let's take a look at what's come in on the event queue event = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | NSMouseMovedMask | - NSLeftMouseDraggedMask | NSKeyDownMask | - NSAppKitDefinedMask]; + nextEventMatchingMask: NSLeftMouseUpMask | NSMouseMovedMask | + NSLeftMouseDraggedMask | NSKeyDownMask | + NSAppKitDefinedMask]; [event retain]; if (keyboardNavigationAction != kNSMenuKeyboardNavigationNone) { @@ -428,7 +428,8 @@ const NSTimeInterval kMouseMovementThreshold = .001f; NSMenuView *branch = nil; // If there's a submenu at the current selected index if ((branch = [activeMenuView - viewAtSelectedIndexPositionOnScreen: screen]) != nil) { + viewAtSelectedIndexPositionOnScreen: screen]) != + nil) { MENUDEBUG(@"adding a new cascading view: %@", branch); [viewStack addObject: branch]; } else { @@ -445,8 +446,8 @@ const NSTimeInterval kMouseMovementThreshold = .001f; case kNSMenuKeyboardNavigationLetter: { MENUDEBUG(@"Letter..."); NSString *letterString = - [[NSString stringWithCharacters: &ch - length: 1] uppercaseString]; + [[NSString stringWithCharacters: &ch + length: 1] uppercaseString]; NSUInteger oldIndex = [activeMenuView selectedItemIndex]; NSArray *items = [activeMenuView itemArray]; // Look for the next enabled item by search down and wrapping @@ -469,7 +470,7 @@ const NSTimeInterval kMouseMovementThreshold = .001f; if ((ignoreEnabledState || [item isEnabled] == YES) || [item hasSubmenu] == YES) { NSRange range = - [[item title] rangeOfString: letterString]; + [[item title] rangeOfString: letterString]; if (range.location != NSNotFound) { MENUDEBUG(@"selecting item: %u", item); [activeMenuView setSelectedItemIndex: newIndex]; @@ -532,7 +533,7 @@ const NSTimeInterval kMouseMovementThreshold = .001f; // the menu will stay sticky)... The timestamp is to avoid // false clicks - make sure there's a delay so the user can if ([event timestamp] - firstTimestamp > - kMenuInitialClickThreshold && + kMenuInitialClickThreshold && [viewStack count] == 1 && [item isEnabled]) { MENUDEBUG(@"Handling selected item - exiting"); state = STATE_EXIT; diff --git a/AppKit/NSMenu.subproj/NSMenuWindow.m b/AppKit/NSMenu.subproj/NSMenuWindow.m index 349dc449..5bd40307 100644 --- a/AppKit/NSMenu.subproj/NSMenuWindow.m +++ b/AppKit/NSMenu.subproj/NSMenuWindow.m @@ -43,8 +43,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithMenu: (NSMenu *) menu overflowAtIndex: (NSUInteger) overflowIndex { NSOverflowMenuView *view = - [[NSOverflowMenuView alloc] initWithMenu: menu - overflowAtIndex: overflowIndex]; + [[NSOverflowMenuView alloc] initWithMenu: menu + overflowAtIndex: overflowIndex]; NSRect contentRect = [view frame]; [self initWithContentRect: contentRect diff --git a/AppKit/NSMenu.subproj/NSSubmenuView.m b/AppKit/NSMenu.subproj/NSSubmenuView.m index 3756eefb..486237a1 100644 --- a/AppKit/NSMenu.subproj/NSSubmenuView.m +++ b/AppKit/NSMenu.subproj/NSSubmenuView.m @@ -59,7 +59,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ITEM_MAX(size); if ([[item keyEquivalent] length] == 0) { size = [[self graphicsStyle] - menuItemTextSize: [item _keyEquivalentDescription]]; + menuItemTextSize: [item _keyEquivalentDescription]]; ITEM_MAX(size); } if ([item hasSubmenu]) { @@ -102,7 +102,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([[item keyEquivalent] length] != 0) { size = [[self graphicsStyle] - menuItemTextSize: [item _keyEquivalentDescription]]; + menuItemTextSize: [item _keyEquivalentDescription]]; maxKeyWidth = MAX(maxKeyWidth, size.width); height = MAX(height, size.height); } @@ -173,9 +173,9 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { NSMenuItem *item = [items objectAtIndex: i]; if ([item isSeparatorItem]) { - NSRect separatorRect = - NSMakeRect(origin.x, origin.y, NSWidth(itemArea), - [[self graphicsStyle] menuItemSeparatorSize].height); + NSRect separatorRect = NSMakeRect( + origin.x, origin.y, NSWidth(itemArea), + [[self graphicsStyle] menuItemSeparatorSize].height); [[self graphicsStyle] drawMenuSeparatorInRect: separatorRect]; @@ -194,8 +194,8 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { NSSize partSize; BOOL showsEnabled = ([item isEnabled] || [item hasSubmenu]); - partRect = - NSMakeRect(origin.x, origin.y, itemArea.size.width, itemHeight); + partRect = NSMakeRect(origin.x, origin.y, itemArea.size.width, + itemHeight); if (selected) [[self graphicsStyle] drawMenuSelectionInRect: partRect @@ -203,7 +203,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { // Draw the gutter and checkmark (if any) CENTER_PART_RECT_VERTICALLY( - [[self graphicsStyle] menuItemGutterSize]); + [[self graphicsStyle] menuItemGutterSize]); if ([item state]) { [[self graphicsStyle] drawMenuGutterInRect: partRect]; [[self graphicsStyle] drawMenuCheckmarkInRect: partRect @@ -222,7 +222,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { CENTER_PART_RECT_VERTICALLY([image size]); CGContextRef ctx = - [[NSGraphicsContext currentContext] graphicsPort]; + [[NSGraphicsContext currentContext] graphicsPort]; CGContextSaveGState(ctx); CGContextTranslateCTM(ctx, partRect.origin.x, partRect.origin.y); @@ -254,7 +254,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { } else { NSString *title = [item title]; CENTER_PART_RECT_VERTICALLY( - [[self graphicsStyle] menuItemTextSize: title]); + [[self graphicsStyle] menuItemTextSize: title]); [[self graphicsStyle] drawMenuItemText: title inRect: partRect enabled: showsEnabled @@ -265,9 +265,9 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { if ([[item keyEquivalent] length] != 0) { NSString *keyString = [item _keyEquivalentDescription]; NSSize branchArrowSize = - [[self graphicsStyle] menuItemBranchArrowSize]; + [[self graphicsStyle] menuItemBranchArrowSize]; NSSize keyEquivalentSize = - [[self graphicsStyle] menuItemTextSize: keyString]; + [[self graphicsStyle] menuItemTextSize: keyString]; partRect.origin.x = origin.x + NSWidth(itemArea) - branchArrowSize.width - @@ -282,9 +282,9 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { // Draw the submenu arrow if ([item hasSubmenu]) { NSSize branchArrowSize = - [[self graphicsStyle] menuItemBranchArrowSize]; + [[self graphicsStyle] menuItemBranchArrowSize]; partRect.origin.x = - origin.x + NSWidth(itemArea) - branchArrowSize.width; + origin.x + NSWidth(itemArea) - branchArrowSize.width; partRect.size.width = branchArrowSize.width; CENTER_PART_RECT_VERTICALLY(branchArrowSize); [[self graphicsStyle] drawMenuBranchArrowInRect: partRect @@ -380,7 +380,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { if ([item hasSubmenu]) { NSMenuWindow *branch = - [[NSMenuWindow alloc] initWithMenu: [item submenu]]; + [[NSMenuWindow alloc] initWithMenu: [item submenu]]; [self positionBranchForSelectedItem: branch screen: screen]; diff --git a/AppKit/NSMutableAttributedString.m b/AppKit/NSMutableAttributedString.m index 68b82f8e..46483026 100644 --- a/AppKit/NSMutableAttributedString.m +++ b/AppKit/NSMutableAttributedString.m @@ -40,11 +40,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (NSString *name in fontnameList) { NSCharacterSet *fontCharSet = - [sNameToCharacterSetCache objectForKey: name]; + [sNameToCharacterSetCache objectForKey: name]; if (fontCharSet == nil) { NSFont *fontCandidate = - [[NSFontManager sharedFontManager] convertFont: font - toFace: name]; + [[NSFontManager sharedFontManager] convertFont: font + toFace: name]; fontCharSet = [fontCandidate coveredCharacterSet]; if (fontCharSet != nil) { // Cache the info @@ -52,16 +52,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } else { // Cache some empty charset so we don't look for it again [sNameToCharacterSetCache - setObject: [NSCharacterSet - characterSetWithRange: NSMakeRange(0, 0)] - forKey: name]; + setObject: [NSCharacterSet + characterSetWithRange: NSMakeRange( + 0, 0)] + forKey: name]; } } if (fontCharSet) { if ([fontCharSet characterIsMember: c]) { substitute = - [[NSFontManager sharedFontManager] convertFont: font - toFace: name]; + [[NSFontManager sharedFontManager] convertFont: font + toFace: name]; } } if (substitute) { @@ -83,7 +84,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static NSArray *sAllFonts = nil; if (sAllFonts == nil) { sAllFonts = - [[[NSFontManager sharedFontManager] availableFonts] retain]; + [[[NSFontManager sharedFontManager] availableFonts] retain]; } bestFont = [self _bestFontForCharacter: c userFont: font @@ -101,7 +102,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Check that all of the chars in the range are supported by the font // attribute Else, change the font attribute to one supporting these chars NSCharacterSet *blankChars = - [NSCharacterSet whitespaceAndNewlineCharacterSet]; + [NSCharacterSet whitespaceAndNewlineCharacterSet]; NSCharacterSet *controlChars = [NSCharacterSet controlCharacterSet]; while (location < limit) { NSRange effectiveRange; @@ -131,14 +132,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } if ([fontCharSet characterIsMember: charToTest] == NO) { NSFont *substitute = - [self _bestFontForCharacter: charToTest - userFont: font]; + [self _bestFontForCharacter: charToTest + userFont: font]; if (substitute) { [self addAttribute: NSFontAttributeName value: substitute range: NSMakeRange( - i + testRange.location, - 1)]; + i + testRange.location, + 1)]; } } } @@ -179,9 +180,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ while (location < limit) { NSRange effectiveRange; - NSMutableDictionary *attributes = - [[[self attributesAtIndex: location effectiveRange: &effectiveRange] - mutableCopy] autorelease]; + NSMutableDictionary *attributes = [[[self + attributesAtIndex: location + effectiveRange: &effectiveRange] mutableCopy] autorelease]; NSFont *font = NSFontAttributeInDictionary(attributes); font = [[NSFontManager sharedFontManager] convertFont: font diff --git a/AppKit/NSOpenGL/NSOpenGLContext.m b/AppKit/NSOpenGL/NSOpenGLContext.m index d146772a..83bf9640 100644 --- a/AppKit/NSOpenGL/NSOpenGLContext.m +++ b/AppKit/NSOpenGL/NSOpenGLContext.m @@ -32,7 +32,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static inline NSOpenGLContext *_currentContext() { return (NSOpenGLContext *) NSThreadSharedInstanceDoNotCreate( - @"NSOpenGLContext"); + @"NSOpenGLContext"); } static void _setCurrentContext(NSOpenGLContext *context) { @@ -54,7 +54,7 @@ static inline void _clearCurrentContext() { } - initWithFormat: (NSOpenGLPixelFormat *) pixelFormat - shareContext: (NSOpenGLContext *) shareContext + shareContext: (NSOpenGLContext *) shareContext { CGLError error; @@ -69,8 +69,8 @@ static inline void _clearCurrentContext() { _pixelFormat = [pixelFormat retain]; if ((error = CGLCreateContext( - [_pixelFormat CGLPixelFormatObj], [shareContext CGLContextObj], - (CGLContextObj *) &_glContext)) != kCGLNoError) + [_pixelFormat CGLPixelFormatObj], [shareContext CGLContextObj], + (CGLContextObj *) &_glContext)) != kCGLNoError) NSLog(@"CGLCreateContext failed with %d in %s %d", error, __FILE__, __LINE__); @@ -118,13 +118,13 @@ static inline void _clearCurrentContext() { } - (void) getValues: (GLint *) vals - forParameter: (NSOpenGLContextParameter) parameter + forParameter: (NSOpenGLContextParameter) parameter { CGLGetParameter(_glContext, parameter, vals); } - (void) setValues: (const GLint *) vals - forParameter: (NSOpenGLContextParameter) parameter + forParameter: (NSOpenGLContextParameter) parameter { CGLSetParameter(_glContext, parameter, vals); } @@ -173,7 +173,7 @@ static inline void _clearCurrentContext() { waitUntilDone: YES]; if ((error = CGLContextMakeCurrentAndAttachToWindow( - _glContext, _cglWindow)) != kCGLNoError) + _glContext, _cglWindow)) != kCGLNoError) NSLog(@"CGLSetCurrentContext failed with %d in %s %d", error, __FILE__, __LINE__); @@ -222,9 +222,9 @@ static inline void _clearCurrentContext() { } - (void) setPixelBuffer: (NSOpenGLPixelBuffer *) pixelBuffer - cubeMapFace: (unsigned long) cubeMapFace - mipMapLeve: (long) mipMapLevel - currentVirtualScreen: (int) screen + cubeMapFace: (unsigned long) cubeMapFace + mipMapLeve: (long) mipMapLevel + currentVirtualScreen: (int) screen { NSUnimplementedMethod(); } diff --git a/AppKit/NSOpenGL/NSOpenGLPixelFormat.m b/AppKit/NSOpenGL/NSOpenGLPixelFormat.m index 28b6e48c..a225f0e1 100644 --- a/AppKit/NSOpenGL/NSOpenGLPixelFormat.m +++ b/AppKit/NSOpenGL/NSOpenGLPixelFormat.m @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSOpenGLPixelFormat - (instancetype) initWithAttributes: - (const NSOpenGLPixelFormatAttribute *) attributes + (const NSOpenGLPixelFormatAttribute *) attributes { CGLChoosePixelFormat(attributes, (CGLPixelFormatObj *) &_cglPixelFormat, &_numberOfVirtualScreens); @@ -80,8 +80,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) getValues: (long *) values - forAttribute: (NSOpenGLPixelFormatAttribute) attribute - forVirtualScreen: (int) screen + forAttribute: (NSOpenGLPixelFormatAttribute) attribute + forVirtualScreen: (int) screen { GLint glValue = 0; diff --git a/AppKit/NSOpenGL/NSOpenGLView.m b/AppKit/NSOpenGL/NSOpenGLView.m index b2cb6fc8..08396275 100644 --- a/AppKit/NSOpenGL/NSOpenGLView.m +++ b/AppKit/NSOpenGL/NSOpenGLView.m @@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSOpenGLPixelFormatAttribute attributes[] = {0}; return [[[NSOpenGLPixelFormat alloc] initWithAttributes: attributes] - autorelease]; + autorelease]; } - (id) initWithFrame: (NSRect) frame diff --git a/AppKit/NSOutlineView.m b/AppKit/NSOutlineView.m index f856dd6b..de801524 100644 --- a/AppKit/NSOutlineView.m +++ b/AppKit/NSOutlineView.m @@ -32,26 +32,26 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSOutlineViewItemWillExpandNotification = - @"NSOutlineViewItemWillExpandNotification"; + @"NSOutlineViewItemWillExpandNotification"; NSString *const NSOutlineViewItemDidExpandNotification = - @"NSOutlineViewItemDidExpandNotification"; + @"NSOutlineViewItemDidExpandNotification"; NSString *const NSOutlineViewItemWillCollapseNotification = - @"NSOutlineViewItemWillCollapseNotification"; + @"NSOutlineViewItemWillCollapseNotification"; NSString *const NSOutlineViewItemDidCollapseNotification = - @"NSOutlineViewItemDidCollapseNotification"; + @"NSOutlineViewItemDidCollapseNotification"; NSString *const NSOutlineViewColumnDidMoveNotification = - @"NSOutlineViewColumnDidMoveNotification"; + @"NSOutlineViewColumnDidMoveNotification"; NSString *const NSOutlineViewColumnDidResizeNotification = - @"NSOutlineViewColumnDidResizeNotification"; + @"NSOutlineViewColumnDidResizeNotification"; NSString *const NSOutlineViewSelectionDidChangeNotification = - @"NSOutlineViewSelectionDidChangeNotification"; + @"NSOutlineViewSelectionDidChangeNotification"; NSString *const NSOutlineViewSelectionIsChangingNotification = - @"NSOutlineViewSelectionIsChangingNotification"; + @"NSOutlineViewSelectionIsChangingNotification"; NSString *const NSOutlineViewDisclosureButtonKey = - @"NSOutlineViewDisclosureButtonKey"; + @"NSOutlineViewDisclosureButtonKey"; // We probably don't want this public, but NSOutlineView needs it, and it would // prove invaluable to other subclasses of NSTableView. @@ -145,11 +145,11 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item, _itemToLevel = NSCreateMapTable(NSNonOwnedPointerOrNullMapKeyCallBacks, NSIntegerMapValueCallBacks, 0); _itemToExpansionState = - NSCreateMapTable(NSNonOwnedPointerOrNullMapKeyCallBacks, - NSIntegerMapValueCallBacks, 0); + NSCreateMapTable(NSNonOwnedPointerOrNullMapKeyCallBacks, + NSIntegerMapValueCallBacks, 0); _itemToNumberOfChildren = - NSCreateMapTable(NSNonOwnedPointerOrNullMapKeyCallBacks, - NSIntegerMapValueCallBacks, 0); + NSCreateMapTable(NSNonOwnedPointerOrNullMapKeyCallBacks, + NSIntegerMapValueCallBacks, 0); _markerCell = [[NSButtonCell alloc] initImageCell: nil]; [_markerCell setBezelStyle: NSDisclosureBezelStyle]; @@ -183,10 +183,12 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item, NSNonOwnedPointerMapValueCallBacks, 0); _itemToLevel = NSCreateMapTable(NSNonOwnedPointerOrNullMapKeyCallBacks, NSIntegerMapValueCallBacks, 0); - _itemToExpansionState = NSCreateMapTable( - NSNonOwnedPointerOrNullMapKeyCallBacks, NSIntegerMapValueCallBacks, 0); - _itemToNumberOfChildren = NSCreateMapTable( - NSNonOwnedPointerOrNullMapKeyCallBacks, NSIntegerMapValueCallBacks, 0); + _itemToExpansionState = + NSCreateMapTable(NSNonOwnedPointerOrNullMapKeyCallBacks, + NSIntegerMapValueCallBacks, 0); + _itemToNumberOfChildren = + NSCreateMapTable(NSNonOwnedPointerOrNullMapKeyCallBacks, + NSIntegerMapValueCallBacks, 0); _markerCell = [[NSButtonCell alloc] initImageCell: nil]; [_markerCell setBezelStyle: NSDisclosureBezelStyle]; @@ -298,17 +300,17 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item, return YES; if ([_delegate respondsToSelector: @selector(outlineView: - shouldExpandItem:)]) + shouldExpandItem:)]) if ([_delegate outlineView: self shouldExpandItem: item] == NO) expandThisItem = NO; if (expandThisItem) { - NSDictionary *userInfo = - [NSDictionary dictionaryWithObjectsAndKeys: item, @"NSObject", nil]; + NSDictionary *userInfo = [NSDictionary + dictionaryWithObjectsAndKeys: item, @"NSObject", nil]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSOutlineViewItemWillExpandNotification - object: self - userInfo: userInfo]; + postNotificationName: NSOutlineViewItemWillExpandNotification + object: self + userInfo: userInfo]; NSMapInsert(_itemToExpansionState, item, (void *) YES); @@ -316,14 +318,14 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item, noteNumberOfRowsChanged = YES; [[NSNotificationCenter defaultCenter] - postNotificationName: NSOutlineViewItemDidExpandNotification - object: self - userInfo: userInfo]; + postNotificationName: NSOutlineViewItemDidExpandNotification + object: self + userInfo: userInfo]; } if (expandChildren) { - int i, - numberOfChildren = numberOfChildrenOfItemAndReload(self, item, YES); + int i, numberOfChildren = + numberOfChildrenOfItemAndReload(self, item, YES); for (i = 0; i < numberOfChildren; ++i) { id child = [_dataSource outlineView: self child: i ofItem: item]; @@ -340,15 +342,15 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item, if ([_dataSource respondsToSelector: @selector (outlineView:objectValueForTableColumn:byItem:)]) return [_dataSource outlineView: self - objectValueForTableColumn: column - byItem: item]; + objectValueForTableColumn: column + byItem: item]; // FIXME: Does it actually send this to the delegate too? - if ([_delegate respondsToSelector: @selector(outlineView: - objectValueForTableColumn:byItem:)]) + if ([_delegate respondsToSelector: @selector + (outlineView:objectValueForTableColumn:byItem:)]) return [_delegate outlineView: self - objectValueForTableColumn: column - byItem: item]; + objectValueForTableColumn: column + byItem: item]; return nil; } @@ -408,17 +410,17 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item, BOOL collapseThisItem = YES; if ([_delegate respondsToSelector: @selector(outlineView: - shouldCollapseItem:)]) + shouldCollapseItem:)]) if ([_delegate outlineView: self shouldCollapseItem: item] == NO) collapseThisItem = NO; if (collapseThisItem) { - NSDictionary *userInfo = - [NSDictionary dictionaryWithObjectsAndKeys: item, @"NSObject", nil]; + NSDictionary *userInfo = [NSDictionary + dictionaryWithObjectsAndKeys: item, @"NSObject", nil]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSOutlineViewItemWillCollapseNotification - object: self - userInfo: userInfo]; + postNotificationName: NSOutlineViewItemWillCollapseNotification + object: self + userInfo: userInfo]; NSMapInsert(_itemToExpansionState, item, (void *) NO); @@ -426,14 +428,14 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item, [self noteNumberOfRowsChanged]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSOutlineViewItemDidCollapseNotification - object: self - userInfo: userInfo]; + postNotificationName: NSOutlineViewItemDidCollapseNotification + object: self + userInfo: userInfo]; } if (collapseChildren) { - NSInteger i, - numberOfChildren = numberOfChildrenOfItemAndReload(self, item, YES); + NSInteger i, numberOfChildren = + numberOfChildrenOfItemAndReload(self, item, YES); for (i = 0; i < numberOfChildren; ++i) { id child = [_dataSource outlineView: self child: i ofItem: item]; @@ -497,7 +499,7 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item, @selector(outlineView:isItemExpandable:), @selector(outlineView:numberOfChildrenOfItem:), @selector(outlineView: - objectValueForTableColumn:byItem:), + objectValueForTableColumn:byItem:), NULL}; NSInteger i; @@ -505,9 +507,9 @@ static inline id childOfItemAtIndex(NSOutlineView *self, id item, if (dataSource != nil && ![dataSource respondsToSelector: requiredSelectors[i]]) [NSException - raise: NSInternalInconsistencyException - format: @"NSOutlineView dataSource does not respond to %@", - NSStringFromSelector(requiredSelectors[i])]; + raise: NSInternalInconsistencyException + format: @"NSOutlineView dataSource does not respond to %@", + NSStringFromSelector(requiredSelectors[i])]; _dataSource = dataSource; } @@ -557,7 +559,7 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, NSHashTable *removeItems) { NSInteger i, - numberOfChildren = numberOfChildrenOfItemAndReload(self, item, YES); + numberOfChildren = numberOfChildrenOfItemAndReload(self, item, YES); for (i = 0; i < numberOfChildren; ++i) { id child = [self->_dataSource outlineView: self child: i ofItem: item]; @@ -582,7 +584,7 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, - (void) loadRootItem { NSHashTable *removeItems = - NSCreateHashTable(NSNonOwnedPointerHashCallBacks, 0); + NSCreateHashTable(NSNonOwnedPointerHashCallBacks, 0); { NSMapEnumerator state = NSEnumerateMapTable(_itemToExpansionState); @@ -611,7 +613,7 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, - (NSRect) frameOfOutlineCellAtRow: (NSInteger) row { NSInteger column = - [_tableColumns indexOfObjectIdenticalTo: _outlineTableColumn]; + [_tableColumns indexOfObjectIdenticalTo: _outlineTableColumn]; NSRect result = [super frameOfCellAtColumn: column row: row]; NSInteger level = [self levelForRow: row]; CGFloat indentPixels = level * _indentationPerLevel; @@ -639,7 +641,7 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, CGFloat cellWidth; cellRect.origin.x += - (indentPixels + _standardRowHeight) + _intercellSpacing.width; + (indentPixels + _standardRowHeight) + _intercellSpacing.width; // instead, give the delegate an opportunity to provide the cell width. // (i was keying on attributed string value width, but this broke when i @@ -656,7 +658,7 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, #if 1 // this is more NSTableView-ish behavior. cellWidth = - cellRect.size.width - (indentPixels + _standardRowHeight); + cellRect.size.width - (indentPixels + _standardRowHeight); #else [dataCell setObjectValue: objectValue]; @@ -671,8 +673,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, cellWidth += _editingCellPadding; cellRect.size.width = - MIN(cellWidth, - cellRect.size.width - (indentPixels + _standardRowHeight)); + MIN(cellWidth, + cellRect.size.width - (indentPixels + _standardRowHeight)); } return cellRect; @@ -683,8 +685,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, if (tableColumn == _outlineTableColumn) { id objectValue = - [self _objectValueForTableColumn: tableColumn - byItem: [self itemAtRow: row]]; + [self _objectValueForTableColumn: tableColumn + byItem: [self itemAtRow: row]]; if (objectValue != nil) return [self _adjustedFrameOfCellAtColumn: column @@ -733,8 +735,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, } if (isItemExpanded(self, item)) { - NSInteger i, - numberOfChildren = numberOfChildrenOfItemAndReload(self, item, NO); + NSInteger i, numberOfChildren = + numberOfChildrenOfItemAndReload(self, item, NO); id lastChild = nil; for (i = 0; i < numberOfChildren; i++) { @@ -745,8 +747,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, if (lastChild != nil) { NSRect rect = myFrame; NSRect lastChildRect = - [self frameOfCellAtColumn: column - row: [self rowForItem: lastChild]]; + [self frameOfCellAtColumn: column + row: [self rowForItem: lastChild]]; CGFloat delta = lastChildRect.origin.y - myFrame.origin.y; // it is safe to assume that all rows are the same height. @@ -788,9 +790,9 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, if ([_delegate respondsToSelector: @selector (outlineView:willDisplayCell:forTableColumn:item:)]) [_delegate outlineView: self - willDisplayCell: result - forTableColumn: column - item: [self itemAtRow: row]]; + willDisplayCell: result + forTableColumn: column + item: [self itemAtRow: row]]; return result; } @@ -844,14 +846,14 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, else [_markerCell setState: NSOffState]; - if ([_delegate - respondsToSelector: @selector - (outlineView: - willDisplayOutlineCell:forTableColumn:item:)]) + if ([_delegate respondsToSelector: @selector + (outlineView: + willDisplayOutlineCell:forTableColumn + :item:)]) [_delegate outlineView: self - willDisplayOutlineCell: _markerCell - forTableColumn: column - item: item]; + willDisplayOutlineCell: _markerCell + forTableColumn: column + item: item]; [_markerCell setControlView: self]; [_markerCell drawWithFrame: outlineCellFrame inView: self]; @@ -894,16 +896,16 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, // - (BOOL) delegateShouldSelectTableColumn: (NSTableColumn *) tableColumn { if ([_delegate respondsToSelector: @selector(outlineView: - shouldSelectTableColumn:)]) + shouldSelectTableColumn:)]) return [_delegate outlineView: self - shouldSelectTableColumn: tableColumn]; + shouldSelectTableColumn: tableColumn]; return YES; } - (BOOL) delegateShouldSelectRow: (NSInteger) row { if ([_delegate respondsToSelector: @selector(outlineView: - shouldSelectItem:)]) + shouldSelectItem:)]) return [_delegate outlineView: self shouldSelectItem: [self itemAtRow: row]]; @@ -914,7 +916,7 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, row: (NSInteger) row { if ([_delegate respondsToSelector: @selector(outlineView: - shouldEditTableColumn:item:)]) + shouldEditTableColumn:item:)]) return [_delegate outlineView: self shouldEditTableColumn: tableColumn item: [self itemAtRow: row]]; @@ -923,8 +925,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, } - (BOOL) delegateSelectionShouldChange { - if ([_delegate - respondsToSelector: @selector(selectionShouldChangeInOutlineView:)]) + if ([_delegate respondsToSelector: @selector + (selectionShouldChangeInOutlineView:)]) return [_delegate selectionShouldChangeInOutlineView: self]; return YES; @@ -932,24 +934,25 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, - (void) noteSelectionIsChanging { [[NSNotificationCenter defaultCenter] - postNotificationName: NSOutlineViewSelectionIsChangingNotification - object: self]; + postNotificationName: NSOutlineViewSelectionIsChangingNotification + object: self]; } - (void) noteSelectionDidChange { [[NSNotificationCenter defaultCenter] - postNotificationName: NSOutlineViewSelectionDidChangeNotification - object: self]; + postNotificationName: NSOutlineViewSelectionDidChangeNotification + object: self]; } - (void) noteColumnDidResizeWithOldWidth: (CGFloat) oldWidth { [[NSNotificationCenter defaultCenter] - postNotificationName: NSOutlineViewColumnDidResizeNotification - object: self - userInfo: [NSDictionary - dictionaryWithObjectsAndKeys: - [NSNumber numberWithFloat: oldWidth], - @"NSOldWidth", nil]]; + postNotificationName: NSOutlineViewColumnDidResizeNotification + object: self + userInfo: [NSDictionary + dictionaryWithObjectsAndKeys: + [NSNumber numberWithFloat: + oldWidth], + @"NSOldWidth", nil]]; } - (BOOL) dataSourceCanSetObjectValue { @@ -971,8 +974,8 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, row: (NSInteger) row { return [_dataSource outlineView: self - objectValueForTableColumn: tableColumn - byItem: [self itemAtRow: row]]; + objectValueForTableColumn: tableColumn + byItem: [self itemAtRow: row]]; } - (void) _willDisplayCell: (NSCell *) cell @@ -982,9 +985,9 @@ static void loadItemIntoMapTables(NSOutlineView *self, id item, if ([_delegate respondsToSelector: @selector (outlineView:willDisplayCell:forTableColumn:item:)]) [_delegate outlineView: self - willDisplayCell: cell - forTableColumn: column - item: [self itemAtRow: row]]; + willDisplayCell: cell + forTableColumn: column + item: [self itemAtRow: row]]; } @end diff --git a/AppKit/NSPDFImageRep.m b/AppKit/NSPDFImageRep.m index aa899c19..79195757 100644 --- a/AppKit/NSPDFImageRep.m +++ b/AppKit/NSPDFImageRep.m @@ -46,7 +46,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _pdf = [data retain]; _currentPage = 0; CGDataProviderRef provider = - CGDataProviderCreateWithCFData((CFDataRef) _pdf); + CGDataProviderCreateWithCFData((CFDataRef) _pdf); _document = CGPDFDocumentCreateWithProvider(provider); CGDataProviderRelease(provider); return self; @@ -126,7 +126,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ CGContextSaveGState(context); CGAffineTransform xform = - CGPDFPageGetDrawingTransform(page, kCGPDFMediaBox, rect, 0, NO); + CGPDFPageGetDrawingTransform(page, kCGPDFMediaBox, rect, 0, NO); CGContextConcatCTM(context, xform); CGContextDrawPDFPage(context, page); diff --git a/AppKit/NSPageLayout.m b/AppKit/NSPageLayout.m index d4061fa2..375ac0ee 100644 --- a/AppKit/NSPageLayout.m +++ b/AppKit/NSPageLayout.m @@ -31,8 +31,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (int) runModalWithPrintInfo: (NSPrintInfo *) printInfo { - return - [[NSDisplay currentDisplay] runModalPageLayoutWithPrintInfo: printInfo]; + return [[NSDisplay currentDisplay] + runModalPageLayoutWithPrintInfo: printInfo]; } - (int) runModal { diff --git a/AppKit/NSPanel.m b/AppKit/NSPanel.m index 20fd0212..34417347 100644 --- a/AppKit/NSPanel.m +++ b/AppKit/NSPanel.m @@ -90,8 +90,8 @@ NSInteger NSRunAlertPanel(NSString *title, NSString *format, va_list arguments; va_start(arguments, otherButton); NSString *message = - [[[NSString alloc] initWithFormat: format - arguments: arguments] autorelease]; + [[[NSString alloc] initWithFormat: format + arguments: arguments] autorelease]; NSPanel *panel = [[NSAlertPanel alloc] initWithTitle: title message: message @@ -113,8 +113,8 @@ NSInteger NSRunInformationalAlertPanel(NSString *title, NSString *format, va_list arguments; va_start(arguments, otherButton); NSString *message = - [[[NSString alloc] initWithFormat: format - arguments: arguments] autorelease]; + [[[NSString alloc] initWithFormat: format + arguments: arguments] autorelease]; // FIXME: Should have a different icon. return NSRunAlertPanel(title, @"%@", defaultButton, alternateButton, @@ -129,8 +129,8 @@ NSInteger NSRunCriticalAlertPanel(NSString *title, NSString *format, va_list arguments; va_start(arguments, otherButton); NSString *message = - [[[NSString alloc] initWithFormat: format - arguments: arguments] autorelease]; + [[[NSString alloc] initWithFormat: format + arguments: arguments] autorelease]; // FIXME: Should have a different icon. return NSRunAlertPanel(title, @"%@", defaultButton, alternateButton, @@ -146,8 +146,8 @@ void NSBeginAlertSheet(NSString *title, NSString *defaultButton, va_list arguments; va_start(arguments, format); NSString *message = - [[[NSString alloc] initWithFormat: format - arguments: arguments] autorelease]; + [[[NSString alloc] initWithFormat: format + arguments: arguments] autorelease]; NSPanel *panel = [[[NSAlertPanel alloc] initWithTitle: title message: message @@ -157,10 +157,10 @@ void NSBeginAlertSheet(NSString *title, NSString *defaultButton, sheet: YES] autorelease]; [NSApp beginSheet: panel - modalForWindow: window - modalDelegate: modalDelegate - didEndSelector: didEndSelector - contextInfo: contextInfo]; + modalForWindow: window + modalDelegate: modalDelegate + didEndSelector: didEndSelector + contextInfo: contextInfo]; } void NSBeginCriticalAlertSheet(NSString *title, NSString *defaultButton, @@ -172,8 +172,8 @@ void NSBeginCriticalAlertSheet(NSString *title, NSString *defaultButton, va_list arguments; va_start(arguments, format); NSString *message = - [[[NSString alloc] initWithFormat: format - arguments: arguments] autorelease]; + [[[NSString alloc] initWithFormat: format + arguments: arguments] autorelease]; // FIXME: Should probably have different icon or so. NSBeginAlertSheet(title, defaultButton, alternateButton, otherButton, @@ -191,8 +191,8 @@ void NSBeginInformationalAlertSheet(NSString *title, NSString *defaultButton, va_list arguments; va_start(arguments, format); NSString *message = - [[[NSString alloc] initWithFormat: format - arguments: arguments] autorelease]; + [[[NSString alloc] initWithFormat: format + arguments: arguments] autorelease]; // FIXME: Should probably have different icon or so. NSBeginAlertSheet(title, defaultButton, alternateButton, otherButton, diff --git a/AppKit/NSParagraphStyle.m b/AppKit/NSParagraphStyle.m index 7c33463a..61d8ccda 100644 --- a/AppKit/NSParagraphStyle.m +++ b/AppKit/NSParagraphStyle.m @@ -42,9 +42,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSTextTab *tabs[count]; for (i = 0; i < count; i++) { - tabs[i] = - [[[NSTextTab alloc] initWithType: NSLeftTabStopType - location: (i + 1) * 28.0] autorelease]; + tabs[i] = [[[NSTextTab alloc] initWithType: NSLeftTabStopType + location: (i + 1) * 28.0] + autorelease]; } shared = [[NSArray alloc] initWithObjects: tabs count: count]; } @@ -79,12 +79,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _writingDirection = [coder decodeIntForKey: @"BaseWritingDirection"]; _paragraphSpacing = [coder decodeFloatForKey: @"ParagraphSpacing"]; _paragraphSpacingBefore = - [coder decodeFloatForKey: @"ParagraphSpacingBefore"]; + [coder decodeFloatForKey: @"ParagraphSpacingBefore"]; _textBlocks = [[coder decodeObjectForKey: @"Blocks"] retain]; _textLists = [coder decodeObjectForKey: @"Lists"]; _headerLevel = [coder decodeIntForKey: @"HeaderLevel"]; _firstLineHeadIndent = - [coder decodeFloatForKey: @"FirstLineHeadIndent"]; + [coder decodeFloatForKey: @"FirstLineHeadIndent"]; _headIndent = [coder decodeFloatForKey: @"HeadIndent"]; _tailIndent = [coder decodeFloatForKey: @"TailIndent"]; _alignment = [coder decodeIntForKey: @"Alignment"]; @@ -97,7 +97,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _tabStops = [[coder decodeObjectForKey: @"Tabs"] retain]; _hyphenationFactor = [coder decodeFloatForKey: @"HyphenationFactor"]; _tighteningFactorForTruncation = - [coder decodeFloatForKey: @"TighteningFactor"]; + [coder decodeFloatForKey: @"TighteningFactor"]; } else { [NSException raise: NSInvalidArgumentException format: @"-[%@ %s] is not implemented for coder %@", @@ -181,7 +181,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static inline id mutableCopyWithZone(NSParagraphStyle *self, NSZone *zone) { return [[NSMutableParagraphStyle allocWithZone: zone] - initWithParagraphStyle: self]; + initWithParagraphStyle: self]; } - mutableCopy { @@ -292,7 +292,7 @@ static inline id mutableCopyWithZone(NSParagraphStyle *self, NSZone *zone) { _defaultTabInterval == other->_defaultTabInterval && _hyphenationFactor == other->_hyphenationFactor && _tighteningFactorForTruncation == - other->_tighteningFactorForTruncation && + other->_tighteningFactorForTruncation && (_tabStops == other->_tabStops || [_tabStops isEqual: other->_tabStops]) && (_textBlocks == other->_textBlocks || @@ -308,44 +308,48 @@ static inline id mutableCopyWithZone(NSParagraphStyle *self, NSZone *zone) { switch ([tab tabStopType]) { case NSLeftTabStopType: [tabsString - appendString: [NSString - stringWithFormat: @"%fL", [tab location]]]; + appendString: [NSString stringWithFormat: @"%fL", + [tab location]]]; break; case NSRightTabStopType: [tabsString - appendString: [NSString - stringWithFormat: @"%fR", [tab location]]]; + appendString: [NSString stringWithFormat: @"%fR", + [tab location]]]; break; case NSCenterTabStopType: [tabsString - appendString: [NSString - stringWithFormat: @"%fC", [tab location]]]; + appendString: [NSString stringWithFormat: @"%fC", + [tab location]]]; break; case NSDecimalTabStopType: [tabsString - appendString: [NSString - stringWithFormat: @"%fD", [tab location]]]; + appendString: [NSString stringWithFormat: @"%fD", + [tab location]]]; break; } } [tabsString appendString: @")"]; return [NSString - stringWithFormat: - @"Alignment %d, LineSpacing %f, ParagraphSpacing %f, " - @"ParagraphSpacingBefore %f, HeadIndent %f, TailIndent %f, " - @"FirstLineHeadIndent %f, " - @"LineHeight %f/%f, LineHeightMultiple %f, LineBreakMode %d, Tabs " - @"%@, " - @"DefaultTabInterval %f, Blocks %@, Lists %@, BaseWritingDirection " - @"%d, " - @"HyphenationFactor %f, TighteningFactor %f, HeaderLevel %d", - _alignment, _lineSpacing, _paragraphSpacing, - _paragraphSpacingBefore, _headIndent, _tailIndent, - _firstLineHeadIndent, _minimumLineHeight, _maximumLineHeight, - _lineHeightMultiple, _lineBreakMode, tabsString, - _defaultTabInterval, _textBlocks, _textLists, _writingDirection, - _hyphenationFactor, _tighteningFactorForTruncation, _headerLevel]; + stringWithFormat: + @"Alignment %d, LineSpacing %f, ParagraphSpacing %f, " + @"ParagraphSpacingBefore %f, HeadIndent %f, TailIndent %f, " + @"FirstLineHeadIndent %f, " + @"LineHeight %f/%f, LineHeightMultiple %f, LineBreakMode " + @"%d, Tabs " + @"%@, " + @"DefaultTabInterval %f, Blocks %@, Lists %@, " + @"BaseWritingDirection " + @"%d, " + @"HyphenationFactor %f, TighteningFactor %f, HeaderLevel " + @"%d", + _alignment, _lineSpacing, _paragraphSpacing, + _paragraphSpacingBefore, _headIndent, _tailIndent, + _firstLineHeadIndent, _minimumLineHeight, + _maximumLineHeight, _lineHeightMultiple, _lineBreakMode, + tabsString, _defaultTabInterval, _textBlocks, _textLists, + _writingDirection, _hyphenationFactor, + _tighteningFactorForTruncation, _headerLevel]; } @end diff --git a/AppKit/NSPasteboard.m b/AppKit/NSPasteboard.m index 2368b315..8da41308 100644 --- a/AppKit/NSPasteboard.m +++ b/AppKit/NSPasteboard.m @@ -50,11 +50,11 @@ const NSPasteboardType NSURLPboardType = @"NSURLPboardType"; const NSPasteboardType NSHTMLPboardType = @"Apple HTML pasteboard type"; const NSPasteboardType NSFilesPromisePboardType = - @"Apple files promise pasteboard type"; + @"Apple files promise pasteboard type"; const NSPasteboardName NSPasteboardNameDrag = @"Apple CFPasteboard drag"; NSString *const NSPasteboardURLReadingFileURLsOnlyKey = - @"NSPasteboardURLReadingFileURLsOnlyKey"; + @"NSPasteboardURLReadingFileURLsOnlyKey"; const NSPasteboardName NSDragPboard = @"NSDragPboard"; const NSPasteboardName NSFindPboard = @"NSFindPboard"; @@ -65,8 +65,8 @@ const NSPasteboardName NSRulerPboard = @"NSRulerPboard"; const NSPasteboardName NSPasteboardNameGeneral = @"Apple CFPasteboard general"; const NSPasteboardReadingOptionKey - NSPasteboardURLReadingContentsConformToTypesKey = - @"NSPasteboardURLReadingContentsConformToTypesKey"; + NSPasteboardURLReadingContentsConformToTypesKey = + @"NSPasteboardURLReadingContentsConformToTypesKey"; @implementation NSPasteboard @@ -121,19 +121,19 @@ const NSPasteboardReadingOptionKey - (NSString *) stringForType: (NSPasteboardType) type { NSData *data = [self dataForType: type]; - return - [[[NSString alloc] initWithData: data - encoding: NSUnicodeStringEncoding] autorelease]; + return [[[NSString alloc] initWithData: data + encoding: NSUnicodeStringEncoding] + autorelease]; } - (id) propertyListForType: (NSPasteboardType) type { NSData *data = [self dataForType: type]; NSString *errorDesc = nil; id plist = [NSPropertyListSerialization - propertyListFromData: data - mutabilityOption: NSPropertyListImmutable - format: NULL - errorDescription: &errorDesc]; + propertyListFromData: data + mutabilityOption: NSPropertyListImmutable + format: NULL + errorDescription: &errorDesc]; if (plist && errorDesc == nil) { return plist; } @@ -168,9 +168,9 @@ const NSPasteboardReadingOptionKey - (BOOL) setPropertyList: (id) plist forType: (NSPasteboardType) type { NSString *errorDesc = nil; NSData *data = [NSPropertyListSerialization - dataFromPropertyList: plist - format: NSPropertyListXMLFormat_v1_0 - errorDescription: &errorDesc]; + dataFromPropertyList: plist + format: NSPropertyListXMLFormat_v1_0 + errorDescription: &errorDesc]; if (data && errorDesc == nil) { return [self setData: data forType: type]; } diff --git a/AppKit/NSPathCell.m b/AppKit/NSPathCell.m index 016eba0d..ea5f62cf 100644 --- a/AppKit/NSPathCell.m +++ b/AppKit/NSPathCell.m @@ -17,12 +17,11 @@ } [self setPlaceholderString: - [coder decodeObjectForKey: @"NSPlaceholderString"]]; - [self - setBackgroundColor: [coder - decodeObjectForKey: @"NSBackgroundColor"]]; + [coder decodeObjectForKey: @"NSPlaceholderString"]]; + [self setBackgroundColor: + [coder decodeObjectForKey: @"NSBackgroundColor"]]; [self setPathComponentCells: - [coder decodeObjectForKey: @"NSPathComponentCells"]]; + [coder decodeObjectForKey: @"NSPathComponentCells"]]; [self setPathStyle: [coder decodeIntForKey: @"NSPathStyle"]]; _delegate = [coder decodeObjectForKey: @"NSDelegate"]; [self setAllowedTypes: [coder decodeObjectForKey: @"NSAllowedTypes"]]; @@ -106,8 +105,8 @@ - (void) setPlaceholderString: (NSString *) string { [self setPlaceholderAttributedString: [[[NSAttributedString alloc] - initWithString: string] - autorelease]]; + initWithString: string] + autorelease]]; } - (NSColor *) backgroundColor { @@ -172,9 +171,9 @@ } - (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) cellFrame - ofView: (NSView *) controlView - untilMouseUp: (BOOL) untilMouseUp + inRect: (NSRect) cellFrame + ofView: (NSView *) controlView + untilMouseUp: (BOOL) untilMouseUp { do { @@ -183,14 +182,15 @@ [_clickPathComponentCell release]; _clickPathComponentCell = - [[self pathComponentCellAtPoint: point - withFrame: cellFrame - inView: controlView] retain]; + [[self pathComponentCellAtPoint: point + withFrame: cellFrame + inView: controlView] retain]; [controlView setNeedsDisplay: YES]; event = [[controlView window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while ([event type] != NSLeftMouseUp); @@ -252,9 +252,9 @@ [currentPath appendString: path]; NSURL *currentURL = - [[[NSURL alloc] initWithScheme: scheme - host: host - path: currentPath] autorelease]; + [[[NSURL alloc] initWithScheme: scheme + host: host + path: currentPath] autorelease]; NSString *title; NSImage *image; @@ -263,12 +263,12 @@ image = [ws iconForFile: currentPath]; } else { title = [path stringByReplacingPercentEscapesUsingEncoding: - NSUTF8StringEncoding]; + NSUTF8StringEncoding]; image = nil; } NSPathComponentCell *cell = - [[[pcClass alloc] initTextCell: nil] autorelease]; + [[[pcClass alloc] initTextCell: nil] autorelease]; [cell setURL: currentURL]; [cell setImage: image]; [cell setStringValue: title]; diff --git a/AppKit/NSPathComponentCell.m b/AppKit/NSPathComponentCell.m index fa01b481..baafccb4 100644 --- a/AppKit/NSPathComponentCell.m +++ b/AppKit/NSPathComponentCell.m @@ -26,7 +26,7 @@ NSFont *font = [self font]; return [NSDictionary - dictionaryWithObjectsAndKeys: font, NSFontAttributeName, nil]; + dictionaryWithObjectsAndKeys: font, NSFontAttributeName, nil]; } - (void) drawWithFrame: (NSRect) frame inView: (NSView *) view { @@ -46,9 +46,9 @@ frame.origin.x += iconRect.size.width + 2; [icon drawInRect: iconRect - fromRect: NSZeroRect - operation: NSCompositeSourceOver - fraction: 1.0]; + fromRect: NSZeroRect + operation: NSCompositeSourceOver + fraction: 1.0]; } [title drawAtPoint: frame.origin withAttributes: [self textAttributes]]; @@ -56,7 +56,7 @@ - (NSSize) cellSize { NSSize textSize = - [[self stringValue] sizeWithAttributes: [self textAttributes]]; + [[self stringValue] sizeWithAttributes: [self textAttributes]]; if ([self image]) textSize.width += textSize.height; diff --git a/AppKit/NSPersistentDocument.h b/AppKit/NSPersistentDocument.h index 33817253..5026222a 100644 --- a/AppKit/NSPersistentDocument.h +++ b/AppKit/NSPersistentDocument.h @@ -29,12 +29,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSManagedObjectContext *) managedObjectContext; - (NSManagedObjectModel *) managedObjectModel; - (void) setManagedObjectContext: - (NSManagedObjectContext *) managedObjectContext; + (NSManagedObjectContext *) managedObjectContext; - (BOOL) configurePersistentStoreCoordinatorForURL: (NSURL *) url ofType: (NSString *) fileType modelConfiguration: (NSString *) configuration storeOptions: - (NSDictionary *) storeOptions + (NSDictionary *) storeOptions error: (NSError **) error; - (NSString *) persistentStoreTypeForFileType: (NSString *) fileType; @@ -50,9 +50,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ofType: (NSString *) inTypeName error: (NSError **) outError; - (BOOL) writeToURL: (NSURL *) absoluteURL - ofType: (NSString *) typeName - forSaveOperation: (NSSaveOperationType) saveOperation - originalContentsURL: (NSURL *) absoluteOriginalContentsURL - error: (NSError **) error; + ofType: (NSString *) typeName + forSaveOperation: (NSSaveOperationType) saveOperation + originalContentsURL: (NSURL *) absoluteOriginalContentsURL + error: (NSError **) error; @end diff --git a/AppKit/NSPoofAnimation.h b/AppKit/NSPoofAnimation.h index 530d258d..92169118 100644 --- a/AppKit/NSPoofAnimation.h +++ b/AppKit/NSPoofAnimation.h @@ -11,9 +11,9 @@ @interface NSPoofAnimation : NSObject + (void) poofAtLocation: (NSPoint) location - size: (NSSize) size - animationDelegate: (id) animationDelegate - didEndSelector: (SEL) didEndSelector - contextInfo: (void *) contextInfo; + size: (NSSize) size + animationDelegate: (id) animationDelegate + didEndSelector: (SEL) didEndSelector + contextInfo: (void *) contextInfo; @end diff --git a/AppKit/NSPoofAnimation.m b/AppKit/NSPoofAnimation.m index 1ba03f77..c6aff3fd 100644 --- a/AppKit/NSPoofAnimation.m +++ b/AppKit/NSPoofAnimation.m @@ -32,7 +32,7 @@ static const NSTimeInterval kAnimationDuration = .3; + (NSSize) poofImageSize { NSSize poofImageSize = [[self poofImages] size]; poofImageSize.width = poofImageSize.height = - MIN(poofImageSize.width, poofImageSize.height); + MIN(poofImageSize.width, poofImageSize.height); return poofImageSize; } @@ -94,10 +94,10 @@ static const NSTimeInterval kAnimationDuration = .3; @implementation NSPoofAnimation + (void) poofAtLocation: (NSPoint) location - size: (NSSize) size - animationDelegate: (id) animationDelegate - didEndSelector: (SEL) didEndSelector - contextInfo: (void *) contextInfo + size: (NSSize) size + animationDelegate: (id) animationDelegate + didEndSelector: (SEL) didEndSelector + contextInfo: (void *) contextInfo { if (size.width == 0 || size.height == 0) { size.width = size.height = 48; @@ -109,14 +109,14 @@ static const NSTimeInterval kAnimationDuration = .3; // Create a transparent window with a poof view - it will be closed when the // animation is done NSWindow *window = - [[NSWindow alloc] initWithContentRect: r - styleMask: NSBorderlessWindowMask - backing: NSBackingStoreBuffered - defer: NO]; + [[NSWindow alloc] initWithContentRect: r + styleMask: NSBorderlessWindowMask + backing: NSBackingStoreBuffered + defer: NO]; [window setHasShadow: NO]; NSPoofView *poofView = - [[[NSPoofView alloc] initWithFrame: window.frame] autorelease]; + [[[NSPoofView alloc] initWithFrame: window.frame] autorelease]; [poofView setAnimationDelegate: animationDelegate]; [poofView setDidEndSelector: didEndSelector]; [poofView setContextInfo: contextInfo]; @@ -130,13 +130,13 @@ static const NSTimeInterval kAnimationDuration = .3; [window setBackgroundColor: [NSColor clearColor]]; [window orderFront: nil]; - NSTimer *timer = - [NSTimer timerWithTimeInterval: kAnimationDuration / - ([NSPoofView numberOfPoofImages] - 1) - target: poofView - selector: @selector(poof:) - userInfo: nil - repeats: YES]; + NSTimer *timer = [NSTimer + timerWithTimeInterval: kAnimationDuration / + ([NSPoofView numberOfPoofImages] - 1) + target: poofView + selector: @selector(poof:) + userInfo: nil + repeats: YES]; [[NSRunLoop currentRunLoop] addTimer: timer forMode: NSRunLoopCommonModes]; [[NSRunLoop currentRunLoop] addTimer: timer forMode: NSDefaultRunLoopMode]; } diff --git a/AppKit/NSPopUpButton.m b/AppKit/NSPopUpButton.m index 79fd1f09..61e2d40b 100644 --- a/AppKit/NSPopUpButton.m +++ b/AppKit/NSPopUpButton.m @@ -23,10 +23,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSPopUpButtonWillPopUpNotification = - @"NSPopUpButtonWillPopUpNotification"; + @"NSPopUpButtonWillPopUpNotification"; static NSString *const NSPopUpButtonBindingObservationContext = - @"NSPopUpButtonBindingObservationContext"; + @"NSPopUpButtonBindingObservationContext"; @implementation NSPopUpButton @@ -46,7 +46,7 @@ static NSString *const NSPopUpButtonBindingObservationContext = NS_HANDLER NS_ENDHANDLER - [super dealloc]; + [super dealloc]; } - (BOOL) pullsDown { @@ -216,9 +216,9 @@ static NSString *const NSPopUpButtonBindingObservationContext = - (void) performClick: sender { if ([_cell trackMouse: [NSApp currentEvent] - inRect: [self bounds] - ofView: self - untilMouseUp: NO]) { + inRect: [self bounds] + ofView: self + untilMouseUp: NO]) { NSMenuItem *item = [self selectedItem]; SEL action = [item action]; id target = [item target]; @@ -250,9 +250,9 @@ static NSString *const NSPopUpButtonBindingObservationContext = [self performClick: self]; #else if ([_cell trackMouse: event - inRect: [self bounds] - ofView: self - untilMouseUp: NO]) { + inRect: [self bounds] + ofView: self + untilMouseUp: NO]) { NSMenuItem *item = [self selectedItem]; SEL action = [item action]; id target = [item target]; @@ -367,28 +367,28 @@ static NSString *const NSPopUpButtonBindingObservationContext = } - (void) bind: (NSString *) binding - toObject: (id) observable - withKeyPath: (NSString *) keyPath - options: (NSDictionary *) options + toObject: (id) observable + withKeyPath: (NSString *) keyPath + options: (NSDictionary *) options { // No need to observe the same thing many times when we have several // bindings if (!_observerAdded) { _observerAdded = YES; [self addObserver: self - forKeyPath: @"cell.menu.itemArray" - options: NSKeyValueObservingOptionPrior - context: NSPopUpButtonBindingObservationContext]; + forKeyPath: @"cell.menu.itemArray" + options: NSKeyValueObservingOptionPrior + context: NSPopUpButtonBindingObservationContext]; [self addObserver: self - forKeyPath: @"cell.selectedItem" - options: NSKeyValueObservingOptionPrior - context: NSPopUpButtonBindingObservationContext]; + forKeyPath: @"cell.selectedItem" + options: NSKeyValueObservingOptionPrior + context: NSPopUpButtonBindingObservationContext]; } [super bind: binding - toObject: observable - withKeyPath: keyPath - options: options]; + toObject: observable + withKeyPath: keyPath + options: options]; } - (void) observeValueForKeyPath: (NSString *) keyPath @@ -399,7 +399,7 @@ static NSString *const NSPopUpButtonBindingObservationContext = if (context == NSPopUpButtonBindingObservationContext) { if ([keyPath isEqualToString: @"cell.selectedItem"]) { if ([[change objectForKey: NSKeyValueChangeNotificationIsPriorKey] - boolValue]) { + boolValue]) { [self willChangeValueForKey: @"selectedIndex"]; [self willChangeValueForKey: @"selectedValue"]; [self willChangeValueForKey: @"selectedObject"]; @@ -413,7 +413,7 @@ static NSString *const NSPopUpButtonBindingObservationContext = } } else { if ([[change objectForKey: NSKeyValueChangeNotificationIsPriorKey] - boolValue]) { + boolValue]) { [self willChangeValueForKey: @"contentValues"]; } else { [self didChangeValueForKey: @"contentValues"]; diff --git a/AppKit/NSPopUpButtonCell.m b/AppKit/NSPopUpButtonCell.m index 17c8e2f7..2f009a42 100644 --- a/AppKit/NSPopUpButtonCell.m +++ b/AppKit/NSPopUpButtonCell.m @@ -351,7 +351,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_arrowPosition != NSPopUpNoArrow) { NSImage *arrowImage = - (_arrowPosition != NSPopUpNoArrow) ? [self arrowImage] : NULL; + (_arrowPosition != NSPopUpNoArrow) ? [self arrowImage] : NULL; if (arrowImage != nil) { @@ -372,10 +372,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } NSRect otherFrame = frame; NSSize arrowSize = [arrowImage size]; - otherFrame.origin.x += - otherFrame.size.width - (arrowSize.width + (4 - sizeFactor)); + otherFrame.origin.x += otherFrame.size.width - + (arrowSize.width + (4 - sizeFactor)); otherFrame.origin.y += - (otherFrame.size.height - arrowSize.height) / 2; + (otherFrame.size.height - arrowSize.height) / 2; otherFrame.size = arrowSize; result = NSInsetRect(otherFrame, sizeFactor, sizeFactor); @@ -401,7 +401,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Now draw the arrow if (_arrowPosition != NSPopUpNoArrow) { NSImage *arrowImage = - (_arrowPosition != NSPopUpNoArrow) ? [self arrowImage] : NULL; + (_arrowPosition != NSPopUpNoArrow) ? [self arrowImage] : NULL; if (arrowImage == NULL) return; @@ -483,9 +483,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) cellFrame - ofView: (NSView *) controlView - untilMouseUp: (BOOL) flag + inRect: (NSRect) cellFrame + ofView: (NSView *) controlView + untilMouseUp: (BOOL) flag { NSPoint origin = [controlView bounds].origin; @@ -521,8 +521,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [menu update]; NSPopUpWindow *window = [[NSPopUpWindow alloc] - initWithFrame: NSMakeRect(origin.x, origin.y, cellFrame.size.width, - cellFrame.size.height)]; + initWithFrame: NSMakeRect(origin.x, origin.y, cellFrame.size.width, + cellFrame.size.height)]; [window setPullsDown: _pullsDown]; [window setMenu: menu]; if ([self font] != nil) diff --git a/AppKit/NSPopUpView.m b/AppKit/NSPopUpView.m index 55fa2e23..1d6efdcd 100644 --- a/AppKit/NSPopUpView.m +++ b/AppKit/NSPopUpView.m @@ -45,7 +45,7 @@ static const NSTimeInterval kMenuInitialClickThreshold = .3f; // Note: moved these above init to avoid compiler warnings - (NSDictionary *) itemAttributes { return [NSDictionary - dictionaryWithObjectsAndKeys: _font, NSFontAttributeName, nil]; + dictionaryWithObjectsAndKeys: _font, NSFontAttributeName, nil]; } - (NSArray *) visibleItemArray { @@ -77,8 +77,8 @@ static const NSTimeInterval kMenuInitialClickThreshold = .3f; BOOL anItemHasAnImage = NO; CGFloat maxKeyWidth = 0.0f; CGFloat totalHeight = - WINDOW_BORDER_THICKNESS; // border. Magic constants that may not be - // right for Win7 vs XP + WINDOW_BORDER_THICKNESS; // border. Magic constants that may not be + // right for Win7 vs XP NSSize gutterSize = [[self graphicsStyle] menuItemGutterSize]; NSSize rightArrowSize = [[self graphicsStyle] menuItemBranchArrowSize]; unsigned i, count = [items count]; @@ -109,19 +109,19 @@ static const NSTimeInterval kMenuInitialClickThreshold = .3f; if ([item attributedTitle]) { size = [[self graphicsStyle] - menuItemAttributedTextSize: [item attributedTitle]]; + menuItemAttributedTextSize: [item attributedTitle]]; } else { if (useCustomFont) { NSDictionary *attributes = [self itemAttributes]; NSAttributedString *attributedTitle = - [[[NSAttributedString alloc] - initWithString: [item title] - attributes: attributes] autorelease]; + [[[NSAttributedString alloc] + initWithString: [item title] + attributes: attributes] autorelease]; size = [[self graphicsStyle] - menuItemAttributedTextSize: attributedTitle]; + menuItemAttributedTextSize: attributedTitle]; } else { - size = - [[self graphicsStyle] menuItemTextSize: [item title]]; + size = [[self graphicsStyle] + menuItemTextSize: [item title]]; } } titleAndIconWidth += size.width; @@ -130,7 +130,7 @@ static const NSTimeInterval kMenuInitialClickThreshold = .3f; if ([[item keyEquivalent] length] != 0) { size = [[self graphicsStyle] - menuItemTextSize: [item _keyEquivalentDescription]]; + menuItemTextSize: [item _keyEquivalentDescription]]; maxKeyWidth = MAX(maxKeyWidth, size.width); height = MAX(height, size.height); } @@ -277,9 +277,9 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { origin = itemRect.origin; if ([item isSeparatorItem]) { - NSRect separatorRect = - NSMakeRect(origin.x, origin.y, NSWidth(itemArea), - [[self graphicsStyle] menuItemSeparatorSize].height); + NSRect separatorRect = NSMakeRect( + origin.x, origin.y, NSWidth(itemArea), + [[self graphicsStyle] menuItemSeparatorSize].height); [[self graphicsStyle] drawMenuSeparatorInRect: separatorRect]; @@ -299,8 +299,8 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { NSSize partSize; BOOL showsEnabled = ([item isEnabled] || [item hasSubmenu]); - partRect = - NSMakeRect(origin.x, origin.y, itemArea.size.width, itemHeight); + partRect = NSMakeRect(origin.x, origin.y, itemArea.size.width, + itemHeight); if (selected) [[self graphicsStyle] drawMenuSelectionInRect: partRect @@ -308,7 +308,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { // Draw the gutter and checkmark (if any) CENTER_PART_RECT_VERTICALLY( - [[self graphicsStyle] menuItemGutterSize]); + [[self graphicsStyle] menuItemGutterSize]); if ([item state] || _initialSelectedIndex == i) { [[self graphicsStyle] drawMenuGutterInRect: partRect]; [[self graphicsStyle] drawMenuCheckmarkInRect: partRect @@ -326,7 +326,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { CENTER_PART_RECT_VERTICALLY([image size]); CGContextRef ctx = - [[NSGraphicsContext currentContext] graphicsPort]; + [[NSGraphicsContext currentContext] graphicsPort]; CGContextSaveGState(ctx); CGContextTranslateCTM(ctx, partRect.origin.x, partRect.origin.y); @@ -350,8 +350,8 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { NSAttributedString *atitle = [item attributedTitle]; if (atitle != nil && [atitle length] > 0) { - CENTER_PART_RECT_VERTICALLY( - [[self graphicsStyle] menuItemAttributedTextSize: atitle]); + CENTER_PART_RECT_VERTICALLY([[self graphicsStyle] + menuItemAttributedTextSize: atitle]); #if WINDOWS // On Windows, when using the AGG graphics context, enabling // font smoothing switches to using AGG for text drawing, @@ -365,9 +365,9 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { // without any special attributes It would probably be better to // add font caching to the regular Win32 drawing context CGContextSetShouldSmoothFonts( - (CGContextRef)[ - [NSGraphicsContext currentContext] graphicsPort], - YES); + (CGContextRef)[[NSGraphicsContext + currentContext] graphicsPort], + YES); #endif [[self graphicsStyle] drawAttributedMenuItemText: atitle inRect: partRect @@ -387,27 +387,27 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { // without any special attributes It would probably be better to // add font caching to the regular Win32 drawing context CGContextSetShouldSmoothFonts( - (CGContextRef)[ - [NSGraphicsContext currentContext] graphicsPort], - NO); + (CGContextRef)[[NSGraphicsContext + currentContext] graphicsPort], + NO); #endif NSString *title = [item title]; if (useCustomFont) { NSDictionary *attributes = [self itemAttributes]; NSAttributedString *attributedTitle = - [[[NSAttributedString alloc] initWithString: title - attributes: attributes] - autorelease]; + [[[NSAttributedString alloc] + initWithString: title + attributes: attributes] autorelease]; CENTER_PART_RECT_VERTICALLY([[self graphicsStyle] - menuItemAttributedTextSize: attributedTitle]); + menuItemAttributedTextSize: attributedTitle]); [[self graphicsStyle] - drawAttributedMenuItemText: attributedTitle - inRect: partRect - enabled: showsEnabled - selected: selected]; + drawAttributedMenuItemText: attributedTitle + inRect: partRect + enabled: showsEnabled + selected: selected]; } else { CENTER_PART_RECT_VERTICALLY( - [[self graphicsStyle] menuItemTextSize: title]); + [[self graphicsStyle] menuItemTextSize: title]); [[self graphicsStyle] drawMenuItemText: title inRect: partRect enabled: showsEnabled @@ -419,9 +419,9 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { if ([[item keyEquivalent] length] != 0) { NSString *keyString = [item _keyEquivalentDescription]; NSSize branchArrowSize = - [[self graphicsStyle] menuItemBranchArrowSize]; + [[self graphicsStyle] menuItemBranchArrowSize]; NSSize keyEquivalentSize = - [[self graphicsStyle] menuItemTextSize: keyString]; + [[self graphicsStyle] menuItemTextSize: keyString]; partRect.origin.x = origin.x + NSWidth(itemArea) - branchArrowSize.width - @@ -436,9 +436,9 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { // Draw the submenu arrow if ([item hasSubmenu]) { NSSize branchArrowSize = - [[self graphicsStyle] menuItemBranchArrowSize]; + [[self graphicsStyle] menuItemBranchArrowSize]; partRect.origin.x = - origin.x + NSWidth(itemArea) - branchArrowSize.width; + origin.x + NSWidth(itemArea) - branchArrowSize.width; partRect.size.width = branchArrowSize.width; CENTER_PART_RECT_VERTICALLY(branchArrowSize); [[self graphicsStyle] drawMenuBranchArrowInRect: partRect @@ -534,7 +534,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { BOOL cancelled = NO; NSRect screenVisible = - NSInsetRect([[[self window] screen] visibleFrame], 0, 4); + NSInsetRect([[[self window] screen] visibleFrame], 0, 4); [NSEvent startPeriodicEventsAfterDelay: .0 withPeriod: .02]; BOOL mouseMoved = NO; @@ -553,9 +553,10 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { } event = [[self window] - nextEventMatchingMask: NSPeriodicMask | NSLeftMouseUpMask | - NSMouseMovedMask | NSLeftMouseDraggedMask | - NSKeyDownMask | NSAppKitDefinedMask]; + nextEventMatchingMask: NSPeriodicMask | NSLeftMouseUpMask | + NSMouseMovedMask | + NSLeftMouseDraggedMask | NSKeyDownMask | + NSAppKitDefinedMask]; if (firstTimestamp == 0.) { // Note: we don't do that using the first event, because in case the // menu takes a long of time to display, the next event we get will @@ -629,7 +630,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { case STATE_FIRSTMOUSEDOWN: if ([event type] == NSLeftMouseUp) { if (mouseMoved || [event timestamp] - firstTimestamp > - kMenuInitialClickThreshold) { + kMenuInitialClickThreshold) { // Long click - accept the selection state = STATE_EXIT; } else { @@ -726,7 +727,7 @@ static NSRect boundsToTitleAreaRect(NSRect rect) { // We're intercepting insertText: so we can do menu navigation by letter unichar ch = [aString characterAtIndex: 0]; NSString *letterString = - [[NSString stringWithCharacters: &ch length: 1] uppercaseString]; + [[NSString stringWithCharacters: &ch length: 1] uppercaseString]; NSInteger oldIndex = _selectedIndex; diff --git a/AppKit/NSPopUpWindow.m b/AppKit/NSPopUpWindow.m index e49cabeb..0aa170d7 100644 --- a/AppKit/NSPopUpWindow.m +++ b/AppKit/NSPopUpWindow.m @@ -30,7 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _releaseWhenClosed = YES; _view = [[NSPopUpView alloc] - initWithFrame: NSMakeRect(0, 0, frame.size.width, frame.size.height)]; + initWithFrame: NSMakeRect(0, 0, frame.size.width, + frame.size.height)]; [[self contentView] addSubview: _view]; return self; @@ -65,7 +66,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ frame = [self frame]; frame.size = size; frame.origin.y -= - (size.height - selectedRect.origin.y) - selectedRect.size.height; + (size.height - selectedRect.origin.y) - selectedRect.size.height; [self setFrame: frame display: NO]; [_view setFrameSize: size]; diff --git a/AppKit/NSPopover.m b/AppKit/NSPopover.m index 886ca675..50f6322d 100644 --- a/AppKit/NSPopover.m +++ b/AppKit/NSPopover.m @@ -2,9 +2,9 @@ // DUMMY const NSString *NSPopoverDidCloseNotification = - @"NSPopoverDidCloseNotification"; + @"NSPopoverDidCloseNotification"; const NSString *NSPopoverWillCloseNotification = - @"NSPopoverWillCloseNotification"; + @"NSPopoverWillCloseNotification"; @interface NSPopover : NSObject @end diff --git a/AppKit/NSPrintInfo.m b/AppKit/NSPrintInfo.m index 64574447..374a8c24 100644 --- a/AppKit/NSPrintInfo.m +++ b/AppKit/NSPrintInfo.m @@ -28,7 +28,7 @@ NSString *const NSPrintPrinter = @"NSPrintPrinter"; NSString *const NSPrintPrinterName = @"NSPrintPrinterName"; NSString *const NSPrintJobDisposition = @"NSPrintJobDisposition"; NSString *const NSPrintDetailedErrorReporting = - @"NSPrintDetailedErrorReporting"; + @"NSPrintDetailedErrorReporting"; NSString *const NSPrintSpoolJob = @"NSPrintSpoolJob"; NSString *const NSPrintPreviewJob = @"NSPrintPreviewJob"; @@ -60,7 +60,7 @@ NSString *const NSPrintHeaderAndFooter = @"NSPrintHeaderAndFooter"; const NSPrintingPaginationMode NSFitPagination = NSPrintingPaginationModeFit; const NSPrintingPaginationMode NSAutoPagination = - NSPrintingPaginationModeAutomatic; + NSPrintingPaginationModeAutomatic; const NSPrintingPaginationMode NSClipPagination = NSPrintingPaginationModeClip; @implementation NSPrintInfo @@ -76,25 +76,18 @@ const NSPrintingPaginationMode NSClipPagination = NSPrintingPaginationModeClip; - init { NSDictionary *defaults = [NSDictionary - dictionaryWithObjectsAndKeys: [NSNumber numberWithInt: 1], - NSPrintCopies, - [NSNumber numberWithBool: YES], - NSPrintAllPages, @"US Letter", - NSPrintPaperName, - [NSValue - valueWithSize: NSMakeSize(612, 792)], - NSPrintPaperSize, - [NSNumber numberWithFloat: 36], - NSPrintTopMargin, - [NSNumber numberWithFloat: 36], - NSPrintLeftMargin, - [NSNumber numberWithFloat: 36], - NSPrintRightMargin, - [NSNumber numberWithFloat: 36], - NSPrintBottomMargin, - [NSNumber - numberWithInt: NSPortraitOrientation], - NSPrintOrientation, nil]; + dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt: 1], NSPrintCopies, + [NSNumber numberWithBool: YES], NSPrintAllPages, + @"US Letter", NSPrintPaperName, + [NSValue valueWithSize: NSMakeSize(612, 792)], + NSPrintPaperSize, [NSNumber numberWithFloat: 36], + NSPrintTopMargin, [NSNumber numberWithFloat: 36], + NSPrintLeftMargin, [NSNumber numberWithFloat: 36], + NSPrintRightMargin, [NSNumber numberWithFloat: 36], + NSPrintBottomMargin, + [NSNumber numberWithInt: NSPortraitOrientation], + NSPrintOrientation, nil]; return [self initWithDictionary: defaults]; } diff --git a/AppKit/NSPrintOperation.m b/AppKit/NSPrintOperation.m index 928173e0..8a7e8e7c 100644 --- a/AppKit/NSPrintOperation.m +++ b/AppKit/NSPrintOperation.m @@ -43,10 +43,10 @@ static NSPrintOperation *_currentOperation = nil; } - initWithView: (NSView *) view - printInfo: (NSPrintInfo *) printInfo - insideRect: (NSRect) rect - toData: (NSMutableData *) data - type: (int) type + printInfo: (NSPrintInfo *) printInfo + insideRect: (NSRect) rect + toData: (NSMutableData *) data + type: (int) type { _view = [view retain]; _printInfo = [printInfo copy]; @@ -87,7 +87,7 @@ static NSPrintOperation *_currentOperation = nil; + (NSPrintOperation *) printOperationWithView: (NSView *) view { return [[[self alloc] initWithView: view printInfo: [NSPrintInfo sharedPrintInfo]] - autorelease]; + autorelease]; } + (NSPrintOperation *) printOperationWithView: (NSView *) view @@ -202,8 +202,8 @@ static NSPrintOperation *_currentOperation = nil; CGFloat bottom = isFlipped ? top + imageableRect.size.height : top - imageableRect.size.height; CGFloat bottomLimit = - isFlipped ? top + imageableRect.size.height * heightAdjustLimit - : top - imageableRect.size.height * heightAdjustLimit; + isFlipped ? top + imageableRect.size.height * heightAdjustLimit + : top - imageableRect.size.height * heightAdjustLimit; if (orientation == NSLandscapeOrientation) { // FIX @@ -263,11 +263,11 @@ static NSPrintOperation *_currentOperation = nil; if ([self showsProgressPanel]) { printProgressPanelController = - [NSPrintProgressPanelController printProgressPanelController]; + [NSPrintProgressPanelController printProgressPanelController]; if ([[[self printInfo] jobDisposition] - isEqualToString: NSPrintSaveJob]) { + isEqualToString: NSPrintSaveJob]) { [printProgressPanelController - setTitle: NSLocalizedString(@"Save", @"Save a print job")]; + setTitle: NSLocalizedString(@"Save", @"Save a print job")]; } [printProgressPanelController setMaxPages: pageRange.length]; [printProgressPanelController showPanel]; @@ -314,15 +314,16 @@ static NSPrintOperation *_currentOperation = nil; } if ((context = (CGContextRef) - [[_printInfo dictionary] objectForKey: @"_KGContext"]) == nil) + [[_printInfo dictionary] objectForKey: @"_KGContext"]) == + nil) return nil; } else if (_type == NSPrintOperationPDFInRect) { NSDictionary *auxiliaryInfo = [NSDictionary - dictionaryWithObject: [[_view window] title] - forKey: (NSString *) kCGPDFContextTitle]; + dictionaryWithObject: [[_view window] title] + forKey: (NSString *) kCGPDFContextTitle]; CGDataConsumerRef consumer = - CGDataConsumerCreateWithCFData((CFMutableDataRef) _mutableData); + CGDataConsumerCreateWithCFData((CFMutableDataRef) _mutableData); context = CGPDFContextCreate(consumer, &_insideRect, (CFDictionaryRef) auxiliaryInfo); @@ -331,13 +332,13 @@ static NSPrintOperation *_currentOperation = nil; CGDataConsumerRelease(consumer); } else if (_type == NSPrintOperationFile) { NSDictionary *auxiliaryInfo = [NSDictionary - dictionaryWithObject: [[_view window] title] - forKey: (NSString *) kCGPDFContextTitle]; + dictionaryWithObject: [[_view window] title] + forKey: (NSString *) kCGPDFContextTitle]; NSString *filePath = - [_printInfo.dictionary objectForKey: NSPrintSavePath]; + [_printInfo.dictionary objectForKey: NSPrintSavePath]; CGDataConsumerRef consumer = CGDataConsumerCreateWithURL( - (CFURLRef) [NSURL fileURLWithPath: filePath]); + (CFURLRef) [NSURL fileURLWithPath: filePath]); context = CGPDFContextCreate(consumer, &_insideRect, (CFDictionaryRef) auxiliaryInfo); diff --git a/AppKit/NSPrintPanel.m b/AppKit/NSPrintPanel.m index 63002900..058a7884 100644 --- a/AppKit/NSPrintPanel.m +++ b/AppKit/NSPrintPanel.m @@ -24,7 +24,7 @@ [self updateFromPrintInfo]; result = [[NSDisplay currentDisplay] - runModalPrintPanelWithPrintInfoDictionary: _attributes]; + runModalPrintPanelWithPrintInfoDictionary: _attributes]; if (result == NSOKButton) [self finalWritePrintInfo]; @@ -33,7 +33,7 @@ - (void) updateFromPrintInfo { NSDictionary *source = - [[[NSPrintOperation currentOperation] printInfo] dictionary]; + [[[NSPrintOperation currentOperation] printInfo] dictionary]; [_attributes release]; _attributes = [source mutableCopy]; @@ -41,7 +41,7 @@ - (void) finalWritePrintInfo { NSMutableDictionary *destination = - [[[NSPrintOperation currentOperation] printInfo] dictionary]; + [[[NSPrintOperation currentOperation] printInfo] dictionary]; [destination addEntriesFromDictionary: _attributes]; } @@ -49,6 +49,6 @@ @end NSString *const NSPrintPanelAccessorySummaryItemNameKey = - @"NSPrintPanelAccessorySummaryItemName"; + @"NSPrintPanelAccessorySummaryItemName"; NSString *const NSPrintPanelAccessorySummaryItemDescriptionKey = - @"NSPrintPanelAccessorySummaryItemDescription"; + @"NSPrintPanelAccessorySummaryItemDescription"; diff --git a/AppKit/NSPrintProgressPanelController.m b/AppKit/NSPrintProgressPanelController.m index 6e30e532..fb18490b 100644 --- a/AppKit/NSPrintProgressPanelController.m +++ b/AppKit/NSPrintProgressPanelController.m @@ -16,7 +16,7 @@ + (NSPrintProgressPanelController *) printProgressPanelController { return [[[NSPrintProgressPanelController alloc] - initWithWindowNibName: @"NSPrintProgressPanel"] autorelease]; + initWithWindowNibName: @"NSPrintProgressPanel"] autorelease]; } - (void) windowDidLoad { diff --git a/AppKit/NSProgressIndicator.m b/AppKit/NSProgressIndicator.m index ee4ee7f1..63d67ac5 100644 --- a/AppKit/NSProgressIndicator.m +++ b/AppKit/NSProgressIndicator.m @@ -141,9 +141,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ CGFloat endGray = 0.90; int place = (i - offset < 0) ? numberOfRays + (i - offset) : i - offset; CGFloat gray = - startGray + ((endGray - startGray) / numberOfRays) * place; + startGray + ((endGray - startGray) / numberOfRays) * place; CGAffineTransform rotate = - CGAffineTransformMakeRotation(angle + arc * i); + CGAffineTransformMakeRotation(angle + arc * i); CGPoint ray; CGContextSetGrayStrokeColor(context, gray, 1.0); @@ -166,10 +166,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_isIndeterminate) { if ([self isDisplayedWhenStopped] || (_animationTimer != nil)) { [[self graphicsStyle] - drawProgressIndicatorIndeterminate: _bounds - clipRect: clipRect - bezeled: _isBezeled - animation: _animationValue]; + drawProgressIndicatorIndeterminate: _bounds + clipRect: clipRect + bezeled: _isBezeled + animation: _animationValue]; } } else { double value = (_value - _minValue) / (_maxValue - _minValue); @@ -318,8 +318,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ BOOL isRunning = YES; do { isRunning = - [[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode - beforeDate: [NSDate distantFuture]]; + [[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode + beforeDate: [NSDate distantFuture]]; } while (isRunning && _endThreadedAnimation == NO); [self _invalidateTimer]; diff --git a/AppKit/NSResponder.m b/AppKit/NSResponder.m index 2a781659..00d76afb 100644 --- a/AppKit/NSResponder.m +++ b/AppKit/NSResponder.m @@ -88,9 +88,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSEvent *event = [events objectAtIndex: i]; NSString *string = [event charactersIgnoringModifiers]; NSKeyboardBinding *keyBinding = - [[NSKeyboardBindingManager defaultKeyBindingManager] - keyBindingWithString: string - modifierFlags: [event modifierFlags]]; + [[NSKeyboardBindingManager defaultKeyBindingManager] + keyBindingWithString: string + modifierFlags: [event modifierFlags]]; NSArray *selectorNames = [keyBinding selectorNames]; if (selectorNames != nil) { @@ -100,7 +100,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // NSLog(@"doing %@ for %@", [selectorNames objectAtIndex:j], // keyBinding); [self doCommandBySelector: NSSelectorFromString([selectorNames - objectAtIndex: j])]; + objectAtIndex: j])]; } } else if ([self respondsToSelector: @selector(insertText:)]) { string = [event characters]; @@ -175,7 +175,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSError *newError; // error after being modified by delegate id delegate = [NSApp delegate]; if ([delegate respondsToSelector: @selector(application: - willPresentError:)]) + willPresentError:)]) newError = [delegate application: NSApp willPresentError: error]; else newError = error; @@ -205,16 +205,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } if (needToRemoveOptions) { NSMutableDictionary *newUserInfo = [NSMutableDictionary - dictionaryWithDictionary: [newError userInfo]]; + dictionaryWithDictionary: [newError userInfo]]; [newUserInfo - removeObjectForKey: NSLocalizedRecoveryOptionsErrorKey]; + removeObjectForKey: NSLocalizedRecoveryOptionsErrorKey]; strippedError = [NSError errorWithDomain: [newError domain] code: [newError code] userInfo: newUserInfo]; } else strippedError = newError; NSInteger alertButton = - [[NSAlert alertWithError: strippedError] runModal]; + [[NSAlert alertWithError: strippedError] runModal]; if (validRecoveryAttempter) result = [recoveryAttempter attemptRecoveryFromError: strippedError optionIndex: alertButton]; @@ -222,16 +222,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Forward message to nextResponder or to NSApp if there is no // nextResponder result = [_nextResponder ? _nextResponder : NSApp - presentError: [self willPresentError: error]]; + presentError: [self willPresentError: error]]; } return result; } - (void) presentError: (NSError *) error - modalForWindow: (NSWindow *) window - delegate: delegate - didPresentSelector: (SEL) selector - contextInfo: (void *) info + modalForWindow: (NSWindow *) window + delegate: delegate + didPresentSelector: (SEL) selector + contextInfo: (void *) info { NSUnimplementedMethod(); } diff --git a/AppKit/NSRuleEditor.m b/AppKit/NSRuleEditor.m index 200ad157..4f34c09c 100644 --- a/AppKit/NSRuleEditor.m +++ b/AppKit/NSRuleEditor.m @@ -1,7 +1,7 @@ #import NSString *const NSRuleEditorRowsDidChangeNotification = - @"NSRuleEditorRowsDidChangeNotification"; + @"NSRuleEditorRowsDidChangeNotification"; @implementation NSRuleEditor diff --git a/AppKit/NSRulerMarker.m b/AppKit/NSRulerMarker.m index 5f55b347..b0f411d3 100644 --- a/AppKit/NSRulerMarker.m +++ b/AppKit/NSRulerMarker.m @@ -140,16 +140,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ location = [_ruler convertPoint: location fromView: [_ruler clientView]]; } else { - location = - [_ruler convertPoint: location - fromView: [[_ruler enclosingScrollView] documentView]]; + location = [_ruler + convertPoint: location + fromView: [[_ruler enclosingScrollView] documentView]]; } if ([_ruler orientation] == NSHorizontalRuler) { rect.origin.x += location.x; } else { rect.origin.y += - location.y; // how does a flipped system affect this? hm + location.y; // how does a flipped system affect this? hm } rect.origin.x -= _imageOrigin.x; rect.origin.y -= _imageOrigin.y; @@ -183,7 +183,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } point = [_ruler convertPoint: point toView: trackedView]; CGFloat newLocation = - [_ruler orientation] == NSHorizontalRuler ? point.x : point.y; + [_ruler orientation] == NSHorizontalRuler ? point.x : point.y; return newLocation; } @@ -194,12 +194,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _isPinned = YES; if ([[_ruler clientView] respondsToSelector: @selector(rulerView: - shouldAddMarker:)]) + shouldAddMarker:)]) if ([[_ruler clientView] rulerView: _ruler shouldAddMarker: self] == NO) return NO; BOOL respondToShouldAddMarker = [[_ruler clientView] - respondsToSelector: @selector(rulerView:shouldAddMarker:)]; + respondsToSelector: @selector(rulerView:shouldAddMarker:)]; _isDragging = YES; do { point = [_ruler convertPoint: [event locationInWindow] fromView: nil]; @@ -228,8 +228,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [_ruler unlockFocus]; [[_ruler window] flushWindow]; - event = [[_ruler window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[_ruler window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while ([event type] != NSLeftMouseUp); _isDragging = NO; @@ -238,7 +238,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [_ruler addMarker: self]; if ([[_ruler clientView] respondsToSelector: @selector(rulerView: - didAddMarker:)]) + didAddMarker:)]) [[_ruler clientView] rulerView: _ruler didAddMarker: self]; return YES; @@ -253,13 +253,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ fromView: nil]; _isPinned = YES; if ([[_ruler clientView] respondsToSelector: @selector(rulerView: - shouldMoveMarker:)]) + shouldMoveMarker:)]) if ([[_ruler clientView] rulerView: _ruler shouldMoveMarker: self] == NO) return NO; BOOL respondToShouldRemoveMarker = [[_ruler clientView] - respondsToSelector: @selector(rulerView:shouldRemoveMarker:)]; + respondsToSelector: @selector(rulerView:shouldRemoveMarker:)]; _isDragging = YES; do { if ([self isMovable]) { @@ -279,14 +279,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([[_ruler clientView] respondsToSelector: @selector (rulerView:willMoveMarker:toLocation:)]) { _markerLocation = - [[_ruler clientView] rulerView: _ruler - willMoveMarker: self - toLocation: _markerLocation]; + [[_ruler clientView] rulerView: _ruler + willMoveMarker: self + toLocation: _markerLocation]; } [_ruler setNeedsDisplay: YES]; } - event = [[_ruler window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[_ruler window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while ([event type] != NSLeftMouseUp); _isDragging = NO; @@ -294,12 +294,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ BOOL removed = NO; if (_isPinned == NO) { [[self retain] - autorelease]; // Be sure we survive the removal until we're done + autorelease]; // Be sure we survive the removal until we're done [_ruler removeMarker: self]; removed = YES; if ([[_ruler clientView] respondsToSelector: @selector(rulerView: - didRemoveMarker:)]) + didRemoveMarker:)]) [[_ruler clientView] rulerView: _ruler didRemoveMarker: self]; } _isPinned = YES; @@ -307,7 +307,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Call didMoveMarker only after the dragging is done - that's what // Cocoa is doing if ([[_ruler clientView] respondsToSelector: @selector(rulerView: - didMoveMarker:)]) { + didMoveMarker:)]) { [[_ruler clientView] rulerView: _ruler didMoveMarker: self]; } } diff --git a/AppKit/NSRulerView.m b/AppKit/NSRulerView.m index f6b805df..7d94a705 100644 --- a/AppKit/NSRulerView.m +++ b/AppKit/NSRulerView.m @@ -52,18 +52,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSRulerView + (void) registerUnitWithName: (NSString *) name - abbreviation: (NSString *) abbreviation - unitToPointsConversionFactor: (CGFloat) conversionFactor - stepUpCycle: (NSArray *) stepUpCycle - stepDownCycle: (NSArray *) stepDownCycle + abbreviation: (NSString *) abbreviation + unitToPointsConversionFactor: (CGFloat) conversionFactor + stepUpCycle: (NSArray *) stepUpCycle + stepDownCycle: (NSArray *) stepDownCycle { [NSMeasurementUnit - registerUnit: [NSMeasurementUnit - measurementUnitWithName: name - abbreviation: abbreviation - pointsPerUnit: conversionFactor - stepUpCycle: stepUpCycle - stepDownCycle: stepDownCycle]]; + registerUnit: [NSMeasurementUnit + measurementUnitWithName: name + abbreviation: abbreviation + pointsPerUnit: conversionFactor + stepUpCycle: stepUpCycle + stepDownCycle: stepDownCycle]]; } - (id) initWithFrame: (NSRect) frame { @@ -91,7 +91,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _orientation = orientation; _measurementUnit = - [[NSMeasurementUnit measurementUnitNamed: @"Inches"] retain]; + [[NSMeasurementUnit measurementUnitNamed: @"Inches"] retain]; // Don't invoke the setters - they trigger tiling which can cause recursion // if the scrollview is creating the ruler @@ -159,7 +159,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([[_markers objectAtIndex: i] thicknessRequiredInRuler] > _thicknessForMarkers) _thicknessForMarkers = - [[_markers objectAtIndex: i] thicknessRequiredInRuler]; + [[_markers objectAtIndex: i] thicknessRequiredInRuler]; } return _thicknessForMarkers; @@ -235,7 +235,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) setMeasurementUnits: (NSString *) unitName { [_measurementUnit release]; _measurementUnit = - [[NSMeasurementUnit measurementUnitNamed: unitName] retain]; + [[NSMeasurementUnit measurementUnitNamed: unitName] retain]; [self invalidateHashMarks]; [[self enclosingScrollView] tile]; @@ -270,7 +270,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) trackMarker: (NSRulerMarker *) marker - withMouseEvent: (NSEvent *) event + withMouseEvent: (NSEvent *) event { NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil]; @@ -297,7 +297,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } } if ([_clientView respondsToSelector: @selector(rulerView: - handleMouseDown:)]) { + handleMouseDown:)]) { [_clientView rulerView: self handleMouseDown: event]; } } @@ -321,16 +321,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSDictionary *) attributesForLabel { - NSMutableParagraphStyle *style = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; + NSMutableParagraphStyle *style = [[[NSParagraphStyle defaultParagraphStyle] + mutableCopy] autorelease]; [style setLineBreakMode: NSLineBreakByClipping]; [style setAlignment: NSLeftTextAlignment]; return [NSDictionary - dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize: 10.0], - NSFontAttributeName, style, - NSParagraphStyleAttributeName, nil]; + dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize: 10.0], + NSFontAttributeName, style, + NSParagraphStyleAttributeName, nil]; } - (void) drawHashMarksAndLabelsInRect: (NSRect) dirtyRect { @@ -366,12 +366,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ : frame.size.height); int i, count = ceil(length / (pointsPerUnit * scale)); NSMutableArray *cycles = - [[[_measurementUnit stepDownCycle] mutableCopy] autorelease]; + [[[_measurementUnit stepDownCycle] mutableCopy] autorelease]; CGFloat extraThickness = 0; BOOL scrollViewHasOtherRuler = - (_orientation == NSHorizontalRuler - ? [[self enclosingScrollView] hasVerticalRuler] - : [[self enclosingScrollView] hasHorizontalRuler]); + (_orientation == NSHorizontalRuler + ? [[self enclosingScrollView] hasVerticalRuler] + : [[self enclosingScrollView] hasHorizontalRuler]); if ([_markers count] > 0) extraThickness += [self reservedThicknessForMarkers]; @@ -422,7 +422,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ textOrigin.x += LABEL_TEXT_SECONDARY_OFFSET; } [label drawAtPoint: textOrigin - withAttributes: [self attributesForLabel]]; + withAttributes: [self attributesForLabel]]; if (_orientation == NSHorizontalRuler) { frame.origin.x += pointsPerUnit * scale; @@ -505,16 +505,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (i = 0; i < count; ++i) { if (_orientation == NSHorizontalRuler) { rect.origin.x = - [[_rulerlineLocations objectAtIndex: i] doubleValue] + 0.5; + [[_rulerlineLocations objectAtIndex: i] doubleValue] + 0.5; [NSBezierPath - strokeLineFromPoint: NSMakePoint(NSMinX(rect), NSMinY(rect)) - toPoint: NSMakePoint(NSMinX(rect), NSMaxY(rect))]; + strokeLineFromPoint: NSMakePoint(NSMinX(rect), NSMinY(rect)) + toPoint: NSMakePoint(NSMinX(rect), + NSMaxY(rect))]; } else { rect.origin.y = - [[_rulerlineLocations objectAtIndex: i] doubleValue] + 0.5; + [[_rulerlineLocations objectAtIndex: i] doubleValue] + 0.5; [NSBezierPath - strokeLineFromPoint: NSMakePoint(NSMinX(rect), NSMinY(rect)) - toPoint: NSMakePoint(NSMaxX(rect), NSMinY(rect))]; + strokeLineFromPoint: NSMakePoint(NSMinX(rect), NSMinY(rect)) + toPoint: NSMakePoint(NSMaxX(rect), + NSMinY(rect))]; } } } diff --git a/AppKit/NSSavePanel.subproj/NSOpenPanel.m b/AppKit/NSSavePanel.subproj/NSOpenPanel.m index 254b1462..dfd33637 100644 --- a/AppKit/NSSavePanel.subproj/NSOpenPanel.m +++ b/AppKit/NSSavePanel.subproj/NSOpenPanel.m @@ -32,8 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _filenames = [NSArray new]; [_dialogTitle release]; _dialogTitle = [NSLocalizedStringFromTableInBundle( - @"Open", nil, [NSBundle bundleForClass: [NSOpenPanel class]], - @"The title of the open panel") copy]; + @"Open", nil, [NSBundle bundleForClass: [NSOpenPanel class]], + @"The title of the open panel") copy]; _allowsMultipleSelection = NO; _canChooseDirectories = NO; _canChooseFiles = YES; @@ -50,10 +50,10 @@ static NSOpenPanel *_newPanel = nil; + (NSSavePanel *) openPanel { if ([[NSDisplay currentDisplay] implementsCustomPanelForClass: self]) { _newPanel = [[self alloc] - initWithContentRect: NSMakeRect(0, 0, 1, 1) - styleMask: NSTitledWindowMask | NSResizableWindowMask - backing: NSBackingStoreBuffered - defer: YES]; + initWithContentRect: NSMakeRect(0, 0, 1, 1) + styleMask: NSTitledWindowMask | NSResizableWindowMask + backing: NSBackingStoreBuffered + defer: YES]; } else { [NSBundle loadNibNamed: @"NSOpenPanel" owner: self]; } @@ -121,7 +121,7 @@ static NSOpenPanel *_newPanel = nil; - (NSInteger) runModal { NSInteger res; if ([[NSDisplay currentDisplay] - implementsCustomPanelForClass: [self class]]) { + implementsCustomPanelForClass: [self class]]) { res = [[NSDisplay currentDisplay] openPanel: self runModalForDirectory: [self directory] file: [self filename] @@ -176,18 +176,20 @@ static NSOpenPanel *_newPanel = nil; contextInfo: (void *) contextInfo { id inv = [NSInvocation - invocationWithMethodSignature: - [self - methodSignatureForSelector: @selector - (_background_beginSheetForDirectory: - file:types:modalForWindow - :modalDelegate:didEndSelector - :contextInfo:)]]; + invocationWithMethodSignature: + [self methodSignatureForSelector: @selector + (_background_beginSheetForDirectory: + file:types + :modalForWindow + :modalDelegate + :didEndSelector + :contextInfo:)]]; [inv setTarget: self]; [inv setSelector: @selector - (_background_beginSheetForDirectory: - file:types:modalForWindow:modalDelegate - :didEndSelector:contextInfo:)]; + (_background_beginSheetForDirectory: + file:types:modalForWindow + :modalDelegate:didEndSelector + :contextInfo:)]; [inv setArgument: &path atIndex: 2]; [inv setArgument: &name atIndex: 3]; [inv setArgument: &fileTypes atIndex: 4]; @@ -210,10 +212,11 @@ static NSOpenPanel *_newPanel = nil; id pool = [NSAutoreleasePool new]; int ret = [self runModalForDirectory: path file: name types: fileTypes]; - id inv = [NSInvocation invocationWithMethodSignature: - [self methodSignatureForSelector: @selector - (_selector_savePanelDidEnd: - returnCode:contextInfo:)]]; + id inv = [NSInvocation + invocationWithMethodSignature: + [self methodSignatureForSelector: @selector + (_selector_savePanelDidEnd: + returnCode:contextInfo:)]]; [inv setTarget: modalDelegate]; [inv setSelector: didEndSelector]; diff --git a/AppKit/NSSavePanel.subproj/NSSavePanel.m b/AppKit/NSSavePanel.subproj/NSSavePanel.m index 5801ed54..219d795d 100644 --- a/AppKit/NSSavePanel.subproj/NSSavePanel.m +++ b/AppKit/NSSavePanel.subproj/NSSavePanel.m @@ -45,10 +45,10 @@ static NSSavePanel *_newPanel = nil; + (NSSavePanel *) savePanel { if ([[NSDisplay currentDisplay] implementsCustomPanelForClass: self]) { _newPanel = [[self alloc] - initWithContentRect: NSMakeRect(0, 0, 1, 1) - styleMask: NSTitledWindowMask | NSResizableWindowMask - backing: NSBackingStoreBuffered - defer: YES]; + initWithContentRect: NSMakeRect(0, 0, 1, 1) + styleMask: NSTitledWindowMask | NSResizableWindowMask + backing: NSBackingStoreBuffered + defer: YES]; } else { [NSBundle loadNibNamed: @"NSSavePanel" owner: self]; } @@ -117,7 +117,7 @@ static NSSavePanel *_newPanel = nil; - (NSInteger) runModal { NSInteger res; if ([[NSDisplay currentDisplay] - implementsCustomPanelForClass: [self class]]) { + implementsCustomPanelForClass: [self class]]) { res = [[NSDisplay currentDisplay] savePanel: self runModalForDirectory: [self directory] file: [self filename]]; @@ -237,18 +237,18 @@ static NSSavePanel *_newPanel = nil; contextInfo: (void *) contextInfo { id inv = [NSInvocation - invocationWithMethodSignature: - [self - methodSignatureForSelector: @selector - (_background_beginSheetForDirectory: - file:modalForWindow:modalDelegate - :didEndSelector:contextInfo - :)]]; + invocationWithMethodSignature: + [self methodSignatureForSelector: @selector + (_background_beginSheetForDirectory: + file:modalForWindow + :modalDelegate + :didEndSelector + :contextInfo:)]]; [inv setTarget: self]; [inv setSelector: @selector - (_background_beginSheetForDirectory: - file:modalForWindow:modalDelegate - :didEndSelector:contextInfo:)]; + (_background_beginSheetForDirectory: + file:modalForWindow:modalDelegate + :didEndSelector:contextInfo:)]; [inv setArgument: &path atIndex: 2]; [inv setArgument: &name atIndex: 3]; [inv setArgument: &docWindow atIndex: 4]; @@ -275,10 +275,11 @@ static NSSavePanel *_newPanel = nil; id pool = [NSAutoreleasePool new]; int ret = [self runModalForDirectory: path file: name]; - id inv = [NSInvocation invocationWithMethodSignature: - [self methodSignatureForSelector: @selector - (_selector_savePanelDidEnd: - returnCode:contextInfo:)]]; + id inv = [NSInvocation + invocationWithMethodSignature: + [self methodSignatureForSelector: @selector + (_selector_savePanelDidEnd: + returnCode:contextInfo:)]]; [inv setTarget: modalDelegate]; [inv setSelector: didEndSelector]; diff --git a/AppKit/NSSavePanel.subproj/_NSFileSystemDataSource.m b/AppKit/NSSavePanel.subproj/_NSFileSystemDataSource.m index 89ff0812..5a5fe094 100644 --- a/AppKit/NSSavePanel.subproj/_NSFileSystemDataSource.m +++ b/AppKit/NSSavePanel.subproj/_NSFileSystemDataSource.m @@ -17,7 +17,7 @@ } - (NSInteger) outlineView: (NSOutlineView *) outlineView - numberOfChildrenOfItem: (NSURL *) url + numberOfChildrenOfItem: (NSURL *) url { if (url == nil) { @@ -30,7 +30,7 @@ } - (BOOL) outlineView: (NSOutlineView *) outlineView - isItemExpandable: (NSURL *) url + isItemExpandable: (NSURL *) url { if (url == nil) { @@ -66,8 +66,8 @@ } - (NSString *) outlineView: (NSOutlineView *) outlineView - objectValueForTableColumn: (NSTableColumn *) tableColumn - byItem: (NSURL *) url + objectValueForTableColumn: (NSTableColumn *) tableColumn + byItem: (NSURL *) url { return [[url pathComponents] lastObject]; } diff --git a/AppKit/NSScrollView.m b/AppKit/NSScrollView.m index b2d94469..60732746 100644 --- a/AppKit/NSScrollView.m +++ b/AppKit/NSScrollView.m @@ -29,11 +29,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSScrollViewDidEndLiveScrollNotification = - @"NSScrollViewDidEndLiveScrollNotification"; + @"NSScrollViewDidEndLiveScrollNotification"; NSString *const NSScrollViewWillStartLiveScrollNotification = - @"NSScrollViewWillStartLiveScrollNotification"; + @"NSScrollViewWillStartLiveScrollNotification"; NSString *const NSScrollViewDidLiveScrollNotification = - @"NSScrollViewDidLiveScrollNotification"; + @"NSScrollViewDidLiveScrollNotification"; @implementation NSScrollView @@ -139,13 +139,13 @@ static Class _rulerViewClass = nil; _clipView = [[keyed decodeObjectForKey: @"NSContentView"] retain]; _verticalScroller = [[keyed decodeObjectForKey: @"NSVScroller"] retain]; _horizontalScroller = - [[keyed decodeObjectForKey: @"NSHScroller"] retain]; + [[keyed decodeObjectForKey: @"NSHScroller"] retain]; [_verticalScroller setTarget: self]; [_verticalScroller setAction: @selector(_verticalScroll:)]; [_horizontalScroller setTarget: self]; [_horizontalScroller setAction: @selector(_horizontalScroll:)]; _headerClipView = - [[keyed decodeObjectForKey: @"NSHeaderClipView"] retain]; + [[keyed decodeObjectForKey: @"NSHeaderClipView"] retain]; _cornerView = [[keyed decodeObjectForKey: @"NSCornerView"] retain]; _backgroundColor = [[NSColor controlBackgroundColor] copy]; @@ -250,7 +250,7 @@ static Class _rulerViewClass = nil; NSRect bounds = [self insetBounds]; NSRect frame; frame.origin.x = - bounds.origin.x + bounds.size.width - [NSScroller scrollerWidth]; + bounds.origin.x + bounds.size.width - [NSScroller scrollerWidth]; frame.origin.y = bounds.origin.y; frame.size.width = [NSScroller scrollerWidth]; frame.size.height = [headerView bounds].size.height; @@ -318,7 +318,7 @@ static Class _rulerViewClass = nil; NSRect result; result.origin.x = - bounds.origin.x + bounds.size.width - [NSScroller scrollerWidth]; + bounds.origin.x + bounds.size.width - [NSScroller scrollerWidth]; result.origin.y = bounds.origin.y; result.size.width = [NSScroller scrollerWidth]; result.size.height = bounds.size.height; @@ -343,7 +343,7 @@ static Class _rulerViewClass = nil; result.origin.x = bounds.origin.x; result.origin.y = - (bounds.origin.y + bounds.size.height) - [NSScroller scrollerWidth]; + (bounds.origin.y + bounds.size.height) - [NSScroller scrollerWidth]; result.size.width = bounds.size.width; if ([self hasVerticalScroller] && ![_verticalScroller isHidden]) result.size.width -= [NSScroller scrollerWidth]; @@ -360,10 +360,10 @@ static Class _rulerViewClass = nil; - (void) createVerticalScrollerIfNeeded { if (_verticalScroller == nil) { - _verticalScroller = - [[NSScroller alloc] initWithFrame: [self verticalScrollerFrame]]; + _verticalScroller = [[NSScroller alloc] + initWithFrame: [self verticalScrollerFrame]]; [_verticalScroller - setAutoresizingMask: NSViewMinXMargin | NSViewHeightSizable]; + setAutoresizingMask: NSViewMinXMargin | NSViewHeightSizable]; [_verticalScroller setTarget: self]; [_verticalScroller setAction: @selector(_verticalScroll:)]; } @@ -371,10 +371,10 @@ static Class _rulerViewClass = nil; - (void) createHorizontalScrollerIfNeeded { if (_horizontalScroller == nil) { - _horizontalScroller = - [[NSScroller alloc] initWithFrame: [self horizontalScrollerFrame]]; + _horizontalScroller = [[NSScroller alloc] + initWithFrame: [self horizontalScrollerFrame]]; [_horizontalScroller - setAutoresizingMask: NSViewMaxYMargin | NSViewWidthSizable]; + setAutoresizingMask: NSViewMaxYMargin | NSViewWidthSizable]; [_horizontalScroller setTarget: self]; [_horizontalScroller setAction: @selector(_horizontalScroll:)]; } @@ -433,12 +433,12 @@ static Class _rulerViewClass = nil; _headerClipView = nil; } else if ([self _headerView] != nil && _headerClipView == nil) { _headerClipView = - [[NSClipView alloc] initWithFrame: [self headerClipViewFrame]]; + [[NSClipView alloc] initWithFrame: [self headerClipViewFrame]]; [_headerClipView setDocumentView: [self _headerView]]; [self addSubview: _headerClipView]; [_headerClipView - setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; + setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [_headerClipView setAutoresizesSubviews: YES]; } @@ -463,16 +463,16 @@ static Class _rulerViewClass = nil; if (_hasHorizontalRuler) { if (_horizontalRuler == nil) _horizontalRuler = [[[[self class] rulerViewClass] alloc] - initWithScrollView: self - orientation: NSHorizontalRuler]; + initWithScrollView: self + orientation: NSHorizontalRuler]; [self addSubview: _horizontalRuler]; } if (_hasVerticalRuler) { if (_verticalRuler == nil) _verticalRuler = [[[[self class] rulerViewClass] alloc] - initWithScrollView: self - orientation: NSVerticalRuler]; + initWithScrollView: self + orientation: NSVerticalRuler]; [self addSubview: _verticalRuler]; } @@ -834,18 +834,19 @@ static Class _rulerViewClass = nil; [_verticalScroller setHidden: _autohidesScrollers]; } else { CGFloat value = - (heightDiff <= 0) - ? 0 - : (clipRect.origin.y - docRect.origin.y) / heightDiff; + (heightDiff <= 0) + ? 0 + : (clipRect.origin.y - docRect.origin.y) / + heightDiff; if (![docView isFlipped]) value = 1.0 - value; [_verticalScroller setEnabled: YES]; [_verticalScroller setHidden: NO]; - [_verticalScroller - setFloatValue: value - knobProportion: clipRect.size.height / docRect.size.height]; + [_verticalScroller setFloatValue: value + knobProportion: clipRect.size.height / + docRect.size.height]; } if (widthDiff <= 0) { @@ -853,15 +854,16 @@ static Class _rulerViewClass = nil; [_horizontalScroller setHidden: _autohidesScrollers]; } else { CGFloat value = - (widthDiff <= 0) - ? 0 - : (clipRect.origin.x - docRect.origin.x) / widthDiff; + (widthDiff <= 0) + ? 0 + : (clipRect.origin.x - docRect.origin.x) / + widthDiff; [_horizontalScroller setEnabled: YES]; [_horizontalScroller setHidden: NO]; - [_horizontalScroller - setFloatValue: value - knobProportion: clipRect.size.width / docRect.size.width]; + [_horizontalScroller setFloatValue: value + knobProportion: clipRect.size.width / + docRect.size.width]; } } diff --git a/AppKit/NSScroller.m b/AppKit/NSScroller.m index 232be854..754afef2 100644 --- a/AppKit/NSScroller.m +++ b/AppKit/NSScroller.m @@ -217,13 +217,13 @@ static NSAppleScrollBarVariant appleScrollBarVariant(NSScroller *self) { if ([self isVertical]) { result.origin.y = knob.origin.y + knob.size.height; result.size.height = - ((knobSlot.origin.y + knobSlot.size.height) - result.origin.y); + ((knobSlot.origin.y + knobSlot.size.height) - result.origin.y); if (result.size.height <= 0) result = NSZeroRect; } else { result.origin.x = knob.origin.x + knob.size.width; result.size.width = - ((knobSlot.origin.x + knobSlot.size.width) - result.origin.x); + ((knobSlot.origin.x + knobSlot.size.width) - result.origin.x); if (result.size.width <= 0) result = NSZeroRect; } @@ -260,10 +260,10 @@ static inline CGFloat roundFloat(CGFloat value) { incLine.origin.y = bounds.size.height - incLine.size.height; knobSlot.origin.y += decLine.size.height; knobSlot.size.height -= - decLine.size.height + incLine.size.height; + decLine.size.height + incLine.size.height; } else { knobSlot.size.height -= - decLine.size.height + incLine.size.height; + decLine.size.height + incLine.size.height; if (_arrowsPosition == NSScrollerArrowsMaxEnd) { incLine.origin.y = bounds.size.height - incLine.size.height; @@ -280,7 +280,7 @@ static inline CGFloat roundFloat(CGFloat value) { if (knob.size.height < knob.size.width) knob.size.height = knob.size.width; knob.origin.y += - floor((knobSlot.size.height - knob.size.height) * _floatValue); + floor((knobSlot.size.height - knob.size.height) * _floatValue); if (floor(knob.size.height) >= floor(knobSlot.size.height)) knob = NSZeroRect; @@ -305,7 +305,7 @@ static inline CGFloat roundFloat(CGFloat value) { if (knob.size.width < knob.size.height) knob.size.width = knob.size.height; knob.origin.x += - floor((knobSlot.size.width - knob.size.width) * _floatValue); + floor((knobSlot.size.width - knob.size.width) * _floatValue); if (floor(knob.size.width) >= floor(knobSlot.size.width)) knob = NSZeroRect; } @@ -378,15 +378,15 @@ static inline CGFloat roundFloat(CGFloat value) { - (void) drawArrow: (NSScrollerArrow) arrow highlight: (BOOL) highlight { NSRect rect = (arrow == NSScrollerIncrementArrow) - ? [self rectForPart: NSScrollerIncrementLine] - : [self rectForPart: NSScrollerDecrementLine]; + ? [self rectForPart: NSScrollerIncrementLine] + : [self rectForPart: NSScrollerDecrementLine]; [[self graphicsStyle] - drawScrollerButtonInRect: rect - enabled: [self isEnabled] - pressed: highlight - vertical: [self isVertical] - upOrLeft: (arrow != NSScrollerIncrementArrow)]; + drawScrollerButtonInRect: rect + enabled: [self isEnabled] + pressed: highlight + vertical: [self isVertical] + upOrLeft: (arrow != NSScrollerIncrementArrow)]; } - (void) drawRect: (NSRect) rect { @@ -456,8 +456,8 @@ static inline CGFloat roundFloat(CGFloat value) { NSPoint point; CGFloat delta; - event = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; point = [self convertPoint: [event locationInWindow] fromView: nil]; @@ -553,8 +553,8 @@ static inline CGFloat roundFloat(CGFloat value) { [self sendAction: _action to: _target]; } - event = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while ([event type] != NSLeftMouseUp); diff --git a/AppKit/NSSearchFieldCell.m b/AppKit/NSSearchFieldCell.m index fc6efc27..74268ede 100644 --- a/AppKit/NSSearchFieldCell.m +++ b/AppKit/NSSearchFieldCell.m @@ -30,11 +30,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithCoder: (NSCoder *) coder { [super initWithCoder: coder]; _searchButtonCell = [[NSButtonCell alloc] - initImageCell: [NSImage imageNamed: @"NSSearchGlass"]]; + initImageCell: [NSImage imageNamed: @"NSSearchGlass"]]; [_searchButtonCell setImageScaling: NSImageScaleProportionallyUpOrDown]; _cancelButtonCell = [[NSButtonCell alloc] - initImageCell: [NSImage - imageNamed: @"NSStopProgressFreestandingTemplate"]]; + initImageCell: + [NSImage + imageNamed: @"NSStopProgressFreestandingTemplate"]]; [_cancelButtonCell setImageScaling: NSImageScaleProportionallyUpOrDown]; return self; } @@ -42,11 +43,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initTextCell: (NSString *) string { [super initTextCell: string]; _searchButtonCell = [[NSButtonCell alloc] - initImageCell: [NSImage imageNamed: @"NSSearchGlass"]]; + initImageCell: [NSImage imageNamed: @"NSSearchGlass"]]; [_searchButtonCell setImageScaling: NSImageScaleProportionallyUpOrDown]; _cancelButtonCell = [[NSButtonCell alloc] - initImageCell: [NSImage - imageNamed: @"NSStopProgressFreestandingTemplate"]]; + initImageCell: + [NSImage + imageNamed: @"NSStopProgressFreestandingTemplate"]]; [_cancelButtonCell setImageScaling: NSImageScaleProportionallyUpOrDown]; return self; } @@ -171,9 +173,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) frame - ofView: (NSView *) view - untilMouseUp: (BOOL) untilMouseUp + inRect: (NSRect) frame + ofView: (NSView *) view + untilMouseUp: (BOOL) untilMouseUp { if ([_cancelButtonCell trackMouse: event inRect: [self cancelButtonRectForBounds: frame] @@ -199,8 +201,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ inView: control]; if ([[self attributedStringValue] length] > 0) [_cancelButtonCell - drawWithFrame: [self cancelButtonRectForBounds: frame] - inView: control]; + drawWithFrame: [self cancelButtonRectForBounds: frame] + inView: control]; } @end diff --git a/AppKit/NSSecureTextFieldCell.m b/AppKit/NSSecureTextFieldCell.m index 57913334..cdd4868d 100644 --- a/AppKit/NSSecureTextFieldCell.m +++ b/AppKit/NSSecureTextFieldCell.m @@ -62,7 +62,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) drawInteriorWithFrame: (NSRect) frame inView: (NSView *) control { NSRect titleRect = [self titleRectForBounds: frame]; NSMutableAttributedString *astring = - [[self attributedStringValue] mutableCopy]; + [[self attributedStringValue] mutableCopy]; NSUInteger i, length = [astring length]; unichar *buffer = NSZoneMalloc(NULL, length * sizeof(unichar)); diff --git a/AppKit/NSSegmentedControl/NSSegmentItem.m b/AppKit/NSSegmentedControl/NSSegmentItem.m index ee515615..2dfcb1c3 100644 --- a/AppKit/NSSegmentedControl/NSSegmentItem.m +++ b/AppKit/NSSegmentedControl/NSSegmentItem.m @@ -43,9 +43,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (id) description { - return - [NSString stringWithFormat: @"%@ - %@ (%f) [%d]", [super description], - _label, _width, _tag]; + return [NSString stringWithFormat: @"%@ - %@ (%f) [%d]", + [super description], _label, _width, + _tag]; } - (void) dealloc { diff --git a/AppKit/NSSegmentedControl/NSSegmentedCell.m b/AppKit/NSSegmentedControl/NSSegmentedCell.m index aa524f2b..c1162468 100644 --- a/AppKit/NSSegmentedControl/NSSegmentedCell.m +++ b/AppKit/NSSegmentedControl/NSSegmentedCell.m @@ -306,12 +306,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (i = 0; i < count; i++) { segmentFrame.size.width = - [[_segmentComputedWidths objectAtIndex: i] doubleValue]; + [[_segmentComputedWidths objectAtIndex: i] doubleValue]; [NSGraphicsContext saveGraphicsState]; // Make sure that segment drawing is not allowed to spill out into other // segments NSBezierPath *clipPath = - [NSBezierPath bezierPathWithRect: segmentFrame]; + [NSBezierPath bezierPathWithRect: segmentFrame]; [clipPath addClip]; [self drawSegment: i inFrame: segmentFrame withView: controlView]; [NSGraphicsContext restoreGraphicsState]; @@ -352,7 +352,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSSegmentItem *item = [_segments objectAtIndex: i]; segmentFrame.size.width = - [[_segmentComputedWidths objectAtIndex: i] doubleValue]; + [[_segmentComputedWidths objectAtIndex: i] doubleValue]; if (NSPointInRect(point, segmentFrame)) { return i; } @@ -363,10 +363,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (BOOL) startTrackingAt: (NSPoint) startPoint inView: (NSView *) controlView { // save the segment clicked on and its state - _firstTrackingSegmentIndex = [self - _segmentForPoint: [controlView convertPoint: startPoint fromView: nil]]; + _firstTrackingSegmentIndex = + [self _segmentForPoint: [controlView convertPoint: startPoint + fromView: nil]]; NSSegmentItem *trackingItem = - [_segments objectAtIndex: _firstTrackingSegmentIndex]; + [_segments objectAtIndex: _firstTrackingSegmentIndex]; if (![trackingItem isEnabled]) return YES; @@ -385,7 +386,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ lastPoint = [controlView convertPoint: lastPoint fromView: nil]; NSSegmentItem *trackingItem = - [_segments objectAtIndex: _firstTrackingSegmentIndex]; + [_segments objectAtIndex: _firstTrackingSegmentIndex]; if (![trackingItem isEnabled]) return YES; @@ -415,7 +416,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [self continueTracking: lastPoint at: stopPoint inView: controlView]; NSSegmentItem *trackingItem = - [_segments objectAtIndex: _firstTrackingSegmentIndex]; + [_segments objectAtIndex: _firstTrackingSegmentIndex]; if (![trackingItem isEnabled]) return; @@ -454,13 +455,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) cellFrame - ofView: (NSView *) controlView - untilMouseUp: (BOOL) flag + inRect: (NSRect) cellFrame + ofView: (NSView *) controlView + untilMouseUp: (BOOL) flag { NSPoint startPoint = [event locationInWindow]; - NSInteger segmentUnderMouse = [self - _segmentForPoint: [controlView convertPoint: startPoint fromView: nil]]; + NSInteger segmentUnderMouse = + [self _segmentForPoint: [controlView convertPoint: startPoint + fromView: nil]]; if (segmentUnderMouse == NSNotFound) return YES; diff --git a/AppKit/NSSheetContext.m b/AppKit/NSSheetContext.m index 4e313f8c..912340ca 100644 --- a/AppKit/NSSheetContext.m +++ b/AppKit/NSSheetContext.m @@ -22,10 +22,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSSheetContext - initWithSheet: (NSWindow *) sheet - modalDelegate: modalDelegate - didEndSelector: (SEL) didEndSelector - contextInfo: (void *) contextInfo - frame: (NSRect) frame + modalDelegate: modalDelegate + didEndSelector: (SEL) didEndSelector + contextInfo: (void *) contextInfo + frame: (NSRect) frame { if (sheet == nil) [NSException raise: NSInvalidArgumentException format: @"sheet==nil"]; diff --git a/AppKit/NSSliderCell.m b/AppKit/NSSliderCell.m index 8035799a..dda9f39c 100644 --- a/AppKit/NSSliderCell.m +++ b/AppKit/NSSliderCell.m @@ -55,7 +55,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _numberOfTickMarks = [keyed decodeIntForKey: @"NSNumberOfTickMarks"]; _tickMarkPosition = [keyed decodeIntForKey: @"NSTickMarkPosition"]; _allowsTickMarkValuesOnly = - [keyed decodeBoolForKey: @"NSAllowsTickMarkValuesOnly"]; + [keyed decodeBoolForKey: @"NSAllowsTickMarkValuesOnly"]; } else { NSInteger version = [coder versionForClassName: @"NSSliderCell"]; double value; @@ -119,8 +119,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [coder decodeValuesOfObjCTypes: "dddf@", &_maxValue, _minValue, &value, &f1, &obj]; } else { - [coder - decodeValuesOfObjCTypes: "ddd", &_maxValue, _minValue, &value]; + [coder decodeValuesOfObjCTypes: "ddd", &_maxValue, _minValue, + &value]; [self setTitle: @""]; _altIncrementValue = 0; } @@ -250,9 +250,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (double) tickMarkValueAtIndex: (NSInteger) index { double scale = - (_numberOfTickMarks == 1) - ? 0.5 - : (((double) index) / ((double) (_numberOfTickMarks - 1))); + (_numberOfTickMarks == 1) + ? 0.5 + : (((double) index) / ((double) (_numberOfTickMarks - 1))); return _minValue + (_maxValue - _minValue) * scale; } @@ -282,11 +282,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSRect) rectOfTickMarkAtIndex: (NSInteger) index { NSRect result; CGFloat length = - (_isVertical ? _lastRect.size.height : _lastRect.size.width) - - 2 * PIXELINSET; - CGFloat position = floor((_numberOfTickMarks == 1) - ? length / 2 - : index * (length / (_numberOfTickMarks - 1))); + (_isVertical ? _lastRect.size.height : _lastRect.size.width) - + 2 * PIXELINSET; + CGFloat position = + floor((_numberOfTickMarks == 1) + ? length / 2 + : index * (length / (_numberOfTickMarks - 1))); if (_isVertical) { result.origin.x = _lastRect.origin.x; @@ -309,9 +310,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) drawBarInside: (NSRect) frame flipped: (BOOL) isFlipped { [[_controlView graphicsStyle] - drawSliderTrackInRect: frame - vertical: [self isVertical] - hasTickMarks: (_numberOfTickMarks > 0) ? YES : NO]; + drawSliderTrackInRect: frame + vertical: [self isVertical] + hasTickMarks: (_numberOfTickMarks > 0) ? YES : NO]; } - (NSRect) _sliderRect { @@ -338,28 +339,28 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSRect sliderRect = [self _sliderRect]; NSRect knobRect; NSSize knobSize = [[_controlView graphicsStyle] - sliderKnobSizeForControlSize: [self controlSize]]; + sliderKnobSizeForControlSize: [self controlSize]]; if ([self isVertical]) { knobRect.size.height = knobSize.width; knobRect.size.width = knobSize.height; knobRect.origin.x = - floor(sliderRect.origin.x + - (sliderRect.size.width - knobSize.height) / 2); + floor(sliderRect.origin.x + + (sliderRect.size.width - knobSize.height) / 2); knobRect.origin.y = - floor(sliderRect.origin.y + PIXELINSET + - percent * (sliderRect.size.height - (PIXELINSET * 2)) - - knobSize.width / 2); + floor(sliderRect.origin.y + PIXELINSET + + percent * (sliderRect.size.height - (PIXELINSET * 2)) - + knobSize.width / 2); } else { knobRect.size.width = knobSize.width; knobRect.size.height = knobSize.height; knobRect.origin.x = - floor(sliderRect.origin.x + PIXELINSET + - percent * (sliderRect.size.width - (PIXELINSET * 2)) - - knobSize.width / 2); + floor(sliderRect.origin.x + PIXELINSET + + percent * (sliderRect.size.width - (PIXELINSET * 2)) - + knobSize.width / 2); knobRect.origin.y = - floor(sliderRect.origin.y + - (sliderRect.size.height - knobSize.height) / 2); + floor(sliderRect.origin.y + + (sliderRect.size.height - knobSize.height) / 2); } return knobRect; @@ -371,11 +372,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) drawKnob: (NSRect) rect { [[_controlView graphicsStyle] - drawSliderKnobInRect: rect - vertical: [self isVertical] - highlighted: [self isHighlighted] - hasTickMarks: (_numberOfTickMarks > 0) ? YES : NO - tickMarkPosition: _tickMarkPosition]; + drawSliderKnobInRect: rect + vertical: [self isVertical] + highlighted: [self isHighlighted] + hasTickMarks: (_numberOfTickMarks > 0) ? YES : NO + tickMarkPosition: _tickMarkPosition]; } - (void) drawTickMarks { @@ -400,9 +401,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static NSGradient *gradient = nil; if (gradient == nil) { gradient = [[NSGradient alloc] - initWithColorsAndLocations: [NSColor whiteColor], 0, - [NSColor lightGrayColor], 0.5, - [NSColor whiteColor], 1, nil]; + initWithColorsAndLocations: [NSColor whiteColor], 0, + [NSColor lightGrayColor], 0.5, + [NSColor whiteColor], 1, nil]; } return gradient; } @@ -411,10 +412,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static NSGradient *gradient = nil; if (gradient == nil) { gradient = [[NSGradient alloc] - initWithColorsAndLocations: [NSColor grayColor], 0, - [NSColor clearColor], 0.3, - [NSColor clearColor], 0.7, - [NSColor grayColor], 1, nil]; + initWithColorsAndLocations: [NSColor grayColor], 0, + [NSColor clearColor], 0.3, + [NSColor clearColor], 0.7, + [NSColor grayColor], 1, nil]; } return gradient; } @@ -423,10 +424,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static NSGradient *gradient = nil; if (gradient == nil) { gradient = [[NSGradient alloc] - initWithColorsAndLocations: [NSColor darkGrayColor], 0, - [NSColor darkGrayColor], 0.49, - [NSColor lightGrayColor], 0.51, - [NSColor lightGrayColor], 1, nil]; + initWithColorsAndLocations: [NSColor darkGrayColor], 0, + [NSColor darkGrayColor], 0.49, + [NSColor lightGrayColor], 0.51, + [NSColor lightGrayColor], 1, nil]; } return gradient; } @@ -438,7 +439,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Square it up if (frame.size.width > frame.size.height) { sliderRect = NSInsetRect( - sliderRect, (frame.size.width - frame.size.height) / 2.f, 0); + sliderRect, (frame.size.width - frame.size.height) / 2.f, 0); } else { sliderRect = NSInsetRect(sliderRect, 0, (frame.size.height - frame.size.width) / 2.f); @@ -619,7 +620,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } // Get the angle and ensure it's in 0..2*PI - 0Ë™ is top center double angle = fmod(atan2(center.y - point.y, center.x - point.x) - M_PI_2 + - M_PI * 2.f, + M_PI * 2.f, M_PI * 2.f); // Convert to degrees diff --git a/AppKit/NSSound.m b/AppKit/NSSound.m index c0ea83e0..cbabe76f 100644 --- a/AppKit/NSSound.m +++ b/AppKit/NSSound.m @@ -58,10 +58,11 @@ static NSMutableDictionary *sSounds = nil; if ([[NSBundle mainBundle] pathForResource: name ofType: type]) { sound = [[[NSSound alloc] - initWithContentsOfFile: [[NSBundle mainBundle] - pathForResource: name - ofType: type] - byReference: NO] autorelease]; + initWithContentsOfFile: + [[NSBundle mainBundle] + pathForResource: name + ofType: type] + byReference: NO] autorelease]; // Store it for quick access if asked again [sSounds setObject: sound forKey: name]; } diff --git a/AppKit/NSSpellChecker.m b/AppKit/NSSpellChecker.m index fd87c9c5..8fecc9d6 100644 --- a/AppKit/NSSpellChecker.m +++ b/AppKit/NSSpellChecker.m @@ -30,23 +30,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSSpellCheckerDidChangeAutomaticTextReplacementNotification = - @"NSSpellCheckerDidChangeAutomaticTextReplacementNotification"; + @"NSSpellCheckerDidChangeAutomaticTextReplacementNotification"; NSString *const NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification = - @"NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification"; + @"NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification"; NSString *const NSTextCheckingOrthographyKey = @"NSTextCheckingOrthographyKey"; NSString *const NSTextCheckingQuotesKey = @"NSTextCheckingQuotesKey"; NSString *const NSTextCheckingReplacementsKey = - @"NSTextCheckingReplacementsKey"; + @"NSTextCheckingReplacementsKey"; NSString *const NSTextCheckingReferenceDateKey = - @"NSTextCheckingReferenceDateKey"; + @"NSTextCheckingReferenceDateKey"; NSString *const NSTextCheckingReferenceTimeZoneKey = - @"NSTextCheckingReferenceTimeZoneKey"; + @"NSTextCheckingReferenceTimeZoneKey"; NSString *const NSTextCheckingDocumentURLKey = @"NSTextCheckingDocumentURLKey"; NSString *const NSTextCheckingDocumentTitleKey = - @"NSTextCheckingDocumentTitleKey"; + @"NSTextCheckingDocumentTitleKey"; NSString *const NSTextCheckingDocumentAuthorKey = - @"NSTextCheckingDocumentAuthorKey"; + @"NSTextCheckingDocumentAuthorKey"; #define SPELLCHECK_DEBUG 0 @@ -103,7 +103,7 @@ static NSSpellChecker *shared = nil; } [availableLanguages - sortUsingSelector: @selector(caseInsensitiveCompare:)]; + sortUsingSelector: @selector(caseInsensitiveCompare:)]; } return availableLanguages; @@ -152,8 +152,9 @@ static NSSpellChecker *shared = nil; - (NSSpellingViewController *) _spellingViewController { if (_spellingViewController == nil) { _spellingViewController = [[NSSpellingViewController alloc] - initWithNibName: @"NSSpellingViewController" - bundle: [NSBundle bundleForClass: [NSSpellingViewController + initWithNibName: @"NSSpellingViewController" + bundle: [NSBundle bundleForClass: + [NSSpellingViewController class]]]; } return (NSSpellingViewController *) _spellingViewController; @@ -166,18 +167,20 @@ static NSSpellChecker *shared = nil; NSView *view = [vc view]; NSRect frame = [view frame]; - _spellingPanel = [[NSPanel alloc] - initWithContentRect: frame - styleMask: NSUtilityWindowMask | NSResizableWindowMask | - NSClosableWindowMask - backing: NSBackingStoreBuffered - defer: YES]; + _spellingPanel = + [[NSPanel alloc] initWithContentRect: frame + styleMask: NSUtilityWindowMask | + NSResizableWindowMask | + NSClosableWindowMask + backing: NSBackingStoreBuffered + defer: YES]; [_spellingPanel - setTitle: NSLocalizedStringFromTableInBundle( - @"Spelling", nil, - [NSBundle bundleForClass: [NSSpellChecker class]], - @"The title of the spelling dialog")]; + setTitle: NSLocalizedStringFromTableInBundle( + @"Spelling", nil, + [NSBundle bundleForClass: [NSSpellChecker + class]], + @"The title of the spelling dialog")]; [view setFrameOrigin: NSMakePoint(0, 10)]; [[_spellingPanel contentView] addSubview: view]; [_spellingPanel setMinSize: frame.size]; @@ -218,7 +221,7 @@ static NSSpellChecker *shared = nil; } - (void) setSubstitutionsPanelAccessoryViewController: - (NSViewController *) viewController + (NSViewController *) viewController { NSUnimplementedMethod(); } @@ -236,13 +239,13 @@ static NSSpellChecker *shared = nil; - (NSRange) checkSpellingOfString: (NSString *) string startingAt: (NSInteger) offset { - return - [self checkSpellingOfString: string - startingAt: offset - language: [[NSLocale currentLocale] localeIdentifier] - wrap: NO - inSpellDocumentWithTag: 0 - wordCount: NULL]; + return [self + checkSpellingOfString: string + startingAt: offset + language: [[NSLocale currentLocale] localeIdentifier] + wrap: NO + inSpellDocumentWithTag: 0 + wordCount: NULL]; } - (NSRange) checkSpellingOfString: (NSString *) string @@ -261,23 +264,23 @@ static NSSpellChecker *shared = nil; if (language != nil) { NSDictionary *languageMap = [NSDictionary - dictionaryWithObject: [NSArray arrayWithObject: language] - forKey: @"Latn"]; + dictionaryWithObject: [NSArray arrayWithObject: language] + forKey: @"Latn"]; NSOrthography *orthography = - [NSOrthography orthographyWithDominantScript: @"Latn" - languageMap: languageMap]; + [NSOrthography orthographyWithDominantScript: @"Latn" + languageMap: languageMap]; [options setObject: orthography forKey: NSTextCheckingOrthographyKey]; } - NSArray *checking = [self - checkString: string - range: NSMakeRange(offset, [string length] - offset) - types: NSTextCheckingTypeSpelling - options: options - inSpellDocumentWithTag: tag - orthography: NULL - wordCount: wordCount]; + NSArray *checking = [self checkString: string + range: NSMakeRange(offset, + [string length] - offset) + types: NSTextCheckingTypeSpelling + options: options + inSpellDocumentWithTag: tag + orthography: NULL + wordCount: wordCount]; if ([checking count] == 0) return NSMakeRange(0, 0); @@ -299,12 +302,12 @@ static NSSpellChecker *shared = nil; } - (NSArray *) checkString: (NSString *) string - range: (NSRange) range - types: (NSTextCheckingTypes) types - options: (NSDictionary *) options - inSpellDocumentWithTag: (NSInteger) tag - orthography: (NSOrthography **) orthography - wordCount: (NSInteger *) wordCount + range: (NSRange) range + types: (NSTextCheckingTypes) types + options: (NSDictionary *) options + inSpellDocumentWithTag: (NSInteger) tag + orthography: (NSOrthography **) orthography + wordCount: (NSInteger *) wordCount { NSSpellEngine *spellEngine = [[self class] _currentSpellEngine]; @@ -324,12 +327,12 @@ static NSSpellChecker *shared = nil; NSString *substring = [string substringToIndex: NSMaxRange(range)]; NSArray *results = [spellEngine - checkString: substring - offset: range.location - types: types - options: options - orthography: [options objectForKey: NSTextCheckingOrthographyKey] - wordCount: wordCount]; + checkString: substring + offset: range.location + types: types + options: options + orthography: [options objectForKey: NSTextCheckingOrthographyKey] + wordCount: wordCount]; #if DEBUG_CHECKSTRING NSLog(@" substring: %@", substring); @@ -349,9 +352,10 @@ static NSSpellChecker *shared = nil; options: (NSDictionary *) options inSpellDocumentWithTag: (NSInteger) tag completionHandler: - (void (^)(NSInteger sequenceNumber, NSArray *results, - NSOrthography *orthography, - NSInteger wordCount)) completionHandler + (void (^)(NSInteger sequenceNumber, + NSArray *results, + NSOrthography *orthography, + NSInteger wordCount)) completionHandler { NSUnimplementedMethod(); return 0; @@ -405,7 +409,7 @@ static NSSpellChecker *shared = nil; } - (void) setIgnoredWords: (NSArray *) ignoredWords - inSpellDocumentWithTag: (NSInteger) tag + inSpellDocumentWithTag: (NSInteger) tag { [[self _dataForDocumentTag: tag] setIgnoredWords: ignoredWords]; } @@ -481,14 +485,15 @@ static NSSpellChecker *shared = nil; if ([guesses count] == 0) { NSMenuItem *item = [result - addItemWithTitle: NSLocalizedStringFromTableInBundle( - @"< No Suggestions >", nil, - [NSBundle - bundleForClass: [NSSpellChecker class]], - @"Shown when there are no selections from " - @"the spell checker") - action: NULL - keyEquivalent: @""]; + addItemWithTitle: + NSLocalizedStringFromTableInBundle( + @"< No Suggestions >", nil, + [NSBundle + bundleForClass: [NSSpellChecker class]], + @"Shown when there are no selections from " + @"the spell checker") + action: NULL + keyEquivalent: @""]; [item setEnabled: NO]; } else { for (NSString *guess in guesses) @@ -516,8 +521,8 @@ static NSSpellChecker *shared = nil; alternativeStrings: (NSArray *) alternativeStrings forStringInRect: (NSRect) rect view: (NSView *) view - completionHandler: - (void (^)(NSString *acceptedString)) completionBlock + completionHandler: (void (^)(NSString *acceptedString)) + completionBlock { NSUnimplementedMethod(); } @@ -533,10 +538,10 @@ static NSSpellChecker *shared = nil; } - (void) recordResponse: (NSCorrectionResponse) response - toCorrection: (NSString *) correction - forWord: (NSString *) word - language: (NSString *) language - inSpellDocumentWithTag: (NSInteger) tag + toCorrection: (NSString *) correction + forWord: (NSString *) word + language: (NSString *) language + inSpellDocumentWithTag: (NSInteger) tag { NSUnimplementedMethod(); } diff --git a/AppKit/NSSpellingViewController.m b/AppKit/NSSpellingViewController.m index b5c311fe..21f45b74 100644 --- a/AppKit/NSSpellingViewController.m +++ b/AppKit/NSSpellingViewController.m @@ -50,8 +50,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSString *currentWord = [self currentWord]; NSString *currentLanguage = [self _currentLanguage]; NSArray *currentGuesses = - [[self currentSpellEngine] suggestGuessesForWord: currentWord - inLanguage: currentLanguage]; + [[self currentSpellEngine] suggestGuessesForWord: currentWord + inLanguage: currentLanguage]; return currentGuesses; } @@ -61,8 +61,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - tableView: (NSTableView *) tableView - objectValueForTableColumn: (NSTableColumn *) tableColumn - row: (NSInteger) row + objectValueForTableColumn: (NSTableColumn *) tableColumn + row: (NSInteger) row { return [[self currentGuesses] objectAtIndex: row]; } @@ -89,30 +89,30 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) change: sender { [[[NSApp mainWindow] firstResponder] - tryToPerform: @selector(changeSpelling:) - with: _currentWord]; + tryToPerform: @selector(changeSpelling:) + with: _currentWord]; // And automatically move to the next word - this matches Cocoa Spelling // panel behaviour [[[NSApp mainWindow] firstResponder] - tryToPerform: @selector(checkSpelling:) - with: [NSSpellChecker sharedSpellChecker]]; + tryToPerform: @selector(checkSpelling:) + with: [NSSpellChecker sharedSpellChecker]]; } - (void) findNext: sender { [[[NSApp mainWindow] firstResponder] - tryToPerform: @selector(checkSpelling:) - with: [NSSpellChecker sharedSpellChecker]]; + tryToPerform: @selector(checkSpelling:) + with: [NSSpellChecker sharedSpellChecker]]; } - (void) ignore: sender { [[[NSApp mainWindow] firstResponder] - tryToPerform: @selector(ignoreSpelling:) - with: _currentWord]; + tryToPerform: @selector(ignoreSpelling:) + with: _currentWord]; // And automatically move to the next word - this matches Cocoa Spelling // panel behaviour [[[NSApp mainWindow] firstResponder] - tryToPerform: @selector(checkSpelling:) - with: [NSSpellChecker sharedSpellChecker]]; + tryToPerform: @selector(checkSpelling:) + with: [NSSpellChecker sharedSpellChecker]]; } - (void) learn: sender { @@ -120,8 +120,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // And automatically move to the next word - this matches Cocoa Spelling // panel behaviour [[[NSApp mainWindow] firstResponder] - tryToPerform: @selector(checkSpelling:) - with: [NSSpellChecker sharedSpellChecker]]; + tryToPerform: @selector(checkSpelling:) + with: [NSSpellChecker sharedSpellChecker]]; } - (void) guess: sender { diff --git a/AppKit/NSSplitView.m b/AppKit/NSSplitView.m index e8c6c4be..d2f8cbf8 100644 --- a/AppKit/NSSplitView.m +++ b/AppKit/NSSplitView.m @@ -30,9 +30,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSSplitViewDidResizeSubviewsNotification = - @"NSSplitViewDidResizeSubviewsNotification"; + @"NSSplitViewDidResizeSubviewsNotification"; NSString *const NSSplitViewWillResizeSubviewsNotification = - @"NSSplitViewWillResizeSubviewsNotification"; + @"NSSplitViewWillResizeSubviewsNotification"; @implementation NSSplitView @@ -68,42 +68,42 @@ NSString *const NSSplitViewWillResizeSubviewsNotification = - (void) _postNoteWillResize { [[NSNotificationCenter defaultCenter] - postNotificationName: NSSplitViewWillResizeSubviewsNotification - object: self]; + postNotificationName: NSSplitViewWillResizeSubviewsNotification + object: self]; } - (void) _postNoteDidResize { [[NSNotificationCenter defaultCenter] - postNotificationName: NSSplitViewDidResizeSubviewsNotification - object: self]; + postNotificationName: NSSplitViewDidResizeSubviewsNotification + object: self]; } - (void) setDelegate: (id) delegate { if ([_delegate respondsToSelector: @selector(splitViewDidResizeSubviews:)]) [[NSNotificationCenter defaultCenter] - removeObserver: _delegate - name: NSSplitViewDidResizeSubviewsNotification - object: self]; + removeObserver: _delegate + name: NSSplitViewDidResizeSubviewsNotification + object: self]; if ([_delegate respondsToSelector: @selector(splitViewWillResizeSubviews:)]) [[NSNotificationCenter defaultCenter] - removeObserver: _delegate - name: NSSplitViewWillResizeSubviewsNotification - object: self]; + removeObserver: _delegate + name: NSSplitViewWillResizeSubviewsNotification + object: self]; _delegate = delegate; if ([_delegate respondsToSelector: @selector(splitViewDidResizeSubviews:)]) [[NSNotificationCenter defaultCenter] - addObserver: _delegate - selector: @selector(splitViewDidResizeSubviews:) - name: NSSplitViewDidResizeSubviewsNotification - object: self]; + addObserver: _delegate + selector: @selector(splitViewDidResizeSubviews:) + name: NSSplitViewDidResizeSubviewsNotification + object: self]; if ([_delegate respondsToSelector: @selector(splitViewWillResizeSubviews:)]) [[NSNotificationCenter defaultCenter] - addObserver: _delegate - selector: @selector(splitViewWillResizeSubviews:) - name: NSSplitViewWillResizeSubviewsNotification - object: self]; + addObserver: _delegate + selector: @selector(splitViewWillResizeSubviews:) + name: NSSplitViewWillResizeSubviewsNotification + object: self]; } - (void) setVertical: (BOOL) flag { @@ -153,7 +153,7 @@ NSString *const NSSplitViewWillResizeSubviewsNotification = // The available width to the subviews CGFloat totalWidthAfter = - [self bounds].size.width - [self dividerThickness] * (count - 1); + [self bounds].size.width - [self dividerThickness] * (count - 1); for (i = 0; i < count; i++) { NSView *subview = [_subviews objectAtIndex: i]; @@ -193,7 +193,7 @@ NSString *const NSSplitViewWillResizeSubviewsNotification = // (or something like that...) Apple says They resize proportionally CGFloat totalHeightBefore = 0.; CGFloat totalHeightAfter = - [self bounds].size.height - [self dividerThickness] * (count - 1); + [self bounds].size.height - [self dividerThickness] * (count - 1); for (i = 0; i < count; i++) { NSView *subview = [_subviews objectAtIndex: i]; @@ -311,7 +311,7 @@ NSString *const NSSplitViewWillResizeSubviewsNotification = oldSize.height = 1; if ([_delegate respondsToSelector: @selector(splitView: - resizeSubviewsWithOldSize:)]) { + resizeSubviewsWithOldSize:)]) { [_delegate splitView: self resizeSubviewsWithOldSize: oldSize]; } else { @@ -382,8 +382,8 @@ static CGFloat constrainTo(CGFloat value, CGFloat min, CGFloat max) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSPoint point; - event = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; eventType = [event type]; point = [self convertPoint: [event locationInWindow] fromView: nil]; @@ -516,22 +516,22 @@ static CGFloat constrainTo(CGFloat value, CGFloat min, CGFloat max) { constrainMaxCoordinate: maxPosition ofSubviewAt: index]; } - } else if ([_delegate - respondsToSelector: @selector - (splitView: - constrainMinCoordinate:maxCoordinate:ofSubviewAt:)]) { + } else if ([_delegate respondsToSelector: @selector + (splitView: + constrainMinCoordinate:maxCoordinate + :ofSubviewAt:)]) { // Use the deprecated API [_delegate splitView: self - constrainMinCoordinate: &minPosition - maxCoordinate: &maxPosition - ofSubviewAt: index]; + constrainMinCoordinate: &minPosition + maxCoordinate: &maxPosition + ofSubviewAt: index]; } // And if it wants to constrain the divider position BOOL delegateWantsTrackConstraining = [_delegate - respondsToSelector: @selector(splitView: - constrainSplitPosition:ofSubviewAt:)]; + respondsToSelector: @selector(splitView: + constrainSplitPosition:ofSubviewAt:)]; if (delegateWantsTrackConstraining) { position = [_delegate splitView: self @@ -545,7 +545,7 @@ static CGFloat constrainTo(CGFloat value, CGFloat min, CGFloat max) { BOOL subviewsWereCollapsedOrExpanded = NO; BOOL checkWithDelegateAboutCollapsingViews = [_delegate - respondsToSelector: @selector(splitView:canCollapseSubview:)]; + respondsToSelector: @selector(splitView:canCollapseSubview:)]; if ([self isVertical]) { CGFloat lastPosition = NSMaxX(resize0); @@ -581,11 +581,11 @@ static CGFloat constrainTo(CGFloat value, CGFloat min, CGFloat max) { // Figure out the adjusted widths resize0.size.width = - constrainTo(NSWidth(resize0), minPosition, maxPosition); + constrainTo(NSWidth(resize0), minPosition, maxPosition); resize1.size.width = - constrainTo(NSWidth(resize1), minPosition, maxPosition); + constrainTo(NSWidth(resize1), minPosition, maxPosition); resize1.origin.x = - (NSMinX(frame1) + NSWidth(frame1)) - NSWidth(resize1); + (NSMinX(frame1) + NSWidth(frame1)) - NSWidth(resize1); } else { CGFloat lastPosition = NSMaxY(resize0); @@ -620,11 +620,11 @@ static CGFloat constrainTo(CGFloat value, CGFloat min, CGFloat max) { // Figure out the adjusted heights resize0.size.height = - constrainTo(NSHeight(resize0), minPosition, maxPosition); + constrainTo(NSHeight(resize0), minPosition, maxPosition); resize1.size.height = - constrainTo(NSHeight(resize1), minPosition, maxPosition); + constrainTo(NSHeight(resize1), minPosition, maxPosition); resize1.origin.y = - (NSMinY(frame1) + NSHeight(frame1)) - NSHeight(resize1); + (NSMinY(frame1) + NSHeight(frame1)) - NSHeight(resize1); } if (subviewsWereCollapsedOrExpanded) { diff --git a/AppKit/NSStatusBar.m b/AppKit/NSStatusBar.m index b671a0a0..a9989e14 100644 --- a/AppKit/NSStatusBar.m +++ b/AppKit/NSStatusBar.m @@ -42,10 +42,10 @@ static NSStatusBar *_statusBar = nil; if (self) { _statusItems = [[NSMutableArray alloc] init]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(handleApplicationClose) - name: @"NSApplicationWillTerminateNotification" - object: nil]; + addObserver: self + selector: @selector(handleApplicationClose) + name: @"NSApplicationWillTerminateNotification" + object: nil]; } return self; } @@ -114,10 +114,10 @@ static NSStatusBar *_statusBar = nil; - (Win32Window *) fakeWindow { if (!_fakeWindow) { _fakeWindow = [[Win32Window alloc] - initWithFrame: CGRectMake(0, 0, 1, 1) - styleMask: (unsigned) NSBorderlessWindowMask - isPanel: NO - backingType: CGSBackingStoreRetained]; + initWithFrame: CGRectMake(0, 0, 1, 1) + styleMask: (unsigned) NSBorderlessWindowMask + isPanel: NO + backingType: CGSBackingStoreRetained]; } [_fakeWindow makeTransparent]; [_fakeWindow showWindowWithoutActivation]; diff --git a/AppKit/NSStatusItem.m b/AppKit/NSStatusItem.m index 152e2a6d..eb5c7a40 100644 --- a/AppKit/NSStatusItem.m +++ b/AppKit/NSStatusItem.m @@ -71,10 +71,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ case WM_RBUTTONUP: NSLog(@"Clicked Contextual"); [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(processCommandEvent:) - name: @"WIN32_WM_COMMAND" - object: nil]; + addObserver: self + selector: @selector(processCommandEvent:) + name: @"WIN32_WM_COMMAND" + object: nil]; [self _showContextMenu]; break; case WM_LBUTTONUP: @@ -142,14 +142,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef context = CGBitmapContextCreate( - NULL, width, height, 8, 0, colorSpace, - kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); + NULL, width, height, 8, 0, colorSpace, + kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); CGColorSpaceRelease(colorSpace); NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSGraphicsContext *graphicsContext = - [NSGraphicsContext graphicsContextWithGraphicsPort: context - flipped: NO]; + [NSGraphicsContext graphicsContextWithGraphicsPort: context + flipped: NO]; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext: graphicsContext]; diff --git a/AppKit/NSStepperCell.m b/AppKit/NSStepperCell.m index 699c39ce..998ba009 100644 --- a/AppKit/NSStepperCell.m +++ b/AppKit/NSStepperCell.m @@ -132,9 +132,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // not so pretty - (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) cellFrame - ofView: (NSView *) controlView - untilMouseUp: (BOOL) untilMouseUp + inRect: (NSRect) cellFrame + ofView: (NSView *) controlView + untilMouseUp: (BOOL) untilMouseUp { NSPoint point; double delta = 0.0; @@ -177,8 +177,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [(NSControl *) controlView sendAction: _action to: _target]; event = [[controlView window] - nextEventMatchingMask: NSPeriodicMask | NSLeftMouseUpMask | - NSLeftMouseDraggedMask]; + nextEventMatchingMask: NSPeriodicMask | NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } if ([event type] == NSLeftMouseUp) untilMouseUp = NO; @@ -198,17 +198,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _controlView = controlView; [[_controlView graphicsStyle] - drawStepperButtonInRect: [self _upArrowFrameForFrame: frame] - clipRect: frame - enabled: [self isEnabled] - highlighted: _isUpHighlighted - upNotDown: YES]; + drawStepperButtonInRect: [self _upArrowFrameForFrame: frame] + clipRect: frame + enabled: [self isEnabled] + highlighted: _isUpHighlighted + upNotDown: YES]; [[_controlView graphicsStyle] - drawStepperButtonInRect: [self _downArrowFrameForFrame: frame] - clipRect: frame - enabled: [self isEnabled] - highlighted: _isDownHighlighted - upNotDown: NO]; + drawStepperButtonInRect: [self _downArrowFrameForFrame: frame] + clipRect: frame + enabled: [self isEnabled] + highlighted: _isDownHighlighted + upNotDown: NO]; if ([[controlView window] firstResponder] == controlView) { if ([controlView isKindOfClass: [NSMatrix class]]) { diff --git a/AppKit/NSStringDrawer.h b/AppKit/NSStringDrawer.h index c5107504..93e5ec47 100644 --- a/AppKit/NSStringDrawer.h +++ b/AppKit/NSStringDrawer.h @@ -37,13 +37,13 @@ const CGFloat NSStringDrawerLargeDimension; withAttributes: (NSDictionary *) attributes inSize: (NSSize) maxSize; - (void) drawString: (NSString *) string - withAttributes: (NSDictionary *) attributes - inRect: (NSRect) rect; + withAttributes: (NSDictionary *) attributes + inRect: (NSRect) rect; // Use a size of NSZeroSize for unlimited dimensions. - (void) drawString: (NSString *) string - withAttributes: (NSDictionary *) attributes - atPoint: (NSPoint) point - inSize: (NSSize) maxSize; + withAttributes: (NSDictionary *) attributes + atPoint: (NSPoint) point + inSize: (NSSize) maxSize; // Use a size of NSZeroSize for unlimited dimensions. - (NSSize) sizeOfAttributedString: (NSAttributedString *) astring diff --git a/AppKit/NSStringDrawer.m b/AppKit/NSStringDrawer.m index d0d5bebd..95df0c9a 100644 --- a/AppKit/NSStringDrawer.m +++ b/AppKit/NSStringDrawer.m @@ -58,8 +58,8 @@ const CGFloat NSStringDrawerLargeDimension = 1000000.; [_textContainer setContainerSize: maxSize]; [_textStorage beginEditing]; [_textStorage - replaceCharactersInRange: NSMakeRange(0, [_textStorage length]) - withString: string]; + replaceCharactersInRange: NSMakeRange(0, [_textStorage length]) + withString: string]; [_textStorage setAttributes: attributes range: NSMakeRange(0, [_textStorage length])]; [_textStorage endEditing]; @@ -67,16 +67,16 @@ const CGFloat NSStringDrawerLargeDimension = 1000000.; } - (void) drawString: (NSString *) string - withAttributes: (NSDictionary *) attributes - inRect: (NSRect) rect + withAttributes: (NSDictionary *) attributes + inRect: (NSRect) rect { NSRange glyphRange; [_textContainer setContainerSize: rect.size]; [_textStorage beginEditing]; [_textStorage - replaceCharactersInRange: NSMakeRange(0, [_textStorage length]) - withString: string]; + replaceCharactersInRange: NSMakeRange(0, [_textStorage length]) + withString: string]; [_textStorage setAttributes: attributes range: NSMakeRange(0, [_textStorage length])]; [_textStorage endEditing]; @@ -89,9 +89,9 @@ const CGFloat NSStringDrawerLargeDimension = 1000000.; } - (void) drawString: (NSString *) string - withAttributes: (NSDictionary *) attributes - atPoint: (NSPoint) point - inSize: (NSSize) maxSize + withAttributes: (NSDictionary *) attributes + atPoint: (NSPoint) point + inSize: (NSSize) maxSize { NSRange glyphRange; @@ -102,8 +102,8 @@ const CGFloat NSStringDrawerLargeDimension = 1000000.; [_textContainer setContainerSize: maxSize]; [_textStorage beginEditing]; [_textStorage - replaceCharactersInRange: NSMakeRange(0, [_textStorage length]) - withString: string]; + replaceCharactersInRange: NSMakeRange(0, [_textStorage length]) + withString: string]; [_textStorage setAttributes: attributes range: NSMakeRange(0, [_textStorage length])]; [_textStorage endEditing]; @@ -165,9 +165,9 @@ const CGFloat NSStringDrawerLargeDimension = 1000000.; withAttributes: (NSDictionary *) attributes truncatingTail: (BOOL) truncateTail { - NSAttributedString *string = - [[[NSAttributedString alloc] initWithString: self - attributes: attributes] autorelease]; + NSAttributedString *string = [[[NSAttributedString alloc] + initWithString: self + attributes: attributes] autorelease]; [string _clipAndDrawInRect: rect truncatingTail: truncateTail]; } @@ -198,19 +198,20 @@ const CGFloat NSStringDrawerLargeDimension = 1000000.; // Create a "..." attributed string with the attributes of the last char // of this string NSDictionary *attributes = - [string attributesAtIndex: [string length] - 1 - effectiveRange: NULL]; + [string attributesAtIndex: [string length] - 1 + effectiveRange: NULL]; NSAttributedString *ellipsis = [[[NSAttributedString alloc] - initWithString: @"..." - attributes: attributes] autorelease]; + initWithString: @"..." + attributes: attributes] autorelease]; NSAttributedString *clippedTitle = string; do { clippedTitle = [clippedTitle - attributedSubstringFromRange: NSMakeRange( - 0, - [clippedTitle length] - 1)]; + attributedSubstringFromRange: NSMakeRange(0, + [clippedTitle + length] - + 1)]; NSMutableAttributedString *tmpString = - [[clippedTitle mutableCopy] autorelease]; + [[clippedTitle mutableCopy] autorelease]; [tmpString appendAttributedString: ellipsis]; string = tmpString; size = [string size]; diff --git a/AppKit/NSStringDrawing.m b/AppKit/NSStringDrawing.m index cd8a838a..216a465f 100644 --- a/AppKit/NSStringDrawing.m +++ b/AppKit/NSStringDrawing.m @@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSString (NSStringDrawing) - (void) drawAtPoint: (NSPoint) point - withAttributes: (NSDictionary *) attributes + withAttributes: (NSDictionary *) attributes { [[NSStringDrawer sharedStringDrawer] drawString: self withAttributes: attributes @@ -71,8 +71,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSSize) size { return [[NSStringDrawer sharedStringDrawer] - sizeOfAttributedString: self - inSize: NSZeroSize]; + sizeOfAttributedString: self + inSize: NSZeroSize]; } - (void) drawWithRect: (NSRect) rect options: (NSStringDrawingOptions) options { diff --git a/AppKit/NSSystemInfoPanel/NSSystemInfoPanel.m b/AppKit/NSSystemInfoPanel/NSSystemInfoPanel.m index 2ff5939b..de65d234 100644 --- a/AppKit/NSSystemInfoPanel/NSSystemInfoPanel.m +++ b/AppKit/NSSystemInfoPanel/NSSystemInfoPanel.m @@ -48,23 +48,24 @@ static NSSystemInfoPanel *_sharedInfoPanel = nil; - (void) _resetInfoPanel { NSImage *icon = - [NSImage imageNamed: [[[NSBundle mainBundle] infoDictionary] - objectForKey: @"CFBundleIconFile"]]; + [NSImage imageNamed: [[[NSBundle mainBundle] infoDictionary] + objectForKey: @"CFBundleIconFile"]]; if (icon != nil) [appIconView setImage: icon]; [appNameField setStringValue: [[[NSBundle mainBundle] infoDictionary] - objectForKey: @"CFBundleName"]]; + objectForKey: @"CFBundleName"]]; NSString *bundleVersion = [[[NSBundle mainBundle] infoDictionary] - objectForKey: @"CFBundleVersion"]; + objectForKey: @"CFBundleVersion"]; NSString *bundleShortVersion = [[[NSBundle mainBundle] infoDictionary] - objectForKey: @"CFBundleShortVersionString"]; + objectForKey: @"CFBundleShortVersionString"]; NSString *versionString = bundleVersion; if (bundleShortVersion != nil) - versionString = [NSString - stringWithFormat: @"%@ (%@)", bundleShortVersion, bundleVersion]; + versionString = + [NSString stringWithFormat: @"%@ (%@)", bundleShortVersion, + bundleVersion]; if (versionString != nil) [versionField setStringValue: versionString]; @@ -75,7 +76,7 @@ static NSSystemInfoPanel *_sharedInfoPanel = nil; resetFrameSize = frame.size.height; frame.size.height = resetFrameSize; NSString *resourceFileName = - [[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"]; + [[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"]; if (resourceFileName != nil) { frame.size.height += 170; [creditView readRTFDFromFile: resourceFileName]; @@ -83,15 +84,16 @@ static NSSystemInfoPanel *_sharedInfoPanel = nil; [creditScrollView setFrame: NSMakeRect(0, 0, 0, 0)]; [legalTextField - setStringValue: [[NSBundle mainBundle] + setStringValue: + [[NSBundle mainBundle] localizedStringForKey: @"NSHumanReadableCopyright" value: @" " table: @"InfoPlist"]]; frame.origin.y = - [[NSScreen mainScreen] frame].size.height - 150 - frame.size.height; + [[NSScreen mainScreen] frame].size.height - 150 - frame.size.height; frame.origin.x = - ([[NSScreen mainScreen] frame].size.width - frame.size.width) / 2.0; + ([[NSScreen mainScreen] frame].size.width - frame.size.width) / 2.0; [infoPanel setFrame: frame display: YES]; // [[infoPanel contentView] setNeedsDisplay:YES]; } @@ -113,14 +115,14 @@ static NSSystemInfoPanel *_sharedInfoPanel = nil; NSString *ApplicationName = [options objectForKey: @"ApplicationName"]; NSString *Version = [options objectForKey: @"Version"]; NSString *ApplicationVersion = - [options objectForKey: @"ApplicationVersion"]; + [options objectForKey: @"ApplicationVersion"]; NSString *Copyright = [options objectForKey: @"Copyright"]; // read plist contents NSString *CFBundleVersion = [[[NSBundle mainBundle] infoDictionary] - objectForKey: @"CFBundleVersion"]; + objectForKey: @"CFBundleVersion"]; NSString *CFBundleShortVersionString = [[[NSBundle mainBundle] - infoDictionary] objectForKey: @"CFBundleShortVersionString"]; + infoDictionary] objectForKey: @"CFBundleShortVersionString"]; // now begin setup @@ -135,23 +137,23 @@ static NSSystemInfoPanel *_sharedInfoPanel = nil; // construct version string according to docs NSString *VerUsed = Version ? Version : CFBundleVersion; NSString *AppVerUsed = - ApplicationVersion - ? ApplicationVersion - : [NSString - stringWithFormat: @"Version %@", CFBundleShortVersionString]; + ApplicationVersion + ? ApplicationVersion + : [NSString stringWithFormat: @"Version %@", + CFBundleShortVersionString]; if (!AppVerUsed) { if (VerUsed) [versionField - setStringValue: [NSString - stringWithFormat: @"Version %@", VerUsed]]; + setStringValue: [NSString stringWithFormat: @"Version %@", + VerUsed]]; else [versionField setStringValue: @""]; } else { if (VerUsed) [versionField - setStringValue: [NSString stringWithFormat: @"%@ (%@)", - AppVerUsed, - VerUsed]]; + setStringValue: [NSString stringWithFormat: @"%@ (%@)", + AppVerUsed, + VerUsed]]; else [versionField setStringValue: AppVerUsed]; } diff --git a/AppKit/NSTabView.m b/AppKit/NSTabView.m index 7aaccd5d..b9c79d2b 100644 --- a/AppKit/NSTabView.m +++ b/AppKit/NSTabView.m @@ -44,15 +44,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ unsigned flags = [keyed decodeIntForKey: @"NSTvFlags"]; _items = [[NSMutableArray alloc] - initWithArray: [keyed decodeObjectForKey: @"NSTabViewItems"]]; + initWithArray: [keyed decodeObjectForKey: @"NSTabViewItems"]]; _selectedItem = [keyed decodeObjectForKey: @"NSSelectedTabViewItem"]; _allowsTruncatedLabels = - [keyed decodeBoolForKey: @"NSAllowTruncatedLabels"]; + [keyed decodeBoolForKey: @"NSAllowTruncatedLabels"]; _drawsBackground = [keyed decodeBoolForKey: @"NSDrawsBackground"]; _controlSize = (flags & 0x18000000) >> 27; if (_font == nil) - _font = - [[NSFont boldSystemFontOfSize: 13 - _controlSize * 2] retain]; + _font = [[NSFont boldSystemFontOfSize: 13 - _controlSize * 2] + retain]; _type = (flags & 0x7); switch (_type) { @@ -135,11 +135,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ break; finalSize = - [[_items objectAtIndex: 0] sizeOfLabel: _allowsTruncatedLabels]; + [[_items objectAtIndex: 0] sizeOfLabel: _allowsTruncatedLabels]; for (i = 1; i < count; ++i) - finalSize.width += - [[_items objectAtIndex: i] sizeOfLabel: _allowsTruncatedLabels] - .width; + finalSize.width += [[_items objectAtIndex: i] + sizeOfLabel: _allowsTruncatedLabels] + .width; return finalSize; } @@ -289,7 +289,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (i = 0; i < count; ++i) if ([[(NSTabViewItem *) [_items objectAtIndex: i] identifier] - isEqual: identifier]) + isEqual: identifier]) return i; return NSNotFound; @@ -384,13 +384,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ BOOL selectItem = YES; if ([_delegate respondsToSelector: @selector(tabView: - shouldSelectTabViewItem:)]) + shouldSelectTabViewItem:)]) selectItem = [_delegate tabView: self shouldSelectTabViewItem: item]; if (selectItem) { if ([_delegate respondsToSelector: @selector(tabView: - willSelectTabViewItem:)]) + willSelectTabViewItem:)]) [_delegate tabView: self willSelectTabViewItem: item]; [[_selectedItem view] removeFromSuperview]; @@ -403,10 +403,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([item initialFirstResponder]) [[self window] - makeFirstResponder: [item initialFirstResponder]]; + makeFirstResponder: [item initialFirstResponder]]; if ([_delegate respondsToSelector: @selector(tabView: - didSelectTabViewItem:)]) + didSelectTabViewItem:)]) [_delegate tabView: self didSelectTabViewItem: item]; } // Since we're not opaque, we need to redraw the superview too @@ -421,7 +421,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) selectTabViewItemWithIdentifier: identifier { [self selectTabViewItemAtIndex: - [self indexOfTabViewItemWithIdentifier: identifier]]; + [self indexOfTabViewItemWithIdentifier: identifier]]; } - (void) selectFirstTabViewItem: sender { @@ -437,9 +437,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([sender respondsToSelector: @selector(indexOfSelectedItem)]) [self selectTabViewItemAtIndex: [sender indexOfSelectedItem]]; else if ([sender isKindOfClass: [NSMatrix class]]) - [self selectTabViewItemAtIndex: [[sender cells] - indexOfObject: [sender - selectedCell]]]; + [self selectTabViewItemAtIndex: + [[sender cells] indexOfObject: [sender selectedCell]]]; } - (NSRect) rectForItemBorderAtIndex: (unsigned) index { @@ -536,9 +535,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Shouldn't the view machinery do this automatically?? it might now [[self superview] setNeedsDisplay: YES]; do { - event = - [[self window] nextEventMatchingMask: NSLeftMouseUpMask | - NSLeftMouseDraggedMask]; + event = [[self window] + nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while ([event type] != NSLeftMouseUp); [_selectedItem setTabState: NSSelectedTab]; diff --git a/AppKit/NSTabViewItem.m b/AppKit/NSTabViewItem.m index 9940268f..9b429adc 100644 --- a/AppKit/NSTabViewItem.m +++ b/AppKit/NSTabViewItem.m @@ -38,8 +38,8 @@ NSString *_NSTruncatedStringWithAttributesInRect(NSString *string, while ([string length] > 1 && [string sizeWithAttributes: attributes].width > rect.size.width) { - string = - [string substringWithRange: NSMakeRange(0, [string length] - 1)]; + string = [string + substringWithRange: NSMakeRange(0, [string length] - 1)]; } if (length == [string length]) @@ -164,9 +164,9 @@ NSString *_NSTruncatedStringWithAttributesInRect(NSString *string, - (NSDictionary *) labelAttributes { return [NSDictionary - dictionaryWithObjectsAndKeys: [_tabView font], NSFontAttributeName, - [self _labelColor], - NSForegroundColorAttributeName, nil]; + dictionaryWithObjectsAndKeys: [_tabView font], NSFontAttributeName, + [self _labelColor], + NSForegroundColorAttributeName, nil]; } // our tabs draw too closely to the left mragin. @@ -176,7 +176,7 @@ NSString *_NSTruncatedStringWithAttributesInRect(NSString *string, rect.origin.x += ORIGIN_PADDING; if ([self sizeOfLabel: NO].width > rect.size.width && truncateLabel) { NSString *truncatedLabel = _NSTruncatedStringWithAttributesInRect( - _label, [self labelAttributes], rect); + _label, [self labelAttributes], rect); [truncatedLabel _clipAndDrawInRect: rect withAttributes: [self labelAttributes]]; } else @@ -192,7 +192,7 @@ NSString *_NSTruncatedStringWithAttributesInRect(NSString *string, // make sure that we don't return the uninitialized lastRect if (truncateLabel && _lastRect.size.width > 0) { NSString *truncatedLabel = _NSTruncatedStringWithAttributesInRect( - _label, [self labelAttributes], _lastRect); + _label, [self labelAttributes], _lastRect); size = [truncatedLabel sizeWithAttributes: [self labelAttributes]]; } size.width += SIZE_PADDING; diff --git a/AppKit/NSTableColumn.m b/AppKit/NSTableColumn.m index f7b052d9..d9afc27e 100644 --- a/AppKit/NSTableColumn.m +++ b/AppKit/NSTableColumn.m @@ -84,10 +84,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: @"<%@ 0x%08lx identifier: \"%@\" headerCell: %@ " - @"dataCell: %@ width: %f minWidth: %f maxWidth: %f>", - [self class], self, _identifier, _headerCell, - _dataCell, _width, _minWidth, _maxWidth]; + stringWithFormat: + @"<%@ 0x%08lx identifier: \"%@\" headerCell: %@ " + @"dataCell: %@ width: %f minWidth: %f maxWidth: %f>", + [self class], self, _identifier, _headerCell, _dataCell, + _width, _minWidth, _maxWidth]; } - (id) identifier { diff --git a/AppKit/NSTableHeaderCell.m b/AppKit/NSTableHeaderCell.m index 25ac43e4..9a623c27 100644 --- a/AppKit/NSTableHeaderCell.m +++ b/AppKit/NSTableHeaderCell.m @@ -45,11 +45,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView { _controlView = controlView; [[controlView graphicsStyle] - drawTableViewHeaderInRect: cellFrame - highlighted: [self isHighlighted]]; + drawTableViewHeaderInRect: cellFrame + highlighted: [self isHighlighted]]; [[self attributedStringValue] - _clipAndDrawInRect: [self titleRectForBounds: cellFrame] - truncatingTail: (_lineBreakMode > NSLineBreakByClipping)]; + _clipAndDrawInRect: [self titleRectForBounds: cellFrame] + truncatingTail: (_lineBreakMode > NSLineBreakByClipping)]; } @end diff --git a/AppKit/NSTableHeaderView.m b/AppKit/NSTableHeaderView.m index 3cc6e9fe..136d71cb 100644 --- a/AppKit/NSTableHeaderView.m +++ b/AppKit/NSTableHeaderView.m @@ -73,17 +73,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSSize spacing = [_tableView intercellSpacing]; if (column < 0 || column >= [[_tableView tableColumns] count]) { - [NSException - raise: NSInternalInconsistencyException - format: @"headerRectOfColumn: invalid index %d (valid {%d, %d})", - column, 0, [tableColumns count]]; + [NSException raise: NSInternalInconsistencyException + format: @"headerRectOfColumn: invalid index %d (valid {%d, " + @"%d})", + column, 0, [tableColumns count]]; } headerRect.size.width = - [[tableColumns objectAtIndex: column--] width] + spacing.width; + [[tableColumns objectAtIndex: column--] width] + spacing.width; while (column >= 0) headerRect.origin.x += - [[tableColumns objectAtIndex: column--] width] + spacing.width; + [[tableColumns objectAtIndex: column--] width] + spacing.width; return headerRect; } @@ -116,9 +116,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ columnRect.size.width = [column width] + spacing.width; [[column headerCell] - setHighlighted: [_tableView - isColumnSelected: [[_tableView tableColumns] - indexOfObject: column]]]; + setHighlighted: + [_tableView isColumnSelected: + [[_tableView tableColumns] + indexOfObject: column]]]; [[column headerCell] setControlView: self]; [[column headerCell] drawWithFrame: columnRect inView: self]; columnRect.origin.x += [column width] + spacing.width; @@ -142,8 +143,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([[_tableView delegate] respondsToSelector: @selector (tableView:mouseDownInHeaderOfTableColumn:)]) [[_tableView delegate] tableView: _tableView - mouseDownInHeaderOfTableColumn: [[_tableView tableColumns] - objectAtIndex: clickedColumn]]; + mouseDownInHeaderOfTableColumn: + [[_tableView tableColumns] + objectAtIndex: clickedColumn]]; if ([_tableView allowsColumnResizing]) { NSInteger i, count = [[_tableView tableColumns] count]; @@ -159,7 +161,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (NSMouseInRect(location, [self _resizeRectBeforeColumn: i], [self isFlipped])) { NSTableColumn *resizingColumn = - [[_tableView tableColumns] objectAtIndex: i - 1]; + [[_tableView tableColumns] objectAtIndex: i - 1]; CGFloat resizedColumnWidth = [resizingColumn width]; if (![resizingColumn isResizable]) @@ -175,15 +177,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ CGFloat newWidth = newPoint.x; theEvent = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | - NSLeftMouseDraggedMask]; + nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; newPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil]; newWidth = newPoint.x; for (q = 0; q < _resizedColumn; ++q) { newWidth -= [[[_tableView tableColumns] - objectAtIndex: q] width]; + objectAtIndex: q] width]; newWidth -= [_tableView intercellSpacing].width; } @@ -201,7 +203,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [[self window] invalidateCursorRectsForView: self]; [_tableView - noteColumnDidResizeWithOldWidth: resizedColumnWidth]; + noteColumnDidResizeWithOldWidth: resizedColumnWidth]; _resizedColumn = -1; return; @@ -213,12 +215,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([theEvent modifierFlags] & NSAlternateKeyMask) { // extend/change selection if ([_tableView - isColumnSelected: clickedColumn]) // deselect previously - // selected? + isColumnSelected: clickedColumn]) // deselect previously + // selected? [_tableView deselectColumn: clickedColumn]; else if ([_tableView allowsMultipleSelection] == YES) { [_tableView selectColumn: clickedColumn - byExtendingSelection: YES]; // add to selection + byExtendingSelection: YES]; // add to selection } } else if ([theEvent modifierFlags] & NSShiftKeyMask) { NSInteger startColumn = [_tableView selectedColumn]; @@ -234,7 +236,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [_tableView deselectAll: nil]; while (startColumn <= endColumn) [_tableView selectColumn: startColumn++ - byExtendingSelection: YES]; + byExtendingSelection: YES]; } else [_tableView selectColumn: clickedColumn byExtendingSelection: NO]; } diff --git a/AppKit/NSTableView.m b/AppKit/NSTableView.m index 79bf711d..bfb619f2 100644 --- a/AppKit/NSTableView.m +++ b/AppKit/NSTableView.m @@ -26,13 +26,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSTableViewSelectionIsChangingNotification = - @"NSTableViewSelectionIsChangingNotification"; + @"NSTableViewSelectionIsChangingNotification"; NSString *const NSTableViewSelectionDidChangeNotification = - @"NSTableViewSelectionDidChangeNotification"; + @"NSTableViewSelectionDidChangeNotification"; NSString *const NSTableViewColumnDidMoveNotification = - @"NSTableViewColumnDidMoveNotification"; + @"NSTableViewColumnDidMoveNotification"; NSString *const NSTableViewColumnDidResizeNotification = - @"NSTableViewColumnDidResizeNotification"; + @"NSTableViewColumnDidResizeNotification"; NSString *const NSTableViewRowViewKey = @"NSTableViewRowViewKey"; @@ -81,17 +81,17 @@ const CGFloat NSTableViewDefaultRowHeight = 16.0f; // established if ([[self _allUsedBinders] count] == 0) { [self bind: @"content" - toObject: destination - withKeyPath: @"arrangedObjects" - options: nil]; + toObject: destination + withKeyPath: @"arrangedObjects" + options: nil]; [self bind: @"sortDescriptors" - toObject: destination - withKeyPath: @"sortDescriptors" - options: nil]; + toObject: destination + withKeyPath: @"sortDescriptors" + options: nil]; [self bind: @"selectionIndexes" - toObject: destination - withKeyPath: @"selectionIndexes" - options: nil]; + toObject: destination + withKeyPath: @"selectionIndexes" + options: nil]; } } @@ -110,11 +110,11 @@ const CGFloat NSTableViewDefaultRowHeight = 16.0f; [_headerView setTableView: self]; _cornerView = [[keyed decodeObjectForKey: @"NSCornerView"] retain]; _tableColumns = [[NSMutableArray alloc] - initWithArray: [keyed decodeObjectForKey: @"NSTableColumns"]]; + initWithArray: [keyed decodeObjectForKey: @"NSTableColumns"]]; [_tableColumns makeObjectsPerformSelector: @selector(setTableView:) withObject: self]; _backgroundColor = - [[keyed decodeObjectForKey: @"NSBackgroundColor"] retain]; + [[keyed decodeObjectForKey: @"NSBackgroundColor"] retain]; _gridColor = [[keyed decodeObjectForKey: @"NSGridColor"] retain]; _rowHeightsCount = 0; _rowHeights = NULL; @@ -163,21 +163,21 @@ const CGFloat NSTableViewDefaultRowHeight = 16.0f; _allowsColumnReordering = YES; _allowsColumnResizing = YES; _autoresizesAllColumnsToFit = - NO; // the default isn't actually given in the spec, but this seems more - // like default behavior + NO; // the default isn't actually given in the spec, but this seems + // more like default behavior _allowsMultipleSelection = NO; _allowsEmptySelection = YES; _allowsColumnSelection = YES; _headerView = [[NSTableHeaderView alloc] - initWithFrame: NSMakeRect(0, 0, [self bounds].size.width, - _standardRowHeight + - _intercellSpacing.height)]; + initWithFrame: NSMakeRect(0, 0, [self bounds].size.width, + _standardRowHeight + + _intercellSpacing.height)]; [_headerView setTableView: self]; _cornerView = [[NSTableCornerView alloc] - initWithFrame: NSMakeRect(0, 0, _standardRowHeight, - _standardRowHeight)]; + initWithFrame: NSMakeRect(0, 0, _standardRowHeight, + _standardRowHeight)]; _tableColumns = [[NSMutableArray alloc] init]; _backgroundColor = [[NSColor controlBackgroundColor] retain]; @@ -386,8 +386,8 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { rect.size.width = 0.; count = [_tableColumns count]; for (i = 0; i < count; i++) - rect.size.width += - [[_tableColumns objectAtIndex: i] width] + _intercellSpacing.width; + rect.size.width += [[_tableColumns objectAtIndex: i] width] + + _intercellSpacing.width; rect.size.height = rowHeightAtIndex(self, row) + _intercellSpacing.height; return rect; @@ -406,18 +406,18 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { rect.origin.x = 0.; for (i = 0; i < column; i++) - rect.origin.x += - [[_tableColumns objectAtIndex: i] width] + _intercellSpacing.width; + rect.origin.x += [[_tableColumns objectAtIndex: i] width] + + _intercellSpacing.width; rect.origin.y = 0.; - rect.size.width = - [[_tableColumns objectAtIndex: column] width] + _intercellSpacing.width; + rect.size.width = [[_tableColumns objectAtIndex: column] width] + + _intercellSpacing.width; rect.size.height = 0.; for (i = 0; i < numberOfRows; i++) rect.size.height += - rowHeightAtIndex(self, i) + _intercellSpacing.height; + rowHeightAtIndex(self, i) + _intercellSpacing.height; rect.size.height = - MAX(rect.size.height, [[self superview] bounds].size.height); + MAX(rect.size.height, [[self superview] bounds].size.height); return rect; } @@ -460,8 +460,8 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { CGFloat width = 0.; for (i = 0; i < numberOfColumns; i++) { - width += - [[_tableColumns objectAtIndex: i] width] + _intercellSpacing.width; + width += [[_tableColumns objectAtIndex: i] width] + + _intercellSpacing.width; if (width > rect.origin.x) break; @@ -517,15 +517,15 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { frame.origin.x = 0.; for (i = 0; i < column; i++) - frame.origin.x += - [[_tableColumns objectAtIndex: i] width] + _intercellSpacing.width; + frame.origin.x += [[_tableColumns objectAtIndex: i] width] + + _intercellSpacing.width; frame.origin.y = 0.; for (i = 0; i < row; i++) frame.origin.y += rowHeightAtIndex(self, i) + _intercellSpacing.height; - frame.size.width = - [[_tableColumns objectAtIndex: column] width] + _intercellSpacing.width; + frame.size.width = [[_tableColumns objectAtIndex: column] width] + + _intercellSpacing.width; frame.size.height = rowHeightAtIndex(self, row) + _intercellSpacing.height; return frame; @@ -722,12 +722,12 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [_dataSource respondsToSelector: @selector (tableView:objectValueForTableColumn:row:)] == YES) return [_dataSource tableView: self - objectValueForTableColumn: tableColumn - row: row]; + objectValueForTableColumn: tableColumn + row: row]; id binder = [tableColumn _binderForBinding: @"value"]; id vals = [[binder destination] - valueForKeyPath: [binder valueForKey: @"keyPath"]]; + valueForKeyPath: [binder valueForKey: @"keyPath"]]; if (vals != nil) { return [vals objectAtIndex: row]; } @@ -815,7 +815,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [_currentEditor setDelegate: nil]; NSText *editor = [[self window] fieldEditor: YES forObject: self]; _currentEditor = - [[_editingCell setUpFieldEditorAttributes: editor] retain]; + [[_editingCell setUpFieldEditorAttributes: editor] retain]; [_currentEditor setDelegate: self]; [oldEditor release]; @@ -886,7 +886,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { // That's the setter for _selectedRowIndexes. - (void) selectRowIndexes: (NSIndexSet *) indexes - byExtendingSelection: (BOOL) extend + byExtendingSelection: (BOOL) extend { unsigned index; NSIndexSet *newIndexes; @@ -911,11 +911,11 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { } if (extend) { - NSMutableIndexSet *mutableIndexes = - [[NSMutableIndexSet alloc] initWithIndexSet: _selectedRowIndexes]; + NSMutableIndexSet *mutableIndexes = [[NSMutableIndexSet alloc] + initWithIndexSet: _selectedRowIndexes]; [mutableIndexes addIndexes: indexes]; - newIndexes = - [[[NSIndexSet alloc] initWithIndexSet: mutableIndexes] autorelease]; + newIndexes = [[[NSIndexSet alloc] initWithIndexSet: mutableIndexes] + autorelease]; [mutableIndexes release]; } else newIndexes = indexes; @@ -988,8 +988,8 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { } - (BOOL) isColumnSelected: (NSInteger) col { - return - [_selectedColumns containsObject: [_tableColumns objectAtIndex: col]]; + return [_selectedColumns + containsObject: [_tableColumns objectAtIndex: col]]; } - (NSEnumerator *) selectedColumnEnumerator { @@ -1002,7 +1002,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { for (i = 0; i < count; i++) { NSInteger index = [_tableColumns - indexOfObjectIdenticalTo: [_selectedColumns objectAtIndex: i]]; + indexOfObjectIdenticalTo: [_selectedColumns objectAtIndex: i]]; [result addIndex: index]; } @@ -1032,13 +1032,14 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { startRow = row; } [self selectRowIndexes: [NSIndexSet - indexSetWithIndexesInRange: - NSMakeRange(startRow, - endRow - startRow + 1)] - byExtendingSelection: NO]; + indexSetWithIndexesInRange: + NSMakeRange(startRow, + endRow - startRow + + 1)] + byExtendingSelection: NO]; } else [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row] - byExtendingSelection: NO]; + byExtendingSelection: NO]; } - (void) selectColumn: (NSInteger) column byExtendingSelection: (BOOL) extend { @@ -1065,7 +1066,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { if ([selectedRowIndexes containsIndex: row]) { NSMutableIndexSet *newSelection = - [[selectedRowIndexes mutableCopy] autorelease]; + [[selectedRowIndexes mutableCopy] autorelease]; [newSelection removeIndex: row]; [self selectRowIndexes: newSelection byExtendingSelection: NO]; @@ -1074,7 +1075,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { - (void) deselectColumn: (NSInteger) column { if ([_selectedColumns - containsObject: [_tableColumns objectAtIndex: column]]) { + containsObject: [_tableColumns objectAtIndex: column]]) { [_selectedColumns removeObject: [_tableColumns objectAtIndex: column]]; [self setNeedsDisplayInRect: [self rectOfColumn: column]]; [_headerView setNeedsDisplay: YES]; @@ -1082,9 +1083,10 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { } - (void) selectAll: sender { - [self selectRowIndexes: [NSIndexSet indexSetWithIndexesInRange: + [self selectRowIndexes: [NSIndexSet + indexSetWithIndexesInRange: NSMakeRange(0, [self numberOfRows])] - byExtendingSelection: NO]; + byExtendingSelection: NO]; } - (void) deselectAll: sender { @@ -1138,8 +1140,10 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { // There isn't much point in trying to validate the heights of // visible rows only, as the often used -rectOfColumn: needs them all. [self noteHeightOfRowsWithIndexesChanged: - [NSIndexSet - indexSetWithIndexesInRange: NSMakeRange(0, numberOfRows)]]; + [NSIndexSet + indexSetWithIndexesInRange: NSMakeRange( + 0, + numberOfRows)]]; // if there's any editing going on, we'd better stop it. if (_editingCell != nil) @@ -1157,7 +1161,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [_headerView setFrameSize: headerSize]; NSMutableIndexSet *selection = - [[_selectedRowIndexes mutableCopy] autorelease]; + [[_selectedRowIndexes mutableCopy] autorelease]; NSInteger count = [selection count]; NSUInteger indexes[count]; [selection getIndexes: indexes maxCount: count inIndexRange: NULL]; @@ -1197,7 +1201,8 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [_headerView setFrameSize: rect.size]; [[self enclosingScrollView] - setVerticalLineScroll: _standardRowHeight + _intercellSpacing.height]; + setVerticalLineScroll: _standardRowHeight + + _intercellSpacing.height]; [self setNeedsDisplay: YES]; [_headerView setNeedsDisplay: YES]; @@ -1240,15 +1245,11 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { for (row = 0; row < numberOfRows; ++row) if ([self isColumnSelected: column] || [self isRowSelected: row]) if (!(row == _editedRow && column == _editedColumn)) - [self - drawHighlightedSelectionForColumn: column - row: row - inRect: - [self - frameOfCellAtColumn: - column - row: - row]]; + [self drawHighlightedSelectionForColumn: column + row: row + inRect: [self frameOfCellAtColumn: + column + row: row]]; } - (NSCell *) preparedCellAtColumn: (NSInteger) columnNumber @@ -1269,11 +1270,11 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { if ([self isRowSelected: row] || [self isColumnSelected: columnNumber]) { [(NSTextFieldCell *) dataCell - setDrawsBackground: NO]; // so the selection shows properly, - // dont just set the color so custom - // background works + setDrawsBackground: NO]; // so the selection shows properly, + // dont just set the color so + // custom background works [(NSTextFieldCell *) dataCell - setTextColor: [NSColor selectedTextColor]]; + setTextColor: [NSColor selectedTextColor]]; } else [(NSTextFieldCell *) dataCell setTextColor: [NSColor textColor]]; } @@ -1283,9 +1284,9 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { if ([_delegate respondsToSelector: @selector (tableView:willDisplayCell:forTableColumn:row:)]) [_delegate tableView: self - willDisplayCell: dataCell - forTableColumn: column - row: row]; + willDisplayCell: dataCell + forTableColumn: column + row: row]; return dataCell; } @@ -1315,10 +1316,10 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { } else { NSCell *dataCell = [self preparedCellAtColumn: drawThisColumn row: row]; - NSRect cellRect = - [self _adjustedFrame: [self frameOfCellAtColumn: drawThisColumn - row: row] - forCell: dataCell]; + NSRect cellRect = [self + _adjustedFrame: [self frameOfCellAtColumn: drawThisColumn + row: row] + forCell: dataCell]; [dataCell drawWithFrame: cellRect inView: self]; } @@ -1348,12 +1349,12 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [(NSColor *) [rowColors objectAtIndex: i % colorCount] setFill]; NSRectFill(rectToFill); rectToFill.origin.y += - rectToFill.size.height; // This is for beyond the loop. + rectToFill.size.height; // This is for beyond the loop. heightFilled = rectToFill.origin.y; } if (_standardRowHeight > 0.) { rectToFill.size.height = - _standardRowHeight + _intercellSpacing.height; + _standardRowHeight + _intercellSpacing.height; while (heightFilled < clipRect.size.height) { [(NSColor *) [rowColors objectAtIndex: i % colorCount] setFill]; NSRectFill(rectToFill); @@ -1407,7 +1408,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { y += _standardRowHeight + _intercellSpacing.height; [line moveToPoint: NSMakePoint(clipRect.origin.x, y)]; [line lineToPoint: NSMakePoint(clipRect.origin.x + - clipRect.size.width, + clipRect.size.width, y)]; } } @@ -1422,8 +1423,8 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { CGFloat result = 0; for (i = 0; i < count; ++i) - result += - [[_tableColumns objectAtIndex: i] width] + _intercellSpacing.width; + result += [[_tableColumns objectAtIndex: i] width] + + _intercellSpacing.width; return result; } @@ -1458,7 +1459,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { - (BOOL) delegateShouldSelectTableColumn: (NSTableColumn *) tableColumn { if ([_delegate respondsToSelector: @selector(tableView: - shouldSelectTableColumn:)]) + shouldSelectTableColumn:)]) return [_delegate tableView: self shouldSelectTableColumn: tableColumn]; return YES; @@ -1497,7 +1498,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { - (void) textDidEndEditing: (NSNotification *) note { NSTableColumn *editedColumn = [_tableColumns objectAtIndex: _editedColumn]; NSInteger textMovement = - [[[note userInfo] objectForKey: @"NSTextMovement"] intValue]; + [[[note userInfo] objectForKey: @"NSTextMovement"] intValue]; NSInteger numberOfRows = [self numberOfRows]; [_editingCell endEditing: _currentEditor]; @@ -1529,9 +1530,9 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [self selectRow: nextRow byExtendingSelection: NO]; [self editColumn: _editedColumn - row: nextRow - withEvent: [[self window] currentEvent] - select: YES]; + row: nextRow + withEvent: [[self window] currentEvent] + select: YES]; } else if (textMovement == NSTabTextMovement) { NSInteger nextColumn = _editedColumn; NSInteger nextRow = _editedRow; @@ -1551,9 +1552,9 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [self selectRow: nextRow byExtendingSelection: NO]; [self editColumn: nextColumn - row: nextRow - withEvent: [[self window] currentEvent] - select: YES]; + row: nextRow + withEvent: [[self window] currentEvent] + select: YES]; } else if (textMovement == NSBacktabTextMovement) { NSInteger prevColumn = _editedColumn - 1; NSInteger prevRow = _editedRow; @@ -1567,9 +1568,9 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [self selectRow: prevRow byExtendingSelection: NO]; [self editColumn: prevColumn - row: prevRow - withEvent: [[self window] currentEvent] - select: YES]; + row: prevRow + withEvent: [[self window] currentEvent] + select: YES]; } else { _editedColumn = -1; _editedRow = -1; @@ -1580,10 +1581,10 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { row: (NSInteger) row { if ([_delegate respondsToSelector: @selector(tableView: - shouldEditTableColumn:row:)]) + shouldEditTableColumn:row:)]) return [_delegate tableView: self - shouldEditTableColumn: tableColumn - row: row]; + shouldEditTableColumn: tableColumn + row: row]; return YES; } @@ -1625,33 +1626,38 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [[NSColor blackColor] setStroke]; if ([self numberOfRows] == 0) [NSBezierPath - strokeLineFromPoint: NSMakePoint(0, 0) - toPoint: NSMakePoint([self bounds].size.width, 0)]; + strokeLineFromPoint: NSMakePoint(0, 0) + toPoint: NSMakePoint([self bounds].size.width, + 0)]; else { if (_draggingRow == [self numberOfRows]) { rowRect = NSIntersectionRect([self rectOfRow: _draggingRow - 1], [self visibleRect]); [NSBezierPath - strokeLineFromPoint: NSMakePoint(0, rowRect.origin.y + - rowRect.size.height) - toPoint: NSMakePoint(rowRect.size.width, + strokeLineFromPoint: NSMakePoint( + 0, rowRect.origin.y + + rowRect.size + .height) + toPoint: NSMakePoint( + rowRect.size.width, rowRect.origin.y + - rowRect.size.height)]; + rowRect.size + .height)]; } else { rowRect = NSIntersectionRect([self rectOfRow: _draggingRow], [self visibleRect]); [NSBezierPath - strokeLineFromPoint: NSMakePoint(0, rowRect.origin.y) - toPoint: NSMakePoint(rowRect.size.width, - rowRect.origin.y)]; + strokeLineFromPoint: NSMakePoint(0, rowRect.origin.y) + toPoint: NSMakePoint(rowRect.size.width, + rowRect.origin.y)]; } } } } - (BOOL) delegateSelectionShouldChange { - if ([_delegate - respondsToSelector: @selector(selectionShouldChangeInTableView:)]) + if ([_delegate respondsToSelector: @selector + (selectionShouldChangeInTableView:)]) return [_delegate selectionShouldChangeInTableView: self]; return YES; @@ -1659,24 +1665,25 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { - (void) noteSelectionIsChanging { [[NSNotificationCenter defaultCenter] - postNotificationName: NSTableViewSelectionIsChangingNotification - object: self]; + postNotificationName: NSTableViewSelectionIsChangingNotification + object: self]; } - (void) noteSelectionDidChange { [[NSNotificationCenter defaultCenter] - postNotificationName: NSTableViewSelectionDidChangeNotification - object: self]; + postNotificationName: NSTableViewSelectionDidChangeNotification + object: self]; } - (void) noteColumnDidResizeWithOldWidth: (CGFloat) oldWidth { [[NSNotificationCenter defaultCenter] - postNotificationName: NSTableViewColumnDidResizeNotification - object: self - userInfo: [NSDictionary - dictionaryWithObjectsAndKeys: - [NSNumber numberWithFloat: oldWidth], - @"NSOldWidth", nil]]; + postNotificationName: NSTableViewColumnDidResizeNotification + object: self + userInfo: [NSDictionary + dictionaryWithObjectsAndKeys: + [NSNumber numberWithFloat: + oldWidth], + @"NSOldWidth", nil]]; } - (BOOL) dataSourceCanSetObjectValue { @@ -1701,7 +1708,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { } NSTableColumn *clickedColumnObject = - [_tableColumns objectAtIndex: _clickedColumn]; + [_tableColumns objectAtIndex: _clickedColumn]; if (![self delegateShouldSelectTableColumn: clickedColumnObject]) return; @@ -1713,9 +1720,10 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [clickedCell setControlView: self]; if ([clickedCell isKindOfClass: [NSButtonCell class]]) { [clickedCell - setObjectValue: - [self dataSourceObjectValueForTableColumn: clickedColumnObject - row: _clickedRow]]; + setObjectValue: + [self dataSourceObjectValueForTableColumn: + clickedColumnObject + row: _clickedRow]]; if ([clickedCell trackMouse: event inRect: [self frameOfCellAtColumn: _clickedColumn @@ -1726,8 +1734,8 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { NSNumber *value = nil; if ([clickedCell isKindOfClass: [NSPopUpButtonCell class]]) { value = [NSNumber - numberWithInt: [(NSPopUpButtonCell *) - clickedCell indexOfSelectedItem]]; + numberWithInt: [(NSPopUpButtonCell *) clickedCell + indexOfSelectedItem]]; } else { value = [NSNumber numberWithInt: [clickedCell state]]; } @@ -1758,8 +1766,8 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { [self deselectRow: _clickedRow]; } else if ([self allowsMultipleSelection]) { [self selectRowIndexes: [NSIndexSet - indexSetWithIndex: _clickedRow] - byExtendingSelection: YES]; // add to selection + indexSetWithIndex: _clickedRow] + byExtendingSelection: YES]; // add to selection } } else if ([event modifierFlags] & NSShiftKeyMask) { if ([self allowsMultipleSelection] && [self selectedRow] != -1) { @@ -1771,16 +1779,17 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { startRow = _clickedRow; } - [self selectRowIndexes: [NSIndexSet - indexSetWithIndexesInRange: + [self selectRowIndexes: + [NSIndexSet + indexSetWithIndexesInRange: NSMakeRange(startRow, endRow - startRow + - 1)] - byExtendingSelection: NO]; + 1)] + byExtendingSelection: NO]; } else [self selectRowIndexes: [NSIndexSet - indexSetWithIndex: _clickedRow] - byExtendingSelection: NO]; + indexSetWithIndex: _clickedRow] + byExtendingSelection: NO]; } else { // normal selection, allow for dragging BOOL dragging = NO; if ([_dataSource respondsToSelector: @selector @@ -1788,15 +1797,15 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { NSPoint currentPoint; do { event = [_window - nextEventMatchingMask: NSLeftMouseUpMask | - NSLeftMouseDraggedMask - untilDate: [NSDate distantFuture] - inMode: NSEventTrackingRunLoopMode - dequeue: NO]; + nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask + untilDate: [NSDate distantFuture] + inMode: NSEventTrackingRunLoopMode + dequeue: NO]; if ([event type] == NSLeftMouseDragged) event = [_window - nextEventMatchingMask: NSLeftMouseUpMask | - NSLeftMouseDraggedMask]; + nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; else break; currentPoint = [self convertPoint: [event locationInWindow] @@ -1814,21 +1823,21 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { rowIndexes = [NSIndexSet indexSetWithIndex: _clickedRow]; NSPasteboard *pasteboard = - [NSPasteboard pasteboardWithName: NSDragPboard]; + [NSPasteboard pasteboardWithName: NSDragPboard]; if ([_dataSource tableView: self - writeRowsWithIndexes: rowIndexes - toPasteboard: pasteboard] == NO) + writeRowsWithIndexes: rowIndexes + toPasteboard: pasteboard] == NO) dragging = NO; else { NSImage *image = [[[NSImage alloc] - initWithSize: NSMakeSize(0, 0)] autorelease]; + initWithSize: NSMakeSize(0, 0)] autorelease]; [self dragImage: image - at: NSMakePoint(0, 0) - offset: NSMakeSize(0, 0) - event: event - pasteboard: pasteboard - source: self - slideBack: YES]; + at: NSMakePoint(0, 0) + offset: NSMakeSize(0, 0) + event: event + pasteboard: pasteboard + source: self + slideBack: YES]; } } @@ -1837,16 +1846,16 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { NSInteger firstClickedRow = _clickedRow; [self selectRowIndexes: [NSIndexSet - indexSetWithIndex: _clickedRow] - byExtendingSelection: NO]; + indexSetWithIndex: _clickedRow] + byExtendingSelection: NO]; if ([self allowsMultipleSelection] == YES) { do { NSPoint point; NSInteger row; event = [_window - nextEventMatchingMask: NSLeftMouseUpMask | - NSLeftMouseDraggedMask]; + nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; point = [self convertPoint: [event locationInWindow] fromView: nil]; @@ -1868,8 +1877,10 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { for (i = 0; i < numberOfRows; i++) { if (i >= startRow && i <= endRow) [self selectRowIndexes: - [NSIndexSet indexSetWithIndex: i] - byExtendingSelection: YES]; + [NSIndexSet + indexSetWithIndex: + i] + byExtendingSelection: YES]; else [self deselectRow: i]; } @@ -1886,21 +1897,22 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { // nb this logic was backwards previously id binder = [[_tableColumns objectAtIndex: _clickedColumn] - _binderForBinding: @"value" - create: NO]; + _binderForBinding: @"value" + create: NO]; BOOL interpretedAsEdit = NO; if ([[_tableColumns objectAtIndex: _clickedColumn] isEditable]) { if ([self dataSourceCanSetObjectValue] || [binder allowsEditingForRow: _clickedRow]) { if (_clickedColumn != -1 && _clickedRow != -1) { if ([self delegateShouldEditTableColumn: - [_tableColumns objectAtIndex: _clickedColumn] + [_tableColumns + objectAtIndex: _clickedColumn] row: _clickedRow]) { interpretedAsEdit = YES; [self editColumn: [self clickedColumn] - row: _clickedRow - withEvent: event - select: YES]; + row: _clickedRow + withEvent: event + select: YES]; } } } @@ -1918,9 +1930,9 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { NSCell *dataCell = [column dataCellForRow: i]; [dataCell setControlView: self]; - [dataCell - setObjectValue: [self dataSourceObjectValueForTableColumn: column - row: i]]; + [dataCell setObjectValue: + [self dataSourceObjectValueForTableColumn: column + row: i]]; width = [[dataCell attributedStringValue] size].width; if (width > minWidth) @@ -1966,9 +1978,9 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { BOOL result; NSInteger proposedRow = [self _getDraggedRow: info]; - if ([_dataSource respondsToSelector: @selector - (tableView: - validateDrop:proposedRow:proposedDropOperation:)]) { + if ([_dataSource + respondsToSelector: @selector + (tableView:validateDrop:proposedRow:proposedDropOperation:)]) { if ((result = [_dataSource tableView: self validateDrop: info proposedRow: proposedRow @@ -1986,7 +1998,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { - (NSDragOperation) draggingEntered: (id) sender { for (NSInteger i = 0; i < [[self _draggedTypes] count]; i++) { if ([[[sender draggingPasteboard] types] - containsObject: [[self _draggedTypes] objectAtIndex: i]]) + containsObject: [[self _draggedTypes] objectAtIndex: i]]) return [self _validateDraggedRow: sender]; } return NSDragOperationNone; @@ -1995,7 +2007,7 @@ static CGFloat rowHeightAtIndex(NSTableView *self, NSInteger index) { - (NSDragOperation) draggingUpdated: (id) sender { for (NSInteger i = 0; i < [[self _draggedTypes] count]; i++) { if ([[[sender draggingPasteboard] types] - containsObject: [[self _draggedTypes] objectAtIndex: i]]) + containsObject: [[self _draggedTypes] objectAtIndex: i]]) return [self _validateDraggedRow: sender]; } return NSDragOperationNone; diff --git a/AppKit/NSText.m b/AppKit/NSText.m index 3e614377..68b22e94 100644 --- a/AppKit/NSText.m +++ b/AppKit/NSText.m @@ -22,9 +22,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSTextDidBeginEditingNotification = - @"NSTextDidBeginEditingNotification"; + @"NSTextDidBeginEditingNotification"; NSString *const NSTextDidEndEditingNotification = - @"NSTextDidEndEditingNotification"; + @"NSTextDidEndEditingNotification"; NSString *const NSTextDidChangeNotification = @"NSTextDidChangeNotification"; @implementation NSText diff --git a/AppKit/NSTextAttachmentCell.m b/AppKit/NSTextAttachmentCell.m index 033c7ca0..786db80b 100644 --- a/AppKit/NSTextAttachmentCell.m +++ b/AppKit/NSTextAttachmentCell.m @@ -61,19 +61,19 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) rect - ofView: (NSView *) view - atCharacterIndex: (unsigned) characterIndex - untilMouseUp: (BOOL) untilMouseUp + inRect: (NSRect) rect + ofView: (NSView *) view + atCharacterIndex: (unsigned) characterIndex + untilMouseUp: (BOOL) untilMouseUp { NSUnimplementedMethod(); return NO; } - (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) rect - ofView: (NSView *) view - untilMouseUp: (BOOL) untilMouseUp + inRect: (NSRect) rect + ofView: (NSView *) view + untilMouseUp: (BOOL) untilMouseUp { NSUnimplementedMethod(); return NO; diff --git a/AppKit/NSTextField.m b/AppKit/NSTextField.m index c764db47..d15ba15c 100644 --- a/AppKit/NSTextField.m +++ b/AppKit/NSTextField.m @@ -53,18 +53,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithCoder: (NSCoder *) coder { NSLog(@"NSTextField initWithCoder"); [super initWithCoder: coder]; - [self - registerForDraggedTypes: [NSArray arrayWithObject: NSStringPboardType]]; + [self registerForDraggedTypes: + [NSArray arrayWithObject: NSStringPboardType]]; if ([coder allowsKeyedCoding]) { NSKeyedUnarchiver *keyed = (NSKeyedUnarchiver *) coder; [self setDelegate: [keyed decodeObjectForKey: @"NSDelegate"]]; - _errorAction = - NSSelectorFromString([keyed decodeObjectForKey: @"NSErrorAction"]); + _errorAction = NSSelectorFromString( + [keyed decodeObjectForKey: @"NSErrorAction"]); double maxLayoutWidth = - [keyed decodeDoubleForKey: @"NSPreferredMaxLayoutWidth"]; + [keyed decodeDoubleForKey: @"NSPreferredMaxLayoutWidth"]; // TODO } else { NSInteger version = [coder versionForClassName: @"NSTextField"]; @@ -86,8 +86,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [_cell setEditable: YES]; [_cell setSelectable: YES]; [_cell setBezeled: YES]; - [self - registerForDraggedTypes: [NSArray arrayWithObject: NSStringPboardType]]; + [self registerForDraggedTypes: + [NSArray arrayWithObject: NSStringPboardType]]; return self; } @@ -112,13 +112,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ struct { SEL selector; NSString *name; - } notes[] = { - {@selector(controlTextDidBeginEditing:), - NSControlTextDidBeginEditingNotification}, - {@selector(controlTextDidChange:), NSControlTextDidChangeNotification}, - {@selector(controlTextDidEndEditing:), - NSControlTextDidEndEditingNotification}, - {NULL, nil}}; + } notes[] = {{@selector(controlTextDidBeginEditing:), + NSControlTextDidBeginEditingNotification}, + {@selector(controlTextDidChange:), + NSControlTextDidChangeNotification}, + {@selector(controlTextDidEndEditing:), + NSControlTextDidEndEditingNotification}, + {NULL, nil}}; int i; if (_delegate != nil) @@ -175,7 +175,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) setPlaceholderAttributedString: - (NSAttributedString *) placeholderAttributedString + (NSAttributedString *) placeholderAttributedString { [_cell setPlaceholderAttributedString: placeholderAttributedString]; } @@ -271,7 +271,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } else { // Ask the delegate what to do SEL sel = @selector(control: - didFailToFormatString:errorDescription:); + didFailToFormatString:errorDescription:); if ([_delegate respondsToSelector: sel]) { acceptsString = [_delegate control: self didFailToFormatString: string @@ -285,7 +285,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSTextView *textview = (NSTextView *) _currentEditor; NSAttributedString *text = [textview textStorage]; NSAttributedString *string = [[[NSAttributedString alloc] - initWithAttributedString: text] autorelease]; + initWithAttributedString: text] autorelease]; [[self selectedCell] setAttributedStringValue: string]; } else { [[self selectedCell] setStringValue: string]; @@ -340,7 +340,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (BOOL) textShouldBeginEditing: (NSText *) text { if ([_delegate respondsToSelector: @selector(control: - textShouldBeginEditing:)]) + textShouldBeginEditing:)]) if ([_delegate control: self textShouldBeginEditing: text] == NO) { NSBeep(); return NO; @@ -350,7 +350,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (BOOL) textShouldEndEditing: (NSText *) text { if ([_delegate respondsToSelector: @selector(control: - textShouldEndEditing:)]) + textShouldEndEditing:)]) if ([_delegate control: self textShouldEndEditing: text] == NO) { NSBeep(); return NO; @@ -368,7 +368,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSError *error = nil; if ([formatter isKindOfClass: [NSNumberFormatter class]]) { NSNumberFormatter *numberFormatter = - (NSNumberFormatter *) formatter; + (NSNumberFormatter *) formatter; acceptsString = [numberFormatter getObjectValue: &objectValue forString: string range: NULL @@ -384,12 +384,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (errorString == nil) { // Just in case we get no error from the formatter errorString = NSLocalizedStringFromTableInBundle( - @"Invalid number", nil, - [NSBundle bundleForClass: [NSTextField class]], @""); + @"Invalid number", nil, + [NSBundle bundleForClass: [NSTextField class]], + @""); } info = [NSDictionary - dictionaryWithObject: errorString - forKey: NSLocalizedDescriptionKey]; + dictionaryWithObject: errorString + forKey: NSLocalizedDescriptionKey]; error = [NSError errorWithDomain: NSCocoaErrorDomain code: 2048 userInfo: info]; @@ -417,8 +418,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [super setStringValue: value]; else { NSRange selectedRange = [_currentEditor selectedRange]; - BOOL isEntireString = NSEqualRanges( - selectedRange, NSMakeRange(0, [[_currentEditor string] length])); + BOOL isEntireString = + NSEqualRanges(selectedRange, + NSMakeRange(0, [[_currentEditor string] length])); [super setStringValue: value]; [_currentEditor setString: [self stringValue]]; diff --git a/AppKit/NSTextFieldCell.m b/AppKit/NSTextFieldCell.m index e99bc3c8..55c836f7 100644 --- a/AppKit/NSTextFieldCell.m +++ b/AppKit/NSTextFieldCell.m @@ -47,11 +47,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _drawsBackground = [keyed decodeBoolForKey: @"NSDrawsBackground"]; _backgroundColor = - [[keyed decodeObjectForKey: @"NSBackgroundColor"] retain]; + [[keyed decodeObjectForKey: @"NSBackgroundColor"] retain]; _textColor = [[keyed decodeObjectForKey: @"NSTextColor"] retain]; _bezelStyle = [keyed decodeIntegerForKey: @"NSTextBezelStyle"]; _placeholder = - [[keyed decodeObjectForKey: @"NSPlaceholderString"] retain]; + [[keyed decodeObjectForKey: @"NSPlaceholderString"] retain]; } else { NSInteger version = [coder versionForClassName: @"NSTextFieldCell"]; NSLog(@"NSTextFieldCell version is %d\n", version); @@ -83,9 +83,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [self setBackgroundColor: [NSColor whiteColor]]; } else { _drawsBackground = TRUE; - [self setBackgroundColor: [NSColor - colorWithCalibratedWhite: bgcolor - alpha: 1.0]]; + [self setBackgroundColor: + [NSColor colorWithCalibratedWhite: bgcolor + alpha: 1.0]]; } [self setTextColor: [NSColor colorWithCalibratedWhite: fgcolor alpha: 1.0]]; @@ -245,7 +245,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return _objectValue; else { NSMutableAttributedString *result = - [[_objectValue mutableCopy] autorelease]; + [[_objectValue mutableCopy] autorelease]; [result addAttribute: NSForegroundColorAttributeName value: _textColor @@ -256,8 +256,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } else { NSMutableDictionary *attributes = [NSMutableDictionary dictionary]; NSMutableParagraphStyle *paraStyle = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] - autorelease]; + [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] + autorelease]; NSFont *font = [self font]; if (font != nil) @@ -286,7 +286,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return [[[NSAttributedString alloc] initWithString: [self stringValue] attributes: attributes] - autorelease]; + autorelease]; } } @@ -345,7 +345,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ drawValue = _placeholder; else if ([_placeholder isKindOfClass: [NSString class]]) { NSMutableAttributedString *placeString = - [[drawValue mutableCopy] autorelease]; + [[drawValue mutableCopy] autorelease]; [[placeString mutableString] setString: _placeholder]; [placeString addAttribute: NSForegroundColorAttributeName value: [NSColor disabledControlTextColor] @@ -387,7 +387,7 @@ static void drawRoundedBezel(CGContextRef context, CGRect frame) { case NSTextFieldRoundedBezel:; CGContextRef context = - [[NSGraphicsContext currentContext] graphicsPort]; + [[NSGraphicsContext currentContext] graphicsPort]; NSRect roundedFrame = frame; roundedFrame.size.height--; diff --git a/AppKit/NSTextTable/NSTextBlock.m b/AppKit/NSTextTable/NSTextBlock.m index 36037df2..6fa83c6f 100644 --- a/AppKit/NSTextTable/NSTextBlock.m +++ b/AppKit/NSTextTable/NSTextBlock.m @@ -96,8 +96,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) setValue: (CGFloat) value - type: (NSTextBlockValueType) type - forDimension: (NSTextBlockDimension) dimension + type: (NSTextBlockValueType) type + forDimension: (NSTextBlockDimension) dimension { _dimensionValues[dimension] = value; _dimensionValueTypes[dimension] = type; diff --git a/AppKit/NSTextTable/NSTextTableBlock.m b/AppKit/NSTextTable/NSTextTableBlock.m index 84ddc578..a05d9cc1 100644 --- a/AppKit/NSTextTable/NSTextTableBlock.m +++ b/AppKit/NSTextTable/NSTextTableBlock.m @@ -22,10 +22,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSTextTableBlock - initWithTable: (NSTextTable *) table - startingRow: (int) startingRow - rowSpan: (int) rowSpan - startingColumn: (int) startingColumn - columnSpan: (int) columnSpan + startingRow: (int) startingRow + rowSpan: (int) rowSpan + startingColumn: (int) startingColumn + columnSpan: (int) columnSpan { _table = table; _startingRow = startingRow; diff --git a/AppKit/NSTextView.subproj/NSBidiHelper.m b/AppKit/NSTextView.subproj/NSBidiHelper.m index dc6aaf7b..f0f717fe 100644 --- a/AppKit/NSTextView.subproj/NSBidiHelper.m +++ b/AppKit/NSTextView.subproj/NSBidiHelper.m @@ -111,14 +111,14 @@ void buildUnicharData() { // # // ; # comment NSString *path = - [[NSBundle bundleForClass: NSClassFromString(@"NSTypesetter")] - pathForResource: @"BidiMirroring" - ofType: @"txt" - inDirectory: @"UNIDATA"]; + [[NSBundle bundleForClass: NSClassFromString(@"NSTypesetter")] + pathForResource: @"BidiMirroring" + ofType: @"txt" + inDirectory: @"UNIDATA"]; NSString *fileContents = - [NSString stringWithContentsOfFile: path - encoding: NSUTF8StringEncoding - error: nil]; + [NSString stringWithContentsOfFile: path + encoding: NSUTF8StringEncoding + error: nil]; if (fileContents == nil) { sUnicodeDataAbsent = YES; return; @@ -139,7 +139,7 @@ void buildUnicharData() { } // Alloc our struct and do the real processing sUnicharMirrorData = - malloc(sizeof(NSBidiUnicodeCharMirrorInfo) * (count + 1)); + malloc(sizeof(NSBidiUnicodeCharMirrorInfo) * (count + 1)); count = 0; for (NSString *line in fileLines) { // Strip comments @@ -149,16 +149,16 @@ void buildUnicharData() { NSArray *elements = [line componentsSeparatedByString: @";"]; if (elements.count == 2) { unichar from = (unichar) strtol( - [[elements objectAtIndex: 0] UTF8String], NULL, 16); + [[elements objectAtIndex: 0] UTF8String], NULL, 16); unichar to = (unichar) strtol( - [[elements objectAtIndex: 1] UTF8String], NULL, 16); + [[elements objectAtIndex: 1] UTF8String], NULL, 16); sUnicharMirrorData[count].from = from; sUnicharMirrorData[count].to = to; count++; } } sUnicharMirrorData[count].to = sUnicharMirrorData[count].from = - 0; // End-of-table + 0; // End-of-table // read the unicode char type info table // Format : various fields on each line, separated by ";" @@ -167,25 +167,26 @@ void buildUnicharData() { // dictionary -> [NSNumber numberWithInt:ON], @"ON" #define BIDI_ENTRY(X) [NSNumber numberWithInt: X], @ #X NSDictionary *bidiDictionary = [NSDictionary - dictionaryWithObjectsAndKeys: BIDI_ENTRY(ON), BIDI_ENTRY(L), - BIDI_ENTRY(R), BIDI_ENTRY(AN), - BIDI_ENTRY(EN), BIDI_ENTRY(AL), - BIDI_ENTRY(NSM), BIDI_ENTRY(CS), - BIDI_ENTRY(ES), BIDI_ENTRY(ET), - BIDI_ENTRY(BN), BIDI_ENTRY(S), - BIDI_ENTRY(WS), BIDI_ENTRY(B), - BIDI_ENTRY(RLO), BIDI_ENTRY(RLE), - BIDI_ENTRY(LRO), BIDI_ENTRY(LRE), - BIDI_ENTRY(PDF), nil]; + dictionaryWithObjectsAndKeys: BIDI_ENTRY(ON), BIDI_ENTRY(L), + BIDI_ENTRY(R), BIDI_ENTRY(AN), + BIDI_ENTRY(EN), BIDI_ENTRY(AL), + BIDI_ENTRY(NSM), BIDI_ENTRY(CS), + BIDI_ENTRY(ES), BIDI_ENTRY(ET), + BIDI_ENTRY(BN), BIDI_ENTRY(S), + BIDI_ENTRY(WS), BIDI_ENTRY(B), + BIDI_ENTRY(RLO), BIDI_ENTRY(RLE), + BIDI_ENTRY(LRO), BIDI_ENTRY(LRE), + BIDI_ENTRY(PDF), nil]; NSDictionary *mirroredDictionary = [NSDictionary - dictionaryWithObjectsAndKeys: [NSNumber numberWithInt: 1], @"Y", - [NSNumber numberWithInt: 0], @"N", nil]; + dictionaryWithObjectsAndKeys: [NSNumber numberWithInt: 1], @"Y", + [NSNumber numberWithInt: 0], @"N", + nil]; path = [[NSBundle bundleForClass: NSClassFromString(@"NSTypesetter")] - pathForResource: @"UnicodeData" - ofType: @"txt" - inDirectory: @"UNIDATA"]; + pathForResource: @"UnicodeData" + ofType: @"txt" + inDirectory: @"UNIDATA"]; fileContents = [NSString stringWithContentsOfFile: path encoding: NSUTF8StringEncoding error: nil]; @@ -204,11 +205,11 @@ void buildUnicharData() { NSString *mirrored = [elements objectAtIndex: 9]; unichar character = (unichar) strtol( - [[elements objectAtIndex: 0] UTF8String], NULL, 16); + [[elements objectAtIndex: 0] UTF8String], NULL, 16); NSInteger bidiTypeValue = - [[bidiDictionary objectForKey: bidiType] intValue]; + [[bidiDictionary objectForKey: bidiType] intValue]; NSInteger mirrorValue = - [[mirroredDictionary objectForKey: mirrored] intValue]; + [[mirroredDictionary objectForKey: mirrored] intValue]; sUnicharData[character].bidiType = bidiTypeValue; sUnicharData[character].mirrored = mirrorValue; } @@ -397,26 +398,26 @@ void buildUnicharData() { // WS, LS and S are not explicitly needed except for L1. Therefore this // table conflates ON, S, WS, and LS to N, all others unchanged static int NTypes[] = { - N, // ON, - L, // L, - R, // R, - AN, // AN, - EN, // EN, - AL, // AL - NSM, // NSM - CS, // CS - ES, // ES - ET, // ET - BN, // BN - N, // S - N, // WS - B, // B - RLO, // RLO - RLE, // RLE - LRO, // LRO - LRE, // LRE - PDF, // PDF - ON, // LS + N, // ON, + L, // L, + R, // R, + AN, // AN, + EN, // EN, + AL, // AL + NSM, // NSM + CS, // CS + ES, // ES + ET, // ET + BN, // BN + N, // S + N, // WS + B, // B + RLO, // RLO + RLE, // RLE + LRO, // LRO + LRE, // LRE + PDF, // PDF + ON, // LS }; static int ClassFromChN(unichar ch) { @@ -679,52 +680,52 @@ enum bidi_state // possible states }; static int stateWeak[][10] = { - // N, L, R, AN, EN, AL,NSM, CS, ES, ET, - /*xa*/ ao, xl, xr, cn, cn, - xa, xa, ao, ao, ao, /* arabic letter */ - /*xr*/ ro, xl, xr, ra, re, - xa, xr, ro, ro, rt, /* right letter */ - /*xl*/ lo, xl, xr, la, le, - xa, xl, lo, lo, lt, /* left letter */ + // N, L, R, AN, EN, AL,NSM, CS, ES, ET, + /*xa*/ ao, xl, xr, cn, cn, + xa, xa, ao, ao, ao, /* arabic letter */ + /*xr*/ ro, xl, xr, ra, re, + xa, xr, ro, ro, rt, /* right letter */ + /*xl*/ lo, xl, xr, la, le, + xa, xl, lo, lo, lt, /* left letter */ - /*ao*/ ao, xl, xr, cn, cn, - xa, ao, ao, ao, ao, /* arabic lett. foll by ON*/ - /*ro*/ ro, xl, xr, ra, re, - xa, ro, ro, ro, rt, /* right lett. foll by ON */ - /*lo*/ lo, xl, xr, la, le, - xa, lo, lo, lo, lt, /* left lett. foll by ON */ + /*ao*/ ao, xl, xr, cn, cn, + xa, ao, ao, ao, ao, /* arabic lett. foll by ON*/ + /*ro*/ ro, xl, xr, ra, re, + xa, ro, ro, ro, rt, /* right lett. foll by ON */ + /*lo*/ lo, xl, xr, la, le, + xa, lo, lo, lo, lt, /* left lett. foll by ON */ - /*rt*/ ro, xl, xr, ra, re, - xa, rt, ro, ro, rt, /* ET following R */ - /*lt*/ lo, xl, xr, la, le, - xa, lt, lo, lo, lt, /* ET following L */ + /*rt*/ ro, xl, xr, ra, re, + xa, rt, ro, ro, rt, /* ET following R */ + /*lt*/ lo, xl, xr, la, le, + xa, lt, lo, lo, lt, /* ET following L */ - /*cn*/ ao, xl, xr, cn, cn, - xa, cn, ac, ao, ao, /* EN, AN following AL */ - /*ra*/ ro, xl, xr, ra, re, - xa, ra, rc, ro, rt, /* arabic number foll R */ - /*re*/ ro, xl, xr, ra, re, - xa, re, rs, rs, ret, /* european number foll R */ - /*la*/ lo, xl, xr, la, le, - xa, la, lc, lo, lt, /* arabic number foll L */ - /*le*/ lo, xl, xr, la, le, - xa, le, ls, ls, let, /* european number foll L */ + /*cn*/ ao, xl, xr, cn, cn, + xa, cn, ac, ao, ao, /* EN, AN following AL */ + /*ra*/ ro, xl, xr, ra, re, + xa, ra, rc, ro, rt, /* arabic number foll R */ + /*re*/ ro, xl, xr, ra, re, + xa, re, rs, rs, ret, /* european number foll R */ + /*la*/ lo, xl, xr, la, le, + xa, la, lc, lo, lt, /* arabic number foll L */ + /*le*/ lo, xl, xr, la, le, + xa, le, ls, ls, let, /* european number foll L */ - /*ac*/ ao, xl, xr, cn, cn, - xa, ao, ao, ao, ao, /* CS following cn */ - /*rc*/ ro, xl, xr, ra, re, - xa, ro, ro, ro, rt, /* CS following ra */ - /*rs*/ ro, xl, xr, ra, re, - xa, ro, ro, ro, rt, /* CS,ES following re */ - /*lc*/ lo, xl, xr, la, le, - xa, lo, lo, lo, lt, /* CS following la */ - /*ls*/ lo, xl, xr, la, le, - xa, lo, lo, lo, lt, /* CS,ES following le */ + /*ac*/ ao, xl, xr, cn, cn, + xa, ao, ao, ao, ao, /* CS following cn */ + /*rc*/ ro, xl, xr, ra, re, + xa, ro, ro, ro, rt, /* CS following ra */ + /*rs*/ ro, xl, xr, ra, re, + xa, ro, ro, ro, rt, /* CS,ES following re */ + /*lc*/ lo, xl, xr, la, le, + xa, lo, lo, lo, lt, /* CS following la */ + /*ls*/ lo, xl, xr, la, le, + xa, lo, lo, lo, lt, /* CS,ES following le */ - /*ret*/ ro, xl, xr, ra, re, - xa, ret, ro, ro, ret, /* ET following re */ - /*let*/ lo, xl, xr, la, le, - xa, let, lo, lo, let, /* ET following le */ + /*ret*/ ro, xl, xr, ra, re, + xa, ret, ro, ro, ret, /* ET following re */ + /*let*/ lo, xl, xr, la, le, + xa, let, lo, lo, let, /* ET following le */ }; @@ -756,52 +757,52 @@ enum bidi_action // possible actions }; static int actionWeak[][10] = { - // N,.. L, R, AN, EN, AL, NSM, CS,..ES, ET, - /*xa*/ xxx, xxx, xxx, xxx, xxA, xxR, - xxR, xxN, xxN, xxN, /* arabic letter */ - /*xr*/ xxx, xxx, xxx, xxx, xxE, xxR, - xxR, xxN, xxN, xIx, /* right leter */ - /*xl*/ xxx, xxx, xxx, xxx, xxL, xxR, - xxL, xxN, xxN, xIx, /* left letter */ + // N,.. L, R, AN, EN, AL, NSM, CS,..ES, ET, + /*xa*/ xxx, xxx, xxx, xxx, xxA, xxR, + xxR, xxN, xxN, xxN, /* arabic letter */ + /*xr*/ xxx, xxx, xxx, xxx, xxE, xxR, + xxR, xxN, xxN, xIx, /* right leter */ + /*xl*/ xxx, xxx, xxx, xxx, xxL, xxR, + xxL, xxN, xxN, xIx, /* left letter */ - /*ao*/ xxx, xxx, xxx, xxx, xxA, xxR, - xxN, xxN, xxN, xxN, /* arabic lett. foll by ON */ - /*ro*/ xxx, xxx, xxx, xxx, xxE, xxR, - xxN, xxN, xxN, xIx, /* right lett. foll by ON */ - /*lo*/ xxx, xxx, xxx, xxx, xxL, xxR, - xxN, xxN, xxN, xIx, /* left lett. foll by ON */ + /*ao*/ xxx, xxx, xxx, xxx, xxA, xxR, + xxN, xxN, xxN, xxN, /* arabic lett. foll by ON */ + /*ro*/ xxx, xxx, xxx, xxx, xxE, xxR, + xxN, xxN, xxN, xIx, /* right lett. foll by ON */ + /*lo*/ xxx, xxx, xxx, xxx, xxL, xxR, + xxN, xxN, xxN, xIx, /* left lett. foll by ON */ - /*rt*/ Nxx, Nxx, Nxx, Nxx, ExE, NxR, - xIx, NxN, NxN, xIx, /* ET following R */ - /*lt*/ Nxx, Nxx, Nxx, Nxx, LxL, NxR, - xIx, NxN, NxN, xIx, /* ET following L */ + /*rt*/ Nxx, Nxx, Nxx, Nxx, ExE, NxR, + xIx, NxN, NxN, xIx, /* ET following R */ + /*lt*/ Nxx, Nxx, Nxx, Nxx, LxL, NxR, + xIx, NxN, NxN, xIx, /* ET following L */ - /*cn*/ xxx, xxx, xxx, xxx, xxA, xxR, - xxA, xIx, xxN, xxN, /* EN, AN following AL */ - /*ra*/ xxx, xxx, xxx, xxx, xxE, xxR, - xxA, xIx, xxN, xIx, /* arabic number foll R */ - /*re*/ xxx, xxx, xxx, xxx, xxE, xxR, - xxE, xIx, xIx, xxE, /* european number foll R */ - /*la*/ xxx, xxx, xxx, xxx, xxL, xxR, - xxA, xIx, xxN, xIx, /* arabic number foll L */ - /*le*/ xxx, xxx, xxx, xxx, xxL, xxR, - xxL, xIx, xIx, xxL, /* european number foll L */ + /*cn*/ xxx, xxx, xxx, xxx, xxA, xxR, + xxA, xIx, xxN, xxN, /* EN, AN following AL */ + /*ra*/ xxx, xxx, xxx, xxx, xxE, xxR, + xxA, xIx, xxN, xIx, /* arabic number foll R */ + /*re*/ xxx, xxx, xxx, xxx, xxE, xxR, + xxE, xIx, xIx, xxE, /* european number foll R */ + /*la*/ xxx, xxx, xxx, xxx, xxL, xxR, + xxA, xIx, xxN, xIx, /* arabic number foll L */ + /*le*/ xxx, xxx, xxx, xxx, xxL, xxR, + xxL, xIx, xIx, xxL, /* european number foll L */ - /*ac*/ Nxx, Nxx, Nxx, Axx, AxA, NxR, - NxN, NxN, NxN, NxN, /* CS following cn */ - /*rc*/ Nxx, Nxx, Nxx, Axx, NxE, NxR, - NxN, NxN, NxN, NIx, /* CS following ra */ - /*rs*/ Nxx, Nxx, Nxx, Nxx, ExE, NxR, - NxN, NxN, NxN, NIx, /* CS,ES following re */ - /*lc*/ Nxx, Nxx, Nxx, Axx, NxL, NxR, - NxN, NxN, NxN, NIx, /* CS following la */ - /*ls*/ Nxx, Nxx, Nxx, Nxx, LxL, NxR, - NxN, NxN, NxN, NIx, /* CS,ES following le */ + /*ac*/ Nxx, Nxx, Nxx, Axx, AxA, NxR, + NxN, NxN, NxN, NxN, /* CS following cn */ + /*rc*/ Nxx, Nxx, Nxx, Axx, NxE, NxR, + NxN, NxN, NxN, NIx, /* CS following ra */ + /*rs*/ Nxx, Nxx, Nxx, Nxx, ExE, NxR, + NxN, NxN, NxN, NIx, /* CS,ES following re */ + /*lc*/ Nxx, Nxx, Nxx, Axx, NxL, NxR, + NxN, NxN, NxN, NIx, /* CS following la */ + /*ls*/ Nxx, Nxx, Nxx, Nxx, LxL, NxR, + NxN, NxN, NxN, NIx, /* CS,ES following le */ - /*ret*/ xxx, xxx, xxx, xxx, xxE, xxR, - xxE, xxN, xxN, xxE, /* ET following re */ - /*let*/ xxx, xxx, xxx, xxx, xxL, xxR, - xxL, xxN, xxN, xxL, /* ET following le */ + /*ret*/ xxx, xxx, xxx, xxx, xxE, xxR, + xxE, xxN, xxN, xxE, /* ET following re */ + /*let*/ xxx, xxx, xxx, xxx, xxL, xxR, + xxL, xxN, xxN, xxL, /* ET following le */ }; static int GetDeferredType(int action) { @@ -1058,29 +1059,29 @@ enum neutral_state { ------------------------------------------------------------------------*/ static int actionNeutrals[][5] = { - // N, L, R, AN, EN, = cls - // state = - In, 0, 0, 0, 0, // r right - In, 0, 0, 0, L, // l left + // N, L, R, AN, EN, = cls + // state = + In, 0, 0, 0, 0, // r right + In, 0, 0, 0, L, // l left - In, En, Rn, Rn, Rn, // rn N preceded by right - In, Ln, En, En, LnL, // ln N preceded by left + In, En, Rn, Rn, Rn, // rn N preceded by right + In, Ln, En, En, LnL, // ln N preceded by left - In, 0, 0, 0, L, // a AN preceded by left - In, En, Rn, Rn, En, // na N preceded by a + In, 0, 0, 0, L, // a AN preceded by left + In, En, Rn, Rn, En, // na N preceded by a }; static int stateNeutrals[][5] = { - // N, L, R, AN, EN = cls - // state = - rn, l, r, r, r, // r right - ln, l, r, a, l, // l left + // N, L, R, AN, EN = cls + // state = + rn, l, r, r, r, // r right + ln, l, r, a, l, // l left - rn, l, r, r, r, // rn N preceded by right - ln, l, r, a, l, // ln N preceded by left + rn, l, r, r, r, // rn N preceded by right + ln, l, r, a, l, // ln N preceded by left - na, l, r, a, l, // a AN preceded by left - na, l, r, a, l, // na N preceded by la + na, l, r, a, l, // a AN preceded by left + na, l, r, a, l, // na N preceded by la }; /*------------------------------------------------------------------------ @@ -1175,10 +1176,10 @@ static void resolveNeutrals(int baselevel, uint8_t *pcls, const uint8_t *plevel, R, L, AN, EN ------------------------------------------------------------------------*/ static int addLevel[][4] = { - // L, R, AN, EN = cls - // level = - /* even */ 0, 1, 2, 2, // EVEN - /* odd */ 1, 0, 1, 1, // ODD + // L, R, AN, EN = cls + // level = + /* even */ 0, 1, 2, 2, // EVEN + /* odd */ 1, 0, 1, 1, // ODD }; diff --git a/AppKit/NSTextView.subproj/NSLayoutManager.m b/AppKit/NSTextView.subproj/NSLayoutManager.m index 06e95eb2..1df9c2f8 100644 --- a/AppKit/NSTextView.subproj/NSLayoutManager.m +++ b/AppKit/NSTextView.subproj/NSLayoutManager.m @@ -84,7 +84,7 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, NSRange *effectiveRange) { NSGlyphFragment *result = - NSRangeEntryAtIndex(self->_glyphFragments, index, effectiveRange); + NSRangeEntryAtIndex(self->_glyphFragments, index, effectiveRange); if (result == NULL) { // That can happens in normal cases, so we don't want to crash or log @@ -102,8 +102,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, // The text storage owns the layout manager (and text view can own the // storage) Retaining it here would create a retain cycle. - _textStorage = - [[[keyed decodeObjectForKey: @"NSTextStorage"] retain] autorelease]; + _textStorage = [[[keyed decodeObjectForKey: @"NSTextStorage"] retain] + autorelease]; _rangeToTemporaryAttributes = NSCreateRangeToCopiedObjectEntries(0); NSRangeEntryInsert(_rangeToTemporaryAttributes, @@ -115,8 +115,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, _delegate = [keyed decodeObjectForKey: @"NSDelegate"]; _textContainers = [NSMutableArray new]; [_textContainers - addObjectsFromArray: [keyed - decodeObjectForKey: @"NSTextContainers"]]; + addObjectsFromArray: + [keyed decodeObjectForKey: @"NSTextContainers"]]; _glyphFragments = NSCreateRangeToOwnedPointerEntries(2); _invalidFragments = NSCreateRangeToOwnedPointerEntries(2); _layoutInvalid = YES; @@ -258,8 +258,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, } - (void) insertGlyph: (NSGlyph) glyph - atGlyphIndex: (NSUInteger) glyphIndex - characterIndex: (NSUInteger) characterIndex + atGlyphIndex: (NSUInteger) glyphIndex + characterIndex: (NSUInteger) characterIndex { } @@ -302,8 +302,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, NSRange characterRange = [self characterRangeForGlyphRange: glyphRange actualGlyphRange: NULL]; NSDictionary *attributes = - [_textStorage attributesAtIndex: characterRange.location - effectiveRange: NULL]; + [_textStorage attributesAtIndex: characterRange.location + effectiveRange: NULL]; return NSFontAttributeInDictionary(attributes); } @@ -324,8 +324,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, [[_textStorage string] getCharacters: buffer range: characterRange]; [font getGlyphs: glyphs - forCharacters: buffer - length: characterRange.length]; + forCharacters: buffer + length: characterRange.length]; #if DEBUG_getGlyphs_range NSLog(@"returning %u", glyphRange.length); @@ -446,7 +446,7 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, - (NSTextContainer *) textContainerForGlyphAtIndex: (NSUInteger) glyphIndex effectiveRange: - (NSRangePointer) effectiveGlyphRange + (NSRangePointer) effectiveGlyphRange { #if DEBUG_LM_LAYOUT @@ -457,7 +457,7 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, [self validateGlyphsAndLayoutForGlyphRange: NSMakeRange(glyphIndex, 1)]; NSGlyphFragment *fragment = - fragmentAtGlyphIndex(self, glyphIndex, effectiveGlyphRange); + fragmentAtGlyphIndex(self, glyphIndex, effectiveGlyphRange); if (fragment == NULL) { #if DEBUG_textContainerForGlyphAtIndex_effectiveRange @@ -469,7 +469,7 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, if (effectiveGlyphRange) { *effectiveGlyphRange = - [self _currentGlyphRangeForTextContainer: fragment->container]; + [self _currentGlyphRangeForTextContainer: fragment->container]; } #if DEBUG_textContainerForGlyphAtIndex_effectiveRange @@ -490,7 +490,7 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, #endif NSGlyphFragment *fragment = - fragmentAtGlyphIndex(self, glyphIndex, effectiveGlyphRange); + fragmentAtGlyphIndex(self, glyphIndex, effectiveGlyphRange); if (fragment == NULL) { @@ -535,7 +535,7 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, - (NSRect) lineFragmentUsedRectForGlyphAtIndex: (NSUInteger) glyphIndex effectiveRange: - (NSRangePointer) effectiveGlyphRange + (NSRangePointer) effectiveGlyphRange { #if DEBUG_LM_LAYOUT @@ -545,7 +545,7 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, #endif NSGlyphFragment *fragment = - fragmentAtGlyphIndex(self, glyphIndex, effectiveGlyphRange); + fragmentAtGlyphIndex(self, glyphIndex, effectiveGlyphRange); if (fragment == NULL) { @@ -588,16 +588,16 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, if ([_delegate respondsToSelector: @selector (layoutManager: - didCompleteLayoutForTextContainer:atEnd:)]) { + didCompleteLayoutForTextContainer:atEnd:)]) { NSTextContainer *container = [_textContainers lastObject]; NSRange containerRange = - [self _currentGlyphRangeForTextContainer: container]; + [self _currentGlyphRangeForTextContainer: container]; BOOL finished = - NSMaxRange(containerRange) >= NSMaxRange(glyphRange); + NSMaxRange(containerRange) >= NSMaxRange(glyphRange); [_delegate layoutManager: self - didCompleteLayoutForTextContainer: container - atEnd: finished]; + didCompleteLayoutForTextContainer: container + atEnd: finished]; #if DEBUG_validateGlyphsAndLayoutForGlyphRange NSLog(@"informed delegate with layoutManager: %p " @@ -632,7 +632,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, // Validate everything - we should at least validate everything up to this // container [self validateGlyphsAndLayoutForGlyphRange: NSMakeRange( - 0, [self numberOfGlyphs])]; + 0, + [self numberOfGlyphs])]; } - (NSRect) usedRectForTextContainer: (NSTextContainer *) container { @@ -654,8 +655,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, NSRange range; NSGlyphFragment *fragment; - while ( - NSNextRangeEnumeratorEntry(&state, &range, (void **) &fragment)) { + while (NSNextRangeEnumeratorEntry(&state, &range, + (void **) &fragment)) { if (fragment->container == container) { NSRect rect = fragment->usedRect; #if DEBUG_usedRectForTextContainer @@ -942,10 +943,10 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, } - (void) textStorage: (NSTextStorage *) storage - edited: (NSUInteger) editedMask - range: (NSRange) range - changeInLength: (NSInteger) changeInLength - invalidatedRange: (NSRange) invalidateRange + edited: (NSUInteger) editedMask + range: (NSRange) range + changeInLength: (NSInteger) changeInLength + invalidatedRange: (NSRange) invalidateRange { #if DEBUG_LM_LAYOUT @@ -1015,8 +1016,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, } - (NSUInteger) glyphIndexForPoint: (NSPoint) point - inTextContainer: (NSTextContainer *) container - fractionOfDistanceThroughGlyph: (CGFloat *) fraction + inTextContainer: (NSTextContainer *) container + fractionOfDistanceThroughGlyph: (CGFloat *) fraction { #if DEBUG_LM_LAYOUT @@ -1029,7 +1030,7 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, NSUInteger endOfFragment = 0; NSUInteger result = - NSMaxRange([self glyphRangeForTextContainer: container]); + NSMaxRange([self glyphRangeForTextContainer: container]); NSRange range; NSGlyphFragment *fragment; NSRangeEnumerator state; @@ -1046,7 +1047,7 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, // if we're at the end of a line we want to back up before the // newline This is a very ugly way to do it if ([[_textStorage string] - characterAtIndex: endOfFragment - 1] == '\n') { + characterAtIndex: endOfFragment - 1] == '\n') { #if DEBUG_glyphIndexForPoint_inTextContainer_fractionOfDistanceThroughGlyph NSLog(@"backing up before the newline"); #endif @@ -1154,13 +1155,13 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, CGFloat fraction; return [self glyphIndexForPoint: point - inTextContainer: container - fractionOfDistanceThroughGlyph: &fraction]; + inTextContainer: container + fractionOfDistanceThroughGlyph: &fraction]; } - (CGFloat) fractionOfDistanceThroughGlyphForPoint: (NSPoint) point inTextContainer: - (NSTextContainer *) container + (NSTextContainer *) container { #if DEBUG_LM_LAYOUT @@ -1172,8 +1173,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, CGFloat fraction; [self glyphIndexForPoint: point - inTextContainer: container - fractionOfDistanceThroughGlyph: &fraction]; + inTextContainer: container + fractionOfDistanceThroughGlyph: &fraction]; return fraction; } @@ -1250,8 +1251,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, NSRange range; NSGlyphFragment *fragment; - while ( - NSNextRangeEnumeratorEntry(&state, &range, (void **) &fragment)) { + while (NSNextRangeEnumeratorEntry(&state, &range, + (void **) &fragment)) { if (fragment->container == container) { NSRect check = fragment->rect; @@ -1274,7 +1275,8 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, - (NSRange) glyphRangeForBoundingRectWithoutAdditionalLayout: (NSRect) bounds inTextContainer: - (NSTextContainer *) container + (NSTextContainer *) + container { return NSMakeRange(0, 0); } @@ -1318,8 +1320,9 @@ static inline NSGlyphFragment *fragmentAtGlyphIndex(NSLayoutManager *self, static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { if (self->_rectCacheCount >= self->_rectCacheCapacity) { self->_rectCacheCapacity *= 2; - self->_rectCache = NSZoneRealloc( - NULL, self->_rectCache, sizeof(NSRect) * self->_rectCacheCapacity); + self->_rectCache = + NSZoneRealloc(NULL, self->_rectCache, + sizeof(NSRect) * self->_rectCacheCapacity); } self->_rectCache[self->_rectCacheCount++] = rect; @@ -1341,14 +1344,14 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { #endif NSRange remainder = - (selGlyphRange.location == NSNotFound) ? glyphRange : selGlyphRange; + (selGlyphRange.location == NSNotFound) ? glyphRange : selGlyphRange; _rectCacheCount = 0; do { NSRange range; // Get the fragment to the range to process NSGlyphFragment *fragment = - fragmentAtGlyphIndex(self, remainder.location, &range); + fragmentAtGlyphIndex(self, remainder.location, &range); if (fragment == NULL) { @@ -1400,9 +1403,9 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { glyph = NSNullGlyph; advance = [font positionOfGlyph: glyph - precededByGlyph: previousGlyph - isNominal: &ignore] - .x; + precededByGlyph: previousGlyph + isNominal: &ignore] + .x; if (range.location + i <= intersect.location) { // Not yet part of intersect - advance the fill rect // origin @@ -1418,7 +1421,7 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { // We want the full end of fragment, so grow the width // to the end of the fragment rect fill.size.width = - NSMaxX(fragment->rect) - fill.origin.x; + NSMaxX(fragment->rect) - fill.origin.x; } } else { // Start from the right @@ -1430,9 +1433,9 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { glyph = NSNullGlyph; advance = [font positionOfGlyph: glyph - precededByGlyph: previousGlyph - isNominal: &ignore] - .x; + precededByGlyph: previousGlyph + isNominal: &ignore] + .x; if (range.location + i <= intersect.location) { // Not yet part of intersect - advance the fill rect // origin to the left @@ -1535,12 +1538,12 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { #define DEBUG_LM_DRAWING 0 - (void) showPackedGlyphs: (char *) glyphs - length: (NSUInteger) length - glyphRange: (NSRange) glyphRange - atPoint: (NSPoint) point - font: (NSFont *) font - color: (NSColor *) color - printingAdjustment: (NSSize) printingAdjustment + length: (NSUInteger) length + glyphRange: (NSRange) glyphRange + atPoint: (NSPoint) point + font: (NSFont *) font + color: (NSColor *) color + printingAdjustment: (NSSize) printingAdjustment { #if DEBUG_LM_DRAWING @@ -1583,7 +1586,7 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { NSTextView *textView = [self textViewForBeginningOfSelection]; NSColor *selectedColor = [[textView selectedTextAttributes] - objectForKey: NSBackgroundColorAttributeName]; + objectForKey: NSBackgroundColorAttributeName]; NSRange range; NSRect *rectArray; NSUInteger i, rectCount = 0; @@ -1628,8 +1631,8 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { glyphRange = [self validateGlyphsAndLayoutForGlyphRange: glyphRange]; { NSTextContainer *container = - [self textContainerForGlyphAtIndex: glyphRange.location - effectiveRange: &glyphRange]; + [self textContainerForGlyphAtIndex: glyphRange.location + effectiveRange: &glyphRange]; if (container == nil) { return; } @@ -1639,13 +1642,13 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { NSUInteger limit = NSMaxRange(characterRange); BOOL isFlipped = [[NSGraphicsContext currentContext] isFlipped]; CGFloat usedHeight = - [self usedRectForTextContainer: container].size.height; + [self usedRectForTextContainer: container].size.height; while (location < limit) { NSRange effectiveRange; NSDictionary *attributes = - [_textStorage attributesAtIndex: location - effectiveRange: &effectiveRange]; + [_textStorage attributesAtIndex: location + effectiveRange: &effectiveRange]; // Make sure the effectiveRange doesn't take us backwards! NSInteger reduction = location - effectiveRange.location; effectiveRange.location = location; @@ -1659,9 +1662,10 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { continueSearch && tempOffset < NSMaxRange(effectiveRange); tempOffset++) { NSRange tempEffectiveRange = NSMakeRange(0, 0); - NSDictionary *tempAttrs = [self - temporaryAttributesAtCharacterIndex: tempOffset - effectiveRange: &tempEffectiveRange]; + NSDictionary *tempAttrs = + [self temporaryAttributesAtCharacterIndex: tempOffset + effectiveRange: + &tempEffectiveRange]; if (NSEqualRanges(effectiveRange, tempEffectiveRange)) { // Things are lined up nicely - we can just use the // effectiveRange as is @@ -1674,7 +1678,7 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { // cut effectiveRange down so it ends at the start // of the temp range effectiveRange.length = - tempOffset - effectiveRange.location; + tempOffset - effectiveRange.location; continueSearch = NO; } else if (tempEffectiveRange.length < effectiveRange.length) { @@ -1689,42 +1693,43 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { } NSRange tempEffectiveRange = NSMakeRange(0, 0); - NSDictionary *tempAttrs = - [self temporaryAttributesAtCharacterIndex: location - effectiveRange: &tempEffectiveRange]; + NSDictionary *tempAttrs = [self + temporaryAttributesAtCharacterIndex: location + effectiveRange: &tempEffectiveRange]; if ([tempAttrs count] > 0) { // Merge in the temporary attributes BOOL checkTemporaryAttributesUsage = [_delegate - respondsToSelector: @selector - (layoutManager: - shouldUseTemporaryAttributes:forDrawingToScreen - :atCharacterIndex - :effectiveRange:)]; + respondsToSelector: @selector + (layoutManager: + shouldUseTemporaryAttributes:forDrawingToScreen + :atCharacterIndex + :effectiveRange:)]; if (checkTemporaryAttributesUsage) { tempAttrs = [_delegate layoutManager: self shouldUseTemporaryAttributes: tempAttrs - forDrawingToScreen: [[NSGraphicsContext - currentContext] - isDrawingToScreen] + forDrawingToScreen: + [[NSGraphicsContext + currentContext] + isDrawingToScreen] atCharacterIndex: location effectiveRange: NULL]; } NSMutableDictionary *dict = - [[attributes mutableCopy] autorelease]; + [[attributes mutableCopy] autorelease]; [dict addEntriesFromDictionary: tempAttrs]; attributes = dict; } NSColor *color = - [attributes objectForKey: NSBackgroundColorAttributeName]; + [attributes objectForKey: NSBackgroundColorAttributeName]; effectiveRange = - NSIntersectionRange(characterRange, effectiveRange); + NSIntersectionRange(characterRange, effectiveRange); if (color != nil) { NSUInteger i, rectCount; - NSRect *rects = - [self rectArrayForCharacterRange: effectiveRange + NSRect *rects = [self + rectArrayForCharacterRange: effectiveRange withinSelectedCharacterRange: NSMakeRange(NSNotFound, 0) inTextContainer: container rectCount: &rectCount]; @@ -1736,7 +1741,7 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { if (!isFlipped) fill.origin.y = - usedHeight - (fill.origin.y + fill.size.height); + usedHeight - (fill.origin.y + fill.size.height); fill.origin.x += origin.x; fill.origin.y += origin.y; @@ -1759,12 +1764,13 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { containerOrigin: (NSPoint) containerOrigin { #if DEBUG_LM_DRAWING - NSLog( - @"drawUnderlineForGlyphRange: %@ underlineType: %@ baselineOffset: %f " - @"lineFragmentRect: %@ lineFragmentGlyphRange: %@ containerOrigin: %@", - NSStringFromRange(glyphRange), underlineVal, baselineOffset, - NSStringFromRect(lineRect), NSStringFromRange(lineGlyphRange), - NSStringFromPoint(containerOrigin)); + NSLog(@"drawUnderlineForGlyphRange: %@ underlineType: %@ baselineOffset: " + @"%f " + @"lineFragmentRect: %@ lineFragmentGlyphRange: %@ containerOrigin: " + @"%@", + NSStringFromRange(glyphRange), underlineVal, baselineOffset, + NSStringFromRect(lineRect), NSStringFromRange(lineGlyphRange), + NSStringFromPoint(containerOrigin)); #define DEBUG_LM_DRAWUNDERLINEFORGLYPHRANGE 0 #endif @@ -1773,8 +1779,8 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { actualGlyphRange: NULL]; BOOL isFlipped = [[NSGraphicsContext currentContext] isFlipped]; NSTextContainer *container = - [self textContainerForGlyphAtIndex: glyphRange.location - effectiveRange: NULL]; + [self textContainerForGlyphAtIndex: glyphRange.location + effectiveRange: NULL]; NSRect *rects = [self rectArrayForCharacterRange: characterRange withinSelectedCharacterRange: NSMakeRange(NSNotFound, 0) @@ -1803,34 +1809,35 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { fill.origin.x += origin.x; fill.origin.y += - origin.y + baselineOffset - - .5; // .5 so it's better aligned on pixels - looks sharper + origin.y + baselineOffset - + .5; // .5 so it's better aligned on pixels - looks sharper [path moveToPoint: fill.origin]; CGFloat width = fill.size.width; [path relativeLineToPoint: NSMakePoint(width, 0)]; } NSDictionary *attributes = - [_textStorage attributesAtIndex: characterRange.location - effectiveRange: NULL]; + [_textStorage attributesAtIndex: characterRange.location + effectiveRange: NULL]; // Don't forget the temporary attributes NSDictionary *tmpAttrs = - [self temporaryAttributesAtCharacterIndex: characterRange.location - effectiveRange: NULL]; + [self temporaryAttributesAtCharacterIndex: characterRange.location + effectiveRange: NULL]; if ([tmpAttrs count] > 0) { BOOL checkTemporaryAttributesUsage = [_delegate - respondsToSelector: @selector - (layoutManager: - shouldUseTemporaryAttributes:forDrawingToScreen:atCharacterIndex - :effectiveRange:)]; + respondsToSelector: @selector + (layoutManager: + shouldUseTemporaryAttributes:forDrawingToScreen + :atCharacterIndex + :effectiveRange:)]; if (checkTemporaryAttributesUsage) { tmpAttrs = [_delegate layoutManager: self - shouldUseTemporaryAttributes: tmpAttrs - forDrawingToScreen: [[NSGraphicsContext - currentContext] - isDrawingToScreen] - atCharacterIndex: characterRange.location - effectiveRange: NULL]; + shouldUseTemporaryAttributes: tmpAttrs + forDrawingToScreen: [[NSGraphicsContext + currentContext] + isDrawingToScreen] + atCharacterIndex: characterRange.location + effectiveRange: NULL]; } NSMutableDictionary *dict = [[attributes mutableCopy] autorelease]; [dict addEntriesFromDictionary: tmpAttrs]; @@ -1838,11 +1845,11 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { } NSColor *underlineColor = - [attributes objectForKey: NSUnderlineColorAttributeName]; + [attributes objectForKey: NSUnderlineColorAttributeName]; if (underlineColor == nil) { // Default to foreground color attribute... underlineColor = - [attributes objectForKey: NSForegroundColorAttributeName]; + [attributes objectForKey: NSForegroundColorAttributeName]; if (underlineColor == nil) { // ... and to black if still no luck underlineColor = [NSColor blackColor]; @@ -1853,10 +1860,10 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { } - (void) underlineGlyphRange: (NSRange) glyphRange - underlineType: (NSInteger) underlineVal - lineFragmentRect: (NSRect) lineRect - lineFragmentGlyphRange: (NSRange) lineGlyphRange - containerOrigin: (NSPoint) containerOrigin + underlineType: (NSInteger) underlineVal + lineFragmentRect: (NSRect) lineRect + lineFragmentGlyphRange: (NSRange) lineGlyphRange + containerOrigin: (NSPoint) containerOrigin { // A full implementation would honor options like breaking the underline for // whitespace. @@ -1890,8 +1897,8 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { actualGlyphRange: NULL]; BOOL isFlipped = [[NSGraphicsContext currentContext] isFlipped]; NSTextContainer *container = - [self textContainerForGlyphAtIndex: glyphRange.location - effectiveRange: NULL]; + [self textContainerForGlyphAtIndex: glyphRange.location + effectiveRange: NULL]; NSRect *rects = [self rectArrayForCharacterRange: characterRange withinSelectedCharacterRange: NSMakeRange(NSNotFound, 0) inTextContainer: container @@ -1924,10 +1931,10 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { } NSDictionary *attributes = - [_textStorage attributesAtIndex: characterRange.location - effectiveRange: NULL]; + [_textStorage attributesAtIndex: characterRange.location + effectiveRange: NULL]; NSColor *underlineColor = - [attributes objectForKey: NSUnderlineColorAttributeName]; + [attributes objectForKey: NSUnderlineColorAttributeName]; if (underlineColor == nil) { underlineColor = [NSColor blackColor]; } @@ -2003,7 +2010,7 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { - (NSColor *) _selectedColor { NSTextView *textView = [self textViewForBeginningOfSelection]; NSColor *selectedColor = [[textView selectedTextAttributes] - objectForKey: NSForegroundColorAttributeName]; + objectForKey: NSForegroundColorAttributeName]; if (selectedColor == nil) { selectedColor = [NSColor selectedTextColor]; @@ -2012,12 +2019,12 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { } - (void) _drawGlyphs: (NSGlyph *) glyphs - length: (NSUInteger) length - range: (NSRange) range - atPoint: (NSPoint) point - inContainer: (NSTextContainer *) container - withAttributes: (NSDictionary *) attributes - origin: (NSPoint) origin + length: (NSUInteger) length + range: (NSRange) range + atPoint: (NSPoint) point + inContainer: (NSTextContainer *) container + withAttributes: (NSDictionary *) attributes + origin: (NSPoint) origin { #if DEBUG_LM_DRAWING NSLog(@"_drawGlyphs: %p length: %d range: %@ atPoint: %@ inContainer: %p " @@ -2034,54 +2041,54 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { char packedGlyphs[length * 2]; // Specs says length*4+1 but needed buffer // size is at max length*2 on Cocotron NSInteger packedGlyphsLength = NSConvertGlyphsToPackedGlyphs( - glyphs, length, NSNativeShortGlyphPacking, packedGlyphs); + glyphs, length, NSNativeShortGlyphPacking, packedGlyphs); [self showPackedGlyphs: packedGlyphs - length: packedGlyphsLength - glyphRange: range - atPoint: point - font: font - color: color - printingAdjustment: NSZeroSize]; + length: packedGlyphsLength + glyphRange: range + atPoint: point + font: font + color: color + printingAdjustment: NSZeroSize]; NSRange glyphRange = range; // Next take a look at the overprinting options - BOOL underline = - [[attributes objectForKey: NSUnderlineStyleAttributeName] boolValue]; + BOOL underline = [[attributes objectForKey: NSUnderlineStyleAttributeName] + boolValue]; BOOL strikeThru = [[attributes - objectForKey: NSStrikethroughStyleAttributeName] boolValue]; + objectForKey: NSStrikethroughStyleAttributeName] boolValue]; if (underline || strikeThru) { NSRange lineGlyphRange; NSRect lineRect = - [self lineFragmentRectForGlyphAtIndex: glyphRange.location - effectiveRange: &lineGlyphRange]; + [self lineFragmentRectForGlyphAtIndex: glyphRange.location + effectiveRange: &lineGlyphRange]; if (underline) { [self underlineGlyphRange: glyphRange - underlineType: NSUnderlineStyleThick - lineFragmentRect: lineRect - lineFragmentGlyphRange: lineGlyphRange - containerOrigin: origin]; + underlineType: NSUnderlineStyleThick + lineFragmentRect: lineRect + lineFragmentGlyphRange: lineGlyphRange + containerOrigin: origin]; } if (strikeThru) { // Make sure we've got a good strikeThru color - NSColor *strikeThruColor = - [attributes objectForKey: NSStrikethroughColorAttributeName]; + NSColor *strikeThruColor = [attributes + objectForKey: NSStrikethroughColorAttributeName]; if (strikeThruColor == nil) { strikeThruColor = [NSColor blackColor]; } [self strikethroughGlyphRange: glyphRange - strikethroughType: NSUnderlineStyleThick - lineFragmentRect: lineRect - lineFragmentGlyphRange: lineGlyphRange - containerOrigin: origin]; + strikethroughType: NSUnderlineStyleThick + lineFragmentRect: lineRect + lineFragmentGlyphRange: lineGlyphRange + containerOrigin: origin]; } } NSNumber *spellingState = - [attributes objectForKey: NSSpellingStateAttributeName]; + [attributes objectForKey: NSSpellingStateAttributeName]; if (spellingState != nil) { [self drawSpellingState: spellingState glyphRange: glyphRange @@ -2108,9 +2115,9 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { NSTextView *textView = [self textViewForBeginningOfSelection]; [cell drawWithFrame: frame - inView: textView - characterIndex: index - layoutManager: self]; + inView: textView + characterIndex: index + layoutManager: self]; } - (CGFloat) _drawGlyphsForSubGlyphRange: (NSRange) range @@ -2137,7 +2144,7 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { NSColor *selectedColor = [self _selectedColor]; NSRange selectedRange = - (textView == nil) ? NSMakeRange(0, 0) : [textView selectedRange]; + (textView == nil) ? NSMakeRange(0, 0) : [textView selectedRange]; NSRange characterRange = [self characterRangeForGlyphRange: range actualGlyphRange: NULL]; @@ -2147,7 +2154,7 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { NSColor *color = NSForegroundColorAttributeInDictionary(attributes); NSTextAttachment *attachment = - [attributes objectForKey: NSAttachmentAttributeName]; + [attributes objectForKey: NSAttachmentAttributeName]; // Get the location of the fragment NSPoint point = fragment->location; @@ -2168,8 +2175,8 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { if (attachment != nil) { // Draw the attachment at the calculated point [self _drawAttachment: attachment - atCharacterIndex: characterRange.location - atPoint: point]; + atCharacterIndex: characterRange.location + atPoint: point]; } else { @@ -2195,9 +2202,9 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { if (ltor == NO) { // Mirror the selection since the glyphs order is Right-to-Left NSUInteger distanceToEnd = - NSMaxRange(characterRange) - NSMaxRange(intersectRange); + NSMaxRange(characterRange) - NSMaxRange(intersectRange); intersectRange.location = - characterRange.location + distanceToEnd; + characterRange.location + distanceToEnd; } NSGlyph previousGlyph = NSNullGlyph; @@ -2212,8 +2219,8 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { NSUInteger length = 0; BOOL showGlyphs = NO; - NSGlyph glyph = - (location < NSMaxRange(range)) ? glyphs[i] : NSNullGlyph; + NSGlyph glyph = (location < NSMaxRange(range)) ? glyphs[i] + : NSNullGlyph; // Glyph is invisible so just translate it to a Null glyph if (glyph == NSControlGlyph) { @@ -2267,22 +2274,22 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { // Make sure we keep track of how many points we've used with // each one partWidth += [font positionOfGlyph: glyph - precededByGlyph: previousGlyph - isNominal: &ignore] - .x; + precededByGlyph: previousGlyph + isNominal: &ignore] + .x; if (showGlyphs) { // Show the range of glyphs specifed by offset and length NSRange subRange = - NSMakeRange(range.location + offset, length); + NSMakeRange(range.location + offset, length); [self _drawGlyphs: glyphs + offset - length: length - range: subRange - atPoint: point - inContainer: container - withAttributes: attributes - origin: origin]; + length: length + range: subRange + atPoint: point + inContainer: container + withAttributes: attributes + origin: origin]; // And make sure we know where we are witin the fragment. point.x += partWidth; @@ -2308,19 +2315,19 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { glyph = NSNullGlyph; } partWidth += [font positionOfGlyph: glyph - precededByGlyph: previousGlyph - isNominal: &ignore] - .x; + precededByGlyph: previousGlyph + isNominal: &ignore] + .x; previousGlyph = glyph; } [self _drawGlyphs: glyphs - length: glyphsLength - range: range - atPoint: point - inContainer: container - withAttributes: attributes - origin: origin]; + length: glyphsLength + range: range + atPoint: point + inContainer: container + withAttributes: attributes + origin: origin]; point.x += partWidth; } } @@ -2342,13 +2349,13 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { NSTextView *textView = [self textViewForBeginningOfSelection]; NSRange selectedRange = - (textView == nil) ? NSMakeRange(0, 0) : [textView selectedRange]; + (textView == nil) ? NSMakeRange(0, 0) : [textView selectedRange]; glyphRange = [self validateGlyphsAndLayoutForGlyphRange: glyphRange]; NSTextContainer *container = - [self textContainerForGlyphAtIndex: glyphRange.location - effectiveRange: NULL]; + [self textContainerForGlyphAtIndex: glyphRange.location + effectiveRange: NULL]; if (container == nil) { // Not sure if this is ever a good thing - but it's certainly a bad // thing and if there's no container within which to layout - we're @@ -2361,11 +2368,12 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { NSRange range; NSGlyphFragment *fragment; - BOOL checkTemporaryAttributesUsage = [_delegate - respondsToSelector: @selector - (layoutManager: - shouldUseTemporaryAttributes:forDrawingToScreen:atCharacterIndex - :effectiveRange:)]; + BOOL checkTemporaryAttributesUsage = + [_delegate respondsToSelector: @selector + (layoutManager: + shouldUseTemporaryAttributes:forDrawingToScreen + :atCharacterIndex + :effectiveRange:)]; // Iterate over the glyph fragments (which identify runs of common // attributes) @@ -2385,12 +2393,12 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { // because we know we're within a glyph fragment which means that // the character range and attributes are already limited correctly. NSRange characterRange = - [self characterRangeForGlyphRange: intersect - actualGlyphRange: NULL]; + [self characterRangeForGlyphRange: intersect + actualGlyphRange: NULL]; NSDictionary *attributes = - [_textStorage attributesAtIndex: characterRange.location - effectiveRange: NULL]; + [_textStorage attributesAtIndex: characterRange.location + effectiveRange: NULL]; #if DEBUG_LM_DRAWGLYPHSFORGLYPHRANGE NSLog(@" characterRange: %@", NSStringFromRange(characterRange)); @@ -2424,8 +2432,8 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { if (tempAttributesInRange) { NSRange tempRange; NSDictionary *tmpAttrs = [self - temporaryAttributesAtCharacterIndex: tempAttributesIndex - effectiveRange: &tempRange]; + temporaryAttributesAtCharacterIndex: tempAttributesIndex + effectiveRange: &tempRange]; NSLog(@" temporaryAttributes: %@", tmpAttrs); } #endif @@ -2447,72 +2455,73 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { // Make sure we don't go beyond the remaining range of the // current fragment NSRange remainingRange = NSMakeRange( - charIndex, NSMaxRange(characterRange) - charIndex); + charIndex, NSMaxRange(characterRange) - charIndex); if (NSRangeEntryAtIndex(_rangeToTemporaryAttributes, charIndex, &tempRange) != nil && NSIntersectionRange(remainingRange, tempRange).length > - 0) { + 0) { if (length > 0) { // draw the glyphs that we've encountered so far (if // any) NSRange subRange = NSMakeRange(offset, length); subRange = - [self glyphRangeForCharacterRange: subRange - actualCharacterRange: NULL]; - glyphXOffset = - [self _drawGlyphsForSubGlyphRange: subRange - forFragment: fragment - atPoint: origin - subRangeXOffset: glyphXOffset - inContainer: container - withAttributes: attributes - usedHeight: usedHeight]; + [self glyphRangeForCharacterRange: subRange + actualCharacterRange: NULL]; + glyphXOffset = [self + _drawGlyphsForSubGlyphRange: subRange + forFragment: fragment + atPoint: origin + subRangeXOffset: glyphXOffset + inContainer: container + withAttributes: attributes + usedHeight: usedHeight]; } NSDictionary *tempAttrs = [self - temporaryAttributesAtCharacterIndex: charIndex - effectiveRange: &tempRange]; + temporaryAttributesAtCharacterIndex: charIndex + effectiveRange: & + tempRange]; if (checkTemporaryAttributesUsage) { tempAttrs = [_delegate layoutManager: self shouldUseTemporaryAttributes: tempAttrs forDrawingToScreen: - [[NSGraphicsContext - currentContext] - isDrawingToScreen] + [[NSGraphicsContext + currentContext] + isDrawingToScreen] atCharacterIndex: charIndex effectiveRange: &tempRange]; } tempRange = - NSIntersectionRange(remainingRange, tempRange); + NSIntersectionRange(remainingRange, tempRange); // Merge the temp attributes with the permanent // attributes NSMutableDictionary *mergedAttrs = - [[attributes mutableCopy] autorelease]; + [[attributes mutableCopy] autorelease]; [mergedAttrs addEntriesFromDictionary: tempAttrs]; NSRange tempGlyphRange = - [self glyphRangeForCharacterRange: tempRange - actualCharacterRange: NULL]; + [self glyphRangeForCharacterRange: tempRange + actualCharacterRange: NULL]; - glyphXOffset = - [self _drawGlyphsForSubGlyphRange: tempGlyphRange - forFragment: fragment - atPoint: origin - subRangeXOffset: glyphXOffset - inContainer: container - withAttributes: mergedAttrs - usedHeight: usedHeight]; + glyphXOffset = [self + _drawGlyphsForSubGlyphRange: tempGlyphRange + forFragment: fragment + atPoint: origin + subRangeXOffset: glyphXOffset + inContainer: container + withAttributes: mergedAttrs + usedHeight: usedHeight]; // And reset ready for the next run offset = NSMaxRange(tempRange); charIndex = - offset - - 1; // Make sure we leap over the temp range (one off - // to accommodate the auto-increment) + offset - + 1; // Make sure we leap over the temp range (one + // off to accommodate the auto-increment) length = -1; // accommodate the auto-increment } @@ -2560,7 +2569,7 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { actualCharacterRange: NULL]; fragment = - NSRangeEntryAtIndex(self->_glyphFragments, result.location, NULL); + NSRangeEntryAtIndex(self->_glyphFragments, result.location, NULL); if (fragment == NULL) return result; @@ -2568,8 +2577,8 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { i = result.location; j = result.location; - while ( - (fragment = NSRangeEntryAtIndex(self->_glyphFragments, i - 1, NULL))) { + while ((fragment = + NSRangeEntryAtIndex(self->_glyphFragments, i - 1, NULL))) { if (fragment->location.y != origin) break; result.location = i; @@ -2599,9 +2608,9 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { return [font defaultLineHeightForFont]; } -- (NSDictionary *) temporaryAttributesAtCharacterIndex: (NSUInteger) charIndex - effectiveRange: - (NSRangePointer) effectiveCharRange +- (NSDictionary *) + temporaryAttributesAtCharacterIndex: (NSUInteger) charIndex + effectiveRange: (NSRangePointer) effectiveCharRange { NSDictionary *result; @@ -2635,7 +2644,7 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { } else if (charRange.length > 0) { // Make sure we don't go beyond the actual text storage range NSRange intersect = NSIntersectionRange( - NSMakeRange(0, [_textStorage length]), charRange); + NSMakeRange(0, [_textStorage length]), charRange); NSRangeEntriesDivideAndConquer(_rangeToTemporaryAttributes, intersect); NSRangeEntryInsert(_rangeToTemporaryAttributes, intersect, attrs); @@ -2658,17 +2667,17 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { while (location < limit) { NSRange effectiveRange; NSMutableDictionary *modify = - [[[self temporaryAttributesAtCharacterIndex: location - effectiveRange: &effectiveRange] - mutableCopy] autorelease]; + [[[self temporaryAttributesAtCharacterIndex: location + effectiveRange: &effectiveRange] + mutableCopy] autorelease]; NSRange replace; [modify addEntriesFromDictionary: attrs]; replace.location = MAX(location, effectiveRange.location); replace.length = - MIN(NSMaxRange(charRange), NSMaxRange(effectiveRange)) - - replace.location; + MIN(NSMaxRange(charRange), NSMaxRange(effectiveRange)) - + replace.location; [self setTemporaryAttributes: modify forCharacterRange: replace]; @@ -2697,13 +2706,14 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { while (location < limit) { NSRange effectiveRange; NSDictionary *check = - [self temporaryAttributesAtCharacterIndex: location - effectiveRange: &effectiveRange]; + [self temporaryAttributesAtCharacterIndex: location + effectiveRange: &effectiveRange]; NSRange replace; replace.location = location; replace.length = - MIN(NSMaxRange(charRange), NSMaxRange(effectiveRange)) - location; + MIN(NSMaxRange(charRange), NSMaxRange(effectiveRange)) - + location; if ([check objectForKey: attrName] != nil) { NSMutableDictionary *modify = [[check mutableCopy] autorelease]; @@ -2723,13 +2733,13 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { { return [[self temporaryAttributesAtCharacterIndex: location effectiveRange: range] - objectForKey: attrName]; + objectForKey: attrName]; } - (id) temporaryAttribute: (NSString *) attrName - atCharacterIndex: (NSUInteger) location - longestEffectiveRange: (NSRangePointer) range - inRange: (NSRange) rangeLimit + atCharacterIndex: (NSUInteger) location + longestEffectiveRange: (NSRangePointer) range + inRange: (NSRange) rangeLimit { id result = [self temporaryAttribute: attrName atCharacterIndex: location @@ -2781,9 +2791,9 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { // Check if we can expand it before the found range NSRange effectiveRange; while (range->location > rangeLimit.location) { - id attr = - [self temporaryAttributesAtCharacterIndex: range->location - 1 - effectiveRange: &effectiveRange]; + id attr = [self + temporaryAttributesAtCharacterIndex: range->location - 1 + effectiveRange: &effectiveRange]; if (attr == result || [attr isEqual: result]) { // Expand the found range location range->length = NSMaxRange(*range) - effectiveRange.location; @@ -2794,9 +2804,9 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { } // Check if we can expand it after the found range while (NSMaxRange(*range) < NSMaxRange(rangeLimit)) { - id attr = - [self temporaryAttributesAtCharacterIndex: NSMaxRange(*range) - effectiveRange: &effectiveRange]; + id attr = [self + temporaryAttributesAtCharacterIndex: NSMaxRange(*range) + effectiveRange: &effectiveRange]; if (attr == result || [attr isEqual: result]) { // Expand the found range length range->length = NSMaxRange(effectiveRange) - range->location; @@ -2826,7 +2836,7 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { NSMutableArray *markers = [NSMutableArray array]; CGFloat delta = - view.textContainer.lineFragmentPadding + view.textContainerOrigin.x; + view.textContainer.lineFragmentPadding + view.textContainerOrigin.x; // Add the margins markers #if 0 @@ -2852,23 +2862,23 @@ static inline void _appendRectToCache(NSLayoutManager *self, NSRect rect) { switch (textTab.tabStopType) { case NSLeftTabStopType: marker = [NSRulerMarker - leftTabMarkerWithRulerView: ruler - location: textTab.location + delta]; + leftTabMarkerWithRulerView: ruler + location: textTab.location + delta]; break; case NSRightTabStopType: marker = [NSRulerMarker - rightTabMarkerWithRulerView: ruler - location: textTab.location + delta]; + rightTabMarkerWithRulerView: ruler + location: textTab.location + delta]; break; case NSCenterTabStopType: marker = [NSRulerMarker - centerTabMarkerWithRulerView: ruler - location: textTab.location + delta]; + centerTabMarkerWithRulerView: ruler + location: textTab.location + delta]; break; case NSDecimalTabStopType: marker = [NSRulerMarker - decimalTabMarkerWithRulerView: ruler - location: textTab.location + delta]; + decimalTabMarkerWithRulerView: ruler + location: textTab.location + delta]; break; default: break; diff --git a/AppKit/NSTextView.subproj/NSRangeArray.m b/AppKit/NSTextView.subproj/NSRangeArray.m index 37d77f15..712cc854 100644 --- a/AppKit/NSTextView.subproj/NSRangeArray.m +++ b/AppKit/NSTextView.subproj/NSRangeArray.m @@ -46,8 +46,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) addRange: (NSRange) range { if (_count >= _capacity) { _capacity *= 2; - _ranges = - NSZoneRealloc([self zone], _ranges, sizeof(NSRange) * _capacity); + _ranges = NSZoneRealloc([self zone], _ranges, + sizeof(NSRange) * _capacity); } _ranges[_count++] = range; diff --git a/AppKit/NSTextView.subproj/NSRulerMarker+NSTextExtensions.m b/AppKit/NSTextView.subproj/NSRulerMarker+NSTextExtensions.m index 93785506..cae09aaf 100644 --- a/AppKit/NSTextView.subproj/NSRulerMarker+NSTextExtensions.m +++ b/AppKit/NSTextView.subproj/NSRulerMarker+NSTextExtensions.m @@ -15,11 +15,11 @@ { NSImage *image = [NSImage imageNamed: @"NSRulerMarkerTab"]; NSPoint imageOrigin = NSMakePoint(0, 0); - NSRulerMarker *marker = - [[[NSRulerMarker alloc] initWithRulerView: ruler - markerLocation: location - image: image - imageOrigin: imageOrigin] autorelease]; + NSRulerMarker *marker = [[[NSRulerMarker alloc] + initWithRulerView: ruler + markerLocation: location + image: image + imageOrigin: imageOrigin] autorelease]; return marker; } @@ -28,11 +28,11 @@ { NSImage *image = [NSImage imageNamed: @"NSRulerMarkerTab"]; NSPoint imageOrigin = NSMakePoint(0, 0); - NSRulerMarker *marker = - [[[NSRulerMarker alloc] initWithRulerView: ruler - markerLocation: location - image: image - imageOrigin: imageOrigin] autorelease]; + NSRulerMarker *marker = [[[NSRulerMarker alloc] + initWithRulerView: ruler + markerLocation: location + image: image + imageOrigin: imageOrigin] autorelease]; return marker; } @@ -41,11 +41,11 @@ { NSImage *image = [NSImage imageNamed: @"NSRulerMarkerTab"]; NSPoint imageOrigin = NSMakePoint(0, 0); - NSRulerMarker *marker = - [[[NSRulerMarker alloc] initWithRulerView: ruler - markerLocation: location - image: image - imageOrigin: imageOrigin] autorelease]; + NSRulerMarker *marker = [[[NSRulerMarker alloc] + initWithRulerView: ruler + markerLocation: location + image: image + imageOrigin: imageOrigin] autorelease]; return marker; } @@ -54,11 +54,11 @@ { NSImage *image = [NSImage imageNamed: @"NSRulerMarkerTab"]; NSPoint imageOrigin = NSMakePoint(0, 0); - NSRulerMarker *marker = - [[[NSRulerMarker alloc] initWithRulerView: ruler - markerLocation: location - image: image - imageOrigin: imageOrigin] autorelease]; + NSRulerMarker *marker = [[[NSRulerMarker alloc] + initWithRulerView: ruler + markerLocation: location + image: image + imageOrigin: imageOrigin] autorelease]; return marker; } @@ -67,11 +67,11 @@ { NSImage *image = [NSImage imageNamed: @"NSRulerMarkerTab"]; NSPoint imageOrigin = NSMakePoint(0, 0); - NSRulerMarker *marker = - [[[NSRulerMarker alloc] initWithRulerView: ruler - markerLocation: location - image: image - imageOrigin: imageOrigin] autorelease]; + NSRulerMarker *marker = [[[NSRulerMarker alloc] + initWithRulerView: ruler + markerLocation: location + image: image + imageOrigin: imageOrigin] autorelease]; return marker; } @@ -80,11 +80,11 @@ { NSImage *image = [NSImage imageNamed: @"NSRulerMarkerTab"]; NSPoint imageOrigin = NSMakePoint(0, 0); - NSRulerMarker *marker = - [[[NSRulerMarker alloc] initWithRulerView: ruler - markerLocation: location - image: image - imageOrigin: imageOrigin] autorelease]; + NSRulerMarker *marker = [[[NSRulerMarker alloc] + initWithRulerView: ruler + markerLocation: location + image: image + imageOrigin: imageOrigin] autorelease]; return marker; } @@ -93,11 +93,11 @@ { NSImage *image = [NSImage imageNamed: @"NSRulerMarkerTab"]; NSPoint imageOrigin = NSMakePoint(0, 0); - NSRulerMarker *marker = - [[[NSRulerMarker alloc] initWithRulerView: ruler - markerLocation: location - image: image - imageOrigin: imageOrigin] autorelease]; + NSRulerMarker *marker = [[[NSRulerMarker alloc] + initWithRulerView: ruler + markerLocation: location + image: image + imageOrigin: imageOrigin] autorelease]; return marker; } @@ -106,11 +106,11 @@ { NSImage *image = [NSImage imageNamed: @"NSRulerMarkerTab"]; NSPoint imageOrigin = NSMakePoint(0, 0); - NSRulerMarker *marker = - [[[NSRulerMarker alloc] initWithRulerView: ruler - markerLocation: location - image: image - imageOrigin: imageOrigin] autorelease]; + NSRulerMarker *marker = [[[NSRulerMarker alloc] + initWithRulerView: ruler + markerLocation: location + image: image + imageOrigin: imageOrigin] autorelease]; return marker; } @@ -119,11 +119,11 @@ { NSImage *image = [NSImage imageNamed: @"NSRulerMarkerTab"]; NSPoint imageOrigin = NSMakePoint(0, 0); - NSRulerMarker *marker = - [[[NSRulerMarker alloc] initWithRulerView: ruler - markerLocation: location - image: image - imageOrigin: imageOrigin] autorelease]; + NSRulerMarker *marker = [[[NSRulerMarker alloc] + initWithRulerView: ruler + markerLocation: location + image: image + imageOrigin: imageOrigin] autorelease]; return marker; } @end diff --git a/AppKit/NSTextView.subproj/NSSecureLayoutManager.m b/AppKit/NSTextView.subproj/NSSecureLayoutManager.m index 752e6945..1d94c581 100644 --- a/AppKit/NSTextView.subproj/NSSecureLayoutManager.m +++ b/AppKit/NSTextView.subproj/NSSecureLayoutManager.m @@ -32,8 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSRange characterRange = [self characterRangeForGlyphRange: glyphRange actualGlyphRange: NULL]; NSDictionary *attributes = - [_textStorage attributesAtIndex: characterRange.location - effectiveRange: NULL]; + [_textStorage attributesAtIndex: characterRange.location + effectiveRange: NULL]; NSFont *font = NSFontAttributeInDictionary(attributes); unichar buffer[characterRange.length]; diff --git a/AppKit/NSTextView.subproj/NSSecureTextView.m b/AppKit/NSTextView.subproj/NSSecureTextView.m index bd31a939..1a7b4f24 100644 --- a/AppKit/NSTextView.subproj/NSSecureTextView.m +++ b/AppKit/NSTextView.subproj/NSSecureTextView.m @@ -27,7 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithFrame: (NSRect) frame { NSLayoutManager *removeManager; NSSecureLayoutManager *secureManager = - [[NSSecureLayoutManager new] autorelease]; + [[NSSecureLayoutManager new] autorelease]; [super initWithFrame: frame]; diff --git a/AppKit/NSTextView.subproj/NSTextContainer.m b/AppKit/NSTextView.subproj/NSTextContainer.m index c7472523..1a063221 100644 --- a/AppKit/NSTextView.subproj/NSTextContainer.m +++ b/AppKit/NSTextView.subproj/NSTextContainer.m @@ -102,9 +102,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_heightTracksTextView || _widthTracksTextView) { if (_textView) { [[NSNotificationCenter defaultCenter] - removeObserver: self - name: NSViewFrameDidChangeNotification - object: _textView]; + removeObserver: self + name: NSViewFrameDidChangeNotification + object: _textView]; } } _textView = textView; @@ -113,10 +113,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_textView) { [_textView setPostsFrameChangedNotifications: YES]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(_textViewFrameDidChange:) - name: NSViewFrameDidChangeNotification - object: _textView]; + addObserver: self + selector: @selector(_textViewFrameDidChange:) + name: NSViewFrameDidChangeNotification + object: _textView]; } } } @@ -144,17 +144,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Observe our textView frame changes [_textView setPostsFrameChangedNotifications: YES]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(_textViewFrameDidChange:) - name: NSViewFrameDidChangeNotification - object: _textView]; + addObserver: self + selector: @selector(_textViewFrameDidChange:) + name: NSViewFrameDidChangeNotification + object: _textView]; } } else { if (_heightTracksTextView == NO) { [[NSNotificationCenter defaultCenter] - removeObserver: self - name: NSViewFrameDidChangeNotification - object: _textView]; + removeObserver: self + name: NSViewFrameDidChangeNotification + object: _textView]; } } } @@ -170,17 +170,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Observe our textView frame changes [_textView setPostsFrameChangedNotifications: YES]; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(_textViewFrameDidChange:) - name: NSViewFrameDidChangeNotification - object: _textView]; + addObserver: self + selector: @selector(_textViewFrameDidChange:) + name: NSViewFrameDidChangeNotification + object: _textView]; } } else { if (_widthTracksTextView == NO) { [[NSNotificationCenter defaultCenter] - removeObserver: self - name: NSViewFrameDidChangeNotification - object: _textView]; + removeObserver: self + name: NSViewFrameDidChangeNotification + object: _textView]; } } } diff --git a/AppKit/NSTextView.subproj/NSTextStorage.m b/AppKit/NSTextView.subproj/NSTextStorage.m index 77b58e8e..1de76c0e 100644 --- a/AppKit/NSTextView.subproj/NSTextStorage.m +++ b/AppKit/NSTextView.subproj/NSTextStorage.m @@ -24,9 +24,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSTextStorageWillProcessEditingNotification = - @"NSTextStorageWillProcessEditingNotification"; + @"NSTextStorageWillProcessEditingNotification"; NSString *const NSTextStorageDidProcessEditingNotification = - @"NSTextStorageDidProcessEditingNotification"; + @"NSTextStorageDidProcessEditingNotification"; @implementation NSTextStorage @@ -116,49 +116,50 @@ NSString *const NSTextStorageDidProcessEditingNotification = - (void) processEditing { int i, count; - if ([_delegate - respondsToSelector: @selector(textStorageWillProcessEditing:)]) { + if ([_delegate respondsToSelector: @selector + (textStorageWillProcessEditing:)]) { NSNotification *note = [NSNotification - notificationWithName: NSTextStorageWillProcessEditingNotification - object: self - userInfo: nil]; + notificationWithName: + NSTextStorageWillProcessEditingNotification + object: self + userInfo: nil]; [_delegate textStorageWillProcessEditing: note]; } [[NSNotificationCenter defaultCenter] - postNotificationName: NSTextStorageWillProcessEditingNotification - object: self]; + postNotificationName: NSTextStorageWillProcessEditingNotification + object: self]; [self fixAttributesInRange: _editedRange]; if ([_delegate - respondsToSelector: @selector(textStorageDidProcessEditing:)]) { + respondsToSelector: @selector(textStorageDidProcessEditing:)]) { NSNotification *note = [NSNotification - notificationWithName: NSTextStorageDidProcessEditingNotification - object: self - userInfo: nil]; + notificationWithName: NSTextStorageDidProcessEditingNotification + object: self + userInfo: nil]; [_delegate textStorageDidProcessEditing: note]; } [[NSNotificationCenter defaultCenter] - postNotificationName: NSTextStorageDidProcessEditingNotification - object: self]; + postNotificationName: NSTextStorageDidProcessEditingNotification + object: self]; count = [_layoutManagers count]; for (i = 0; i < count; i++) { NSLayoutManager *layout = [_layoutManagers objectAtIndex: i]; [layout textStorage: self - edited: [self editedMask] - range: [self editedRange] - changeInLength: [self changeInLength] - invalidatedRange: [self invalidatedRange]]; + edited: [self editedMask] + range: [self editedRange] + changeInLength: [self changeInLength] + invalidatedRange: [self invalidatedRange]]; } } - (void) edited: (unsigned) editedMask - range: (NSRange) range - changeInLength: (int) delta + range: (NSRange) range + changeInLength: (int) delta { if (_beginEditing == 0) { diff --git a/AppKit/NSTextView.subproj/NSTextStorage_concrete.m b/AppKit/NSTextView.subproj/NSTextStorage_concrete.m index 20a37e79..7de82b76 100644 --- a/AppKit/NSTextView.subproj/NSTextStorage_concrete.m +++ b/AppKit/NSTextView.subproj/NSTextStorage_concrete.m @@ -120,8 +120,10 @@ static inline void setAttributes(NSTextStorage_concrete *self, NSRangeEntriesVerify(self->_rangeToAttributes, [self length]); } -static inline void replaceCharactersInRangeWithAttributedString( - NSTextStorage_concrete *self, NSRange replaced, NSAttributedString *other) +static inline void +replaceCharactersInRangeWithAttributedString(NSTextStorage_concrete *self, + NSRange replaced, + NSAttributedString *other) { NSString *string = [other string]; unsigned location = 0; @@ -132,8 +134,8 @@ static inline void replaceCharactersInRangeWithAttributedString( NSRange effectiveRange; NSDictionary *attributes = [other attributesAtIndex: location effectiveRange: &effectiveRange]; - NSRange range = - NSMakeRange(replaced.location + location, effectiveRange.length); + NSRange range = NSMakeRange(replaced.location + location, + effectiveRange.length); setAttributes(self, attributes, range); @@ -147,8 +149,8 @@ static inline void replaceCharactersInRangeWithAttributedString( } [self edited: NSTextStorageEditedAttributes | NSTextStorageEditedCharacters - range: replaced - changeInLength: delta]; + range: replaced + changeInLength: delta]; } - (void) replaceCharactersInRange: (NSRange) range @@ -156,8 +158,8 @@ static inline void replaceCharactersInRangeWithAttributedString( { int delta = replaceCharactersInRangeWithString(self, range, string); [self edited: NSTextStorageEditedAttributes | NSTextStorageEditedCharacters - range: range - changeInLength: delta]; + range: range + changeInLength: delta]; } - (void) setAttributes: (NSDictionary *) attributes range: (NSRange) range { @@ -174,13 +176,13 @@ static inline void replaceCharactersInRangeWithAttributedString( - (void) setAttributedString: (NSAttributedString *) attributedString { [self beginEditing]; replaceCharactersInRangeWithAttributedString( - self, NSMakeRange(0, [self length]), attributedString); + self, NSMakeRange(0, [self length]), attributedString); [self endEditing]; } - (NSMutableString *) mutableString { - return - [[[NSClassFromString(@"NSMutableStringProxyForMutableAttributedString") + return [[[NSClassFromString( + @"NSMutableStringProxyForMutableAttributedString") allocWithZone: NULL] performSelector: @selector(initWithMutableAttributedString:) withObject: self] autorelease]; diff --git a/AppKit/NSTextView.subproj/NSTextTab.m b/AppKit/NSTextView.subproj/NSTextTab.m index 95478bc2..81722bba 100644 --- a/AppKit/NSTextView.subproj/NSTextTab.m +++ b/AppKit/NSTextView.subproj/NSTextTab.m @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *NSTabColumnTerminatorsAttributeName = - @"NSTabColumnTerminatorsAttributeName"; + @"NSTabColumnTerminatorsAttributeName"; @implementation NSTextTab diff --git a/AppKit/NSTextView.subproj/NSTextView.m b/AppKit/NSTextView.subproj/NSTextView.m index 2bc99e4e..c5a78045 100644 --- a/AppKit/NSTextView.subproj/NSTextView.m +++ b/AppKit/NSTextView.subproj/NSTextView.m @@ -57,7 +57,7 @@ #import "NSUndoTextOperation.h" NSString *const NSTextViewDidChangeSelectionNotification = - @"NSTextViewDidChangeSelectionNotification"; + @"NSTextViewDidChangeSelectionNotification"; NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; @interface NSLayoutManager (NSLayoutManager_visualKeyboardMovement) @@ -100,35 +100,39 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (menu == nil) { menu = [[NSMenu alloc] initWithTitle: @""]; - [menu - addItemWithTitle: NSLocalizedStringFromTableInBundle( - @"Cut", nil, - [NSBundle bundleForClass: [NSTextView class]], - @"Cut the selection") - action: @selector(cut:) - keyEquivalent: @""]; - [menu - addItemWithTitle: NSLocalizedStringFromTableInBundle( - @"Copy", nil, - [NSBundle bundleForClass: [NSTextView class]], - @"Copy the selection") - action: @selector(copy:) - keyEquivalent: @""]; - [menu - addItemWithTitle: NSLocalizedStringFromTableInBundle( - @"Paste", nil, - [NSBundle bundleForClass: [NSTextView class]], - @"Paste the selection") - action: @selector(paste:) - keyEquivalent: @""]; + [menu addItemWithTitle: NSLocalizedStringFromTableInBundle( + @"Cut", nil, + [NSBundle + bundleForClass: [NSTextView + class]], + @"Cut the selection") + action: @selector(cut:) + keyEquivalent: @""]; + [menu addItemWithTitle: NSLocalizedStringFromTableInBundle( + @"Copy", nil, + [NSBundle + bundleForClass: [NSTextView + class]], + @"Copy the selection") + action: @selector(copy:) + keyEquivalent: @""]; + [menu addItemWithTitle: NSLocalizedStringFromTableInBundle( + @"Paste", nil, + [NSBundle + bundleForClass: [NSTextView + class]], + @"Paste the selection") + action: @selector(paste:) + keyEquivalent: @""]; [menu addItem: [NSMenuItem separatorItem]]; - [menu - addItemWithTitle: NSLocalizedStringFromTableInBundle( - @"Select All", nil, - [NSBundle bundleForClass: [NSTextView class]], - @"Select all the content") - action: @selector(selectAll:) - keyEquivalent: @""]; + [menu addItemWithTitle: NSLocalizedStringFromTableInBundle( + @"Select All", nil, + [NSBundle + bundleForClass: [NSTextView + class]], + @"Select all the content") + action: @selector(selectAll:) + keyEquivalent: @""]; } [self setMenu: menu]; } @@ -144,10 +148,10 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; NSKeyedUnarchiver *keyed = (NSKeyedUnarchiver *) coder; unsigned flags = [keyed decodeIntForKey: @"NSTVFlags"]; NSTextViewSharedData *sharedData = - [keyed decodeObjectForKey: @"NSSharedData"]; + [keyed decodeObjectForKey: @"NSSharedData"]; _textContainer = - [[keyed decodeObjectForKey: @"NSTextContainer"] retain]; + [[keyed decodeObjectForKey: @"NSTextContainer"] retain]; _textContainerInset = NSMakeSize(4, 4); _textStorage = [[[_textContainer layoutManager] textStorage] retain]; @@ -180,28 +184,28 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; _selectedRanges = [[NSMutableArray alloc] init]; [_selectedRanges - addObject: [NSValue valueWithRange: NSMakeRange(0, 0)]]; + addObject: [NSValue valueWithRange: NSMakeRange(0, 0)]]; _rangeForUserCompletion = NSMakeRange(NSNotFound, 0); _selectedTextAttributes = [[NSDictionary - dictionaryWithObjectsAndKeys: [NSColor selectedTextColor], - NSForegroundColorAttributeName, - [NSColor selectedTextBackgroundColor], - NSBackgroundColorAttributeName, nil] - retain]; + dictionaryWithObjectsAndKeys: + [NSColor selectedTextColor], + NSForegroundColorAttributeName, + [NSColor selectedTextBackgroundColor], + NSBackgroundColorAttributeName, nil] retain]; [_textStorage - addAttribute: NSFontAttributeName - value: _font - range: NSMakeRange(0, [[self textStorage] length])]; + addAttribute: NSFontAttributeName + value: _font + range: NSMakeRange(0, [[self textStorage] length])]; [_textStorage - addAttribute: NSForegroundColorAttributeName - value: _textColor - range: NSMakeRange(0, [[self textStorage] length])]; + addAttribute: NSForegroundColorAttributeName + value: _textColor + range: NSMakeRange(0, [[self textStorage] length])]; NSMutableDictionary *typingAttributes = - [[_textStorage attributesAtIndex: 0 - effectiveRange: NULL] mutableCopy]; + [[_textStorage attributesAtIndex: 0 + effectiveRange: NULL] mutableCopy]; if (![typingAttributes objectForKey: NSFontAttributeName]) { [typingAttributes setObject: _font forKey: NSFontAttributeName]; } @@ -213,20 +217,20 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if ([typingAttributes objectForKey: NSParagraphStyleAttributeName]) { _defaultParagraphStyle = [[typingAttributes - objectForKey: NSParagraphStyleAttributeName] copy]; + objectForKey: NSParagraphStyleAttributeName] copy]; } else { _defaultParagraphStyle = - [[NSParagraphStyle defaultParagraphStyle] copy]; + [[NSParagraphStyle defaultParagraphStyle] copy]; } } else { [NSException raise: NSInvalidArgumentException format: @"-[%@ %s] is not implemented for coder %@", [self class], sel_getName(_cmd), coder]; } - [self - registerForDraggedTypes: [NSArray arrayWithObjects: NSRTFPboardType, - NSStringPboardType, - nil]]; + [self registerForDraggedTypes: [NSArray + arrayWithObjects: NSRTFPboardType, + NSStringPboardType, + nil]]; return self; } @@ -258,7 +262,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; [_selectedRanges addObject: [NSValue valueWithRange: NSMakeRange(0, 0)]]; NSMutableDictionary *typingAttributes = - [[_textStorage attributesAtIndex: 0 effectiveRange: NULL] mutableCopy]; + [[_textStorage attributesAtIndex: 0 + effectiveRange: NULL] mutableCopy]; if (![typingAttributes objectForKey: NSFontAttributeName]) { [typingAttributes setObject: _font forKey: NSFontAttributeName]; } @@ -270,27 +275,27 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if ([typingAttributes objectForKey: NSParagraphStyleAttributeName]) { _defaultParagraphStyle = [[typingAttributes - objectForKey: NSParagraphStyleAttributeName] copy]; + objectForKey: NSParagraphStyleAttributeName] copy]; } else { _defaultParagraphStyle = - [[NSParagraphStyle defaultParagraphStyle] copy]; + [[NSParagraphStyle defaultParagraphStyle] copy]; } _rangeForUserCompletion = NSMakeRange(NSNotFound, 0); _selectedTextAttributes = [[NSDictionary - dictionaryWithObjectsAndKeys: [NSColor selectedTextColor], - NSForegroundColorAttributeName, - [NSColor selectedTextBackgroundColor], - NSBackgroundColorAttributeName, nil] - retain]; + dictionaryWithObjectsAndKeys: [NSColor selectedTextColor], + NSForegroundColorAttributeName, + [NSColor selectedTextBackgroundColor], + NSBackgroundColorAttributeName, nil] + retain]; [self setBoundsOrigin: NSMakePoint(-_textContainerInset.width, -_textContainerInset.height)]; [self configureMenu]; - [self - registerForDraggedTypes: [NSArray arrayWithObjects: NSRTFPboardType, - NSStringPboardType, - nil]]; + [self registerForDraggedTypes: [NSArray + arrayWithObjects: NSRTFPboardType, + NSStringPboardType, + nil]]; return self; } @@ -299,7 +304,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; NSTextStorage *storage = [[NSTextStorage new] autorelease]; NSLayoutManager *layout = [[NSLayoutManager new] autorelease]; NSTextContainer *container = [[[NSTextContainer alloc] - initWithContainerSize: frame.size] autorelease]; + initWithContainerSize: frame.size] autorelease]; [storage addLayoutManager: layout]; [layout addTextContainer: container]; @@ -514,7 +519,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; stillSelecting: (BOOL) stillSelecting { NSArray *ranges = - [NSArray arrayWithObject: [NSValue valueWithRange: range]]; + [NSArray arrayWithObject: [NSValue valueWithRange: range]]; [self setSelectedRanges: ranges affinity: affinity @@ -526,9 +531,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; stillSelecting: (BOOL) stillSelecting { if ([ranges count] == 0) - [NSException - raise: NSInvalidArgumentException - format: @"-[%@ %s] ranges should not be empty", [self class], _cmd]; + [NSException raise: NSInvalidArgumentException + format: @"-[%@ %s] ranges should not be empty", + [self class], _cmd]; // Save the initial selected ranges so we can use it when we're done with // the selection change @@ -564,20 +569,20 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; // Tell the world the selection changed when the selection change is done if (!stillSelecting) { [[NSNotificationCenter defaultCenter] - postNotificationName: NSTextViewDidChangeSelectionNotification - object: self - userInfo: - [NSDictionary - dictionaryWithObject: [oldRanges - objectAtIndex: 0] - forKey: - NSOldSelectedCharacterRange]]; + postNotificationName: NSTextViewDidChangeSelectionNotification + object: self + userInfo: + [NSDictionary + dictionaryWithObject: + [oldRanges objectAtIndex: 0] + forKey: NSOldSelectedCharacterRange]]; } if (!_isContinuousSpellCheckingEnabled) [[self layoutManager] - removeTemporaryAttribute: NSSpellingStateAttributeName - forCharacterRange: NSMakeRange(0, [[self string] length])]; + removeTemporaryAttribute: NSSpellingStateAttributeName + forCharacterRange: NSMakeRange(0, + [[self string] length])]; } - (void) setSelectedRanges: (NSArray *) ranges { @@ -606,9 +611,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; NSArray *result; // replace this with a real completion list source... NSArray *source = [NSArray - arrayWithObjects: @"selector", @"Class", @"Classic", @"object", - @"objects d'art", @"objection", @"objectivism", - @"objective-c", @"NSString", nil]; + arrayWithObjects: @"selector", @"Class", @"Classic", @"object", + @"objects d'art", @"objection", @"objectivism", + @"objective-c", @"NSString", nil]; NSMutableArray *completions = [NSMutableArray new]; NSString *string = [[_textStorage string] substringWithRange: range]; NSInteger i, count = [source count]; @@ -627,9 +632,10 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; result = completions; - if ([_delegate respondsToSelector: @selector - (textView: - completions:forPartialWordRange:indexOfSelectedItem:)]) + if ([_delegate + respondsToSelector: @selector + (textView: + completions:forPartialWordRange:indexOfSelectedItem:)]) result = [_delegate textView: self completions: result forPartialWordRange: range @@ -639,9 +645,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } - (void) insertCompletion: (NSString *) string - forPartialWordRange: (NSRange) range - movement: (NSInteger) movement - isFinal: (BOOL) isFinal + forPartialWordRange: (NSRange) range + movement: (NSInteger) movement + isFinal: (BOOL) isFinal { [self _replaceCharactersInRange: range withString: string]; @@ -655,8 +661,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; // selected. if (movement == NSReturnTextMovement || movement == NSOtherTextMovement) { - [self setSelectedRange: NSMakeRange( - range.location + [string length], 0)]; + [self setSelectedRange: NSMakeRange(range.location + + [string length], + 0)]; [self endUserCompletion]; } else if (movement == NSCancelTextMovement) [self endUserCompletion]; @@ -671,9 +678,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; type: (NSString *) type { if ([type isEqualToString: NSStringPboardType]) { - [pasteboard - setString: [[self string] substringWithRange: [self selectedRange]] - forType: type]; + [pasteboard setString: [[self string] + substringWithRange: [self selectedRange]] + forType: type]; return YES; } else if ([type isEqualToString: NSRTFPboardType]) { NSData *rtfdata = [[self textStorage] RTFFromRange: [self selectedRange] @@ -737,8 +744,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) didChangeText { [[NSNotificationCenter defaultCenter] - postNotificationName: NSTextDidChangeNotification - object: self]; + postNotificationName: NSTextDidChangeNotification + object: self]; } - (BOOL) shouldDrawInsertionPoint { @@ -788,8 +795,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; glyphRange.length = 1; } else { glyphRange = - [layoutManager glyphRangeForBoundingRect: glyphRect - inTextContainer: [self textContainer]]; + [layoutManager glyphRangeForBoundingRect: glyphRect + inTextContainer: [self textContainer]]; } [layoutManager drawBackgroundForGlyphRange: glyphRange atPoint: origin]; [layoutManager drawGlyphsForGlyphRange: glyphRange atPoint: origin]; @@ -811,12 +818,12 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; NSUInteger rectCount = 0; // Get the last used fragment rect range = NSMakeRange([_textStorage length] - 1, 1); - range = - [[self layoutManager] glyphRangeForCharacterRange: range - actualCharacterRange: NULL]; + range = [[self layoutManager] + glyphRangeForCharacterRange: range + actualCharacterRange: NULL]; result = [[self layoutManager] - lineFragmentUsedRectForGlyphAtIndex: range.location - effectiveRange: NULL]; + lineFragmentUsedRectForGlyphAtIndex: range.location + effectiveRange: NULL]; // Check the direction for that location uint8_t level; @@ -838,10 +845,10 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } else { NSUInteger rectCount = 0; NSRect *rectArray = [[self layoutManager] - rectArrayForCharacterRange: range - withinSelectedCharacterRange: range - inTextContainer: [self textContainer] - rectCount: &rectCount]; + rectArrayForCharacterRange: range + withinSelectedCharacterRange: range + inTextContainer: [self textContainer] + rectCount: &rectCount]; result = rectArray[0]; } result.size.width = 1; @@ -850,12 +857,12 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; result = [[self layoutManager] extraLineFragmentRect]; } else { NSRange glyphRange = - [[self layoutManager] glyphRangeForCharacterRange: range - actualCharacterRange: NULL]; + [[self layoutManager] glyphRangeForCharacterRange: range + actualCharacterRange: NULL]; result = [[self layoutManager] - boundingRectForGlyphRange: glyphRange - inTextContainer: [self textContainer]]; + boundingRectForGlyphRange: glyphRange + inTextContainer: [self textContainer]]; } } @@ -888,7 +895,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; _insertionPointRect = NSZeroRect; else _insertionPointRect = - [self _viewRectForCharacterRange: [self selectedRange]]; + [self _viewRectForCharacterRange: [self selectedRange]]; if (restartFlag) { CGFloat interval = [[NSDisplay currentDisplay] textCaretBlinkInterval]; @@ -899,12 +906,12 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; _insertionPointTimer = nil; _insertionPointTimer = - [[NSTimer scheduledTimerWithTimeInterval: interval - target: self - selector: @selector - (_insertionPointTimerFired:) - userInfo: nil - repeats: YES] retain]; + [[NSTimer scheduledTimerWithTimeInterval: interval + target: self + selector: @selector + (_insertionPointTimerFired:) + userInfo: nil + repeats: YES] retain]; [[NSRunLoop currentRunLoop] addTimer: _insertionPointTimer forMode: NSModalPanelRunLoopMode]; } @@ -919,7 +926,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; NSDictionary *typingAttributes = [self typingAttributes]; NSParagraphStyle *style = - [typingAttributes objectForKey: NSParagraphStyleAttributeName]; + [typingAttributes objectForKey: NSParagraphStyleAttributeName]; if (style == nil) { // This should be the NSTextView defaultParagraphStyle but it's not // supported yet in Cocoton @@ -927,9 +934,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } NSArray *markers = - [[self layoutManager] rulerMarkersForTextView: self - paragraphStyle: style - ruler: ruler]; + [[self layoutManager] rulerMarkersForTextView: self + paragraphStyle: style + ruler: ruler]; [ruler setMarkers: markers]; } } @@ -963,8 +970,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; NSData *data = [pboard dataForType: NSRTFPboardType]; if (data && data.length > 0) { string = - [[[NSAttributedString alloc] initWithRTF: data - documentAttributes: nil] autorelease]; + [[[NSAttributedString alloc] initWithRTF: data + documentAttributes: nil] autorelease]; } } if (string == nil) { @@ -996,14 +1003,14 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; [_insertionPointTimer release]; _insertionPointTimer = nil; - NSDictionary *userInfo = - [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: movement] - forKey: @"NSTextMovement"]; + NSDictionary *userInfo = [NSDictionary + dictionaryWithObject: [NSNumber numberWithInt: movement] + forKey: @"NSTextMovement"]; - NSNotification *note = - [NSNotification notificationWithName: NSTextDidEndEditingNotification - object: self - userInfo: userInfo]; + NSNotification *note = [NSNotification + notificationWithName: NSTextDidEndEditingNotification + object: self + userInfo: userInfo]; _didSendTextDidEndNotification = YES; @@ -1023,11 +1030,12 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (_userCompletionSelectedItem >= [_userCompletions count]) _userCompletionSelectedItem = 0; - [self insertCompletion: [_userCompletions - objectAtIndex: _userCompletionSelectedItem] - forPartialWordRange: _rangeForUserCompletion - movement: NSTabTextMovement - isFinal: NO]; + [self insertCompletion: + [_userCompletions + objectAtIndex: _userCompletionSelectedItem] + forPartialWordRange: _rangeForUserCompletion + movement: NSTabTextMovement + isFinal: NO]; return; } @@ -1051,11 +1059,12 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } if (_rangeForUserCompletion.location != NSNotFound) { - [self insertCompletion: [_userCompletions - objectAtIndex: _userCompletionSelectedItem] - forPartialWordRange: _rangeForUserCompletion - movement: NSReturnTextMovement - isFinal: YES]; + [self insertCompletion: + [_userCompletions + objectAtIndex: _userCompletionSelectedItem] + forPartialWordRange: _rangeForUserCompletion + movement: NSReturnTextMovement + isFinal: YES]; return; } @@ -1069,9 +1078,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) cancel: sender { if (_rangeForUserCompletion.location != NSNotFound) { [self insertCompletion: _userCompletionHint - forPartialWordRange: _rangeForUserCompletion - movement: NSCancelTextMovement - isFinal: YES]; + forPartialWordRange: _rangeForUserCompletion + movement: NSCancelTextMovement + isFinal: YES]; return; } } @@ -1170,11 +1179,12 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (_userCompletionSelectedItem < [_userCompletions count] - 1) _userCompletionSelectedItem++; - [self insertCompletion: [_userCompletions - objectAtIndex: _userCompletionSelectedItem] - forPartialWordRange: _rangeForUserCompletion - movement: NSDownTextMovement - isFinal: NO]; + [self insertCompletion: + [_userCompletions + objectAtIndex: _userCompletionSelectedItem] + forPartialWordRange: _rangeForUserCompletion + movement: NSDownTextMovement + isFinal: NO]; return; } @@ -1182,14 +1192,14 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; range.length = 0; if (range.location < length) { NSRange line = [[self layoutManager] - _softLineRangeForCharacterAtIndex: range.location]; + _softLineRangeForCharacterAtIndex: range.location]; NSUInteger max = NSMaxRange(line); if (max >= length) range.location = length; else { NSRange nextLine = [[self layoutManager] - _softLineRangeForCharacterAtIndex: max + 1]; + _softLineRangeForCharacterAtIndex: max + 1]; NSUInteger offset = range.location - line.location; range.location = nextLine.location + offset; @@ -1211,14 +1221,14 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (delta < length) { NSRange line = - [[self layoutManager] _softLineRangeForCharacterAtIndex: delta]; + [[self layoutManager] _softLineRangeForCharacterAtIndex: delta]; NSUInteger max = NSMaxRange(line); if (max >= length) delta = length; else { NSRange nextLine = [[self layoutManager] - _softLineRangeForCharacterAtIndex: max + 1]; + _softLineRangeForCharacterAtIndex: max + 1]; NSUInteger offset = delta - line.location; delta = nextLine.location + offset; @@ -1251,11 +1261,12 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (_userCompletionSelectedItem > 0) _userCompletionSelectedItem--; - [self insertCompletion: [_userCompletions - objectAtIndex: _userCompletionSelectedItem] - forPartialWordRange: _rangeForUserCompletion - movement: NSUpTextMovement - isFinal: NO]; + [self insertCompletion: + [_userCompletions + objectAtIndex: _userCompletionSelectedItem] + forPartialWordRange: _rangeForUserCompletion + movement: NSUpTextMovement + isFinal: NO]; return; } @@ -1263,11 +1274,11 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (range.location <= length) { NSRange line = [[self layoutManager] - _softLineRangeForCharacterAtIndex: range.location]; + _softLineRangeForCharacterAtIndex: range.location]; if (line.location > 0) { NSRange prevLine = [[self layoutManager] - _softLineRangeForCharacterAtIndex: line.location - 1]; + _softLineRangeForCharacterAtIndex: line.location - 1]; NSUInteger offset = range.location - line.location; range.location = prevLine.location + offset; @@ -1293,11 +1304,11 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (delta <= length) { NSRange line = - [[self layoutManager] _softLineRangeForCharacterAtIndex: delta]; + [[self layoutManager] _softLineRangeForCharacterAtIndex: delta]; if (line.location > 0) { NSRange prevLine = [[self layoutManager] - _softLineRangeForCharacterAtIndex: line.location - 1]; + _softLineRangeForCharacterAtIndex: line.location - 1]; NSUInteger offset = delta - line.location; delta = prevLine.location + offset; @@ -1340,16 +1351,16 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; location = length - 1; } NSRange paragraphRange = - [string paragraphRangeForRange: NSMakeRange(location, 1)]; + [string paragraphRangeForRange: NSMakeRange(location, 1)]; // Check the direction for that location uint8_t level; [[self layoutManager] - getGlyphsInRange: NSMakeRange(paragraphRange.location, 1) - glyphs: NULL - characterIndexes: NULL - glyphInscriptions: NULL - elasticBits: NULL - bidiLevels: &level]; + getGlyphsInRange: NSMakeRange(paragraphRange.location, 1) + glyphs: NULL + characterIndexes: NULL + glyphInscriptions: NULL + elasticBits: NULL + bidiLevels: &level]; leftToRight = (level & 1) == 0; } return leftToRight; @@ -1536,9 +1547,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } else { if (range.location > 0) { range.location--; - if (![self - _delegateChangeTextInRange: NSMakeRange(range.location, 1) - replacementString: @""]) + if (![self _delegateChangeTextInRange: NSMakeRange(range.location, + 1) + replacementString: @""]) return; [self _replaceCharactersInRange: NSMakeRange(range.location, 1) @@ -1576,7 +1587,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) deleteToBeginningOfLine: sender { NSRange range = [self selectedRange]; NSRange lineRange = [[self layoutManager] - _softLineRangeForCharacterAtIndex: NSMaxRange(range)]; + _softLineRangeForCharacterAtIndex: NSMaxRange(range)]; NSUInteger delta = range.location - lineRange.location; if (range.length == 0) { @@ -1588,7 +1599,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; return; [self _appendStringToKillBuffer: [[_textStorage string] - substringWithRange: range]]; + substringWithRange: range]]; [self _replaceCharactersInRange: range withString: @""]; [self didChangeText]; } @@ -1596,7 +1607,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) deleteToEndOfLine: sender { NSRange range = [self selectedRange]; NSRange lineRange = [[self layoutManager] - _softLineRangeForCharacterAtIndex: NSMaxRange(range)]; + _softLineRangeForCharacterAtIndex: NSMaxRange(range)]; NSUInteger delta = NSMaxRange(lineRange) - NSMaxRange(range); if (range.length == @@ -1607,7 +1618,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; return; [self _appendStringToKillBuffer: [[_textStorage string] - substringWithRange: range]]; + substringWithRange: range]]; [self _replaceCharactersInRange: range withString: @""]; [self didChangeText]; } @@ -1627,7 +1638,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; return; [self _appendStringToKillBuffer: [[_textStorage string] - substringWithRange: range]]; + substringWithRange: range]]; [self _replaceCharactersInRange: range withString: @""]; [self didChangeText]; } @@ -1648,7 +1659,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; return; [self _appendStringToKillBuffer: [[_textStorage string] - substringWithRange: range]]; + substringWithRange: range]]; [self _replaceCharactersInRange: range withString: @""]; [self didChangeText]; } @@ -1713,7 +1724,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) moveToBeginningOfLine: sender { NSLayoutManager *layoutManager = [self layoutManager]; NSRange range = [layoutManager - _softLineRangeForCharacterAtIndex: [self selectedRange].location]; + _softLineRangeForCharacterAtIndex: [self selectedRange].location]; [self _setAndScrollToRange: NSMakeRange(range.location, 0)]; } @@ -1752,7 +1763,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) moveToEndOfLine: sender { NSLayoutManager *layoutManager = [self layoutManager]; NSRange range = [layoutManager - _softLineRangeForCharacterAtIndex: [self selectedRange].location]; + _softLineRangeForCharacterAtIndex: [self selectedRange].location]; [self _setAndScrollToRange: NSMakeRange(NSMaxRange(range), 0)]; } @@ -1808,12 +1819,12 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; NSUInteger delta = 0; lineRange = [[_textStorage string] - lineRangeForRange: NSMakeRange(range.location, 0)]; + lineRangeForRange: NSMakeRange(range.location, 0)]; // ugh. newlines screw up the lineRangeForRange calculation. if (lineRange.location == range.location && range.location > 0) lineRange = [[_textStorage string] - lineRangeForRange: NSMakeRange(range.location - 1, 0)]; + lineRangeForRange: NSMakeRange(range.location - 1, 0)]; delta = range.location - lineRange.location; @@ -1821,7 +1832,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; range.length += delta; } else { NSRange lineRange = [[_textStorage string] - lineRangeForRange: NSMakeRange(NSMaxRange(range) - 1, 0)]; + lineRangeForRange: NSMakeRange(NSMaxRange(range) - 1, 0)]; NSUInteger delta = NSMaxRange(range) - lineRange.location; if (delta < range.length) @@ -1852,13 +1863,13 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (downstream) { NSRange lineRange = [[_textStorage string] - lineRangeForRange: NSMakeRange(NSMaxRange(range), 0)]; + lineRangeForRange: NSMakeRange(NSMaxRange(range), 0)]; NSUInteger delta = NSMaxRange(lineRange) - NSMaxRange(range); range.length += delta; } else { NSRange lineRange = [[_textStorage string] - lineRangeForRange: NSMakeRange(range.location, 0)]; + lineRangeForRange: NSMakeRange(range.location, 0)]; NSUInteger delta = NSMaxRange(lineRange) - range.location; if (delta < range.length) { @@ -1890,7 +1901,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } - (NSUInteger) glyphIndexForPoint: (NSPoint) point - fractionOfDistanceThroughGlyph: (CGFloat *) fraction + fractionOfDistanceThroughGlyph: (CGFloat *) fraction { point.x -= _textContainerInset.width; point.y -= _textContainerInset.height; @@ -1909,8 +1920,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; rect = [self visibleRect]; range.location = - [self glyphIndexForPoint: NSMakePoint(NSMinX(rect), NSMinY(rect)) - fractionOfDistanceThroughGlyph: &fraction]; + [self glyphIndexForPoint: NSMakePoint(NSMinX(rect), NSMinY(rect)) + fractionOfDistanceThroughGlyph: &fraction]; range.length = 0; [self _setAndScrollToRange: range]; @@ -1927,7 +1938,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; rect = [self visibleRect]; location = [self glyphIndexForPoint: NSMakePoint(NSMinX(rect), NSMinY(rect)) - fractionOfDistanceThroughGlyph: &fraction]; + fractionOfDistanceThroughGlyph: &fraction]; upstream = (NSMaxRange(range) <= _selectionOrigin); if (upstream) { @@ -1965,8 +1976,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; rect = [self visibleRect]; range.location = - [self glyphIndexForPoint: NSMakePoint(NSMinX(rect), NSMaxY(rect)) - fractionOfDistanceThroughGlyph: &fraction]; + [self glyphIndexForPoint: NSMakePoint(NSMinX(rect), NSMaxY(rect)) + fractionOfDistanceThroughGlyph: &fraction]; if (range.location == 0) range.location = [string length]; range.length = 0; @@ -1985,7 +1996,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; rect = [self visibleRect]; location = [self glyphIndexForPoint: NSMakePoint(NSMinX(rect), NSMaxY(rect)) - fractionOfDistanceThroughGlyph: &fraction]; + fractionOfDistanceThroughGlyph: &fraction]; downstream = (range.location >= _selectionOrigin); if (downstream) { @@ -2022,9 +2033,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; NSString *transposed = [b stringByAppendingString: a]; - if (![self - _delegateChangeTextInRange: NSMakeRange(range.location - 1, 2) - replacementString: transposed]) + if (![self _delegateChangeTextInRange: NSMakeRange(range.location - 1, + 2) + replacementString: transposed]) return; [self _replaceCharactersInRange: NSMakeRange(range.location - 1, 2) @@ -2047,7 +2058,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; return; if ([[NSCharacterSet whitespaceCharacterSet] - characterIsMember: [string characterAtIndex: range.location]] == NO) + characterIsMember: [string characterAtIndex: range.location]] == + NO) return; space = [string substringWithRange: NSMakeRange(range.location, 1)]; @@ -2068,9 +2080,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; [self replaceCharactersInRange: NSMakeRange(previousWord, 0) withString: b]; [self replaceCharactersInRange: NSMakeRange(previousWord + [b length], 0) withString: space]; - [self - replaceCharactersInRange: NSMakeRange(previousWord + [b length] + 1, 0) - withString: a]; + [self replaceCharactersInRange: NSMakeRange(previousWord + [b length] + 1, + 0) + withString: a]; [self _setAndScrollToRange: NSMakeRange(nextWord + 1, 0)]; } @@ -2084,10 +2096,11 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; _rangeForUserCompletion = [self rangeForUserCompletion]; _userCompletionHint = [[[_textStorage string] - substringWithRange: _rangeForUserCompletion] retain]; - _userCompletions = [[self - completionsForPartialWordRange: _rangeForUserCompletion - indexOfSelectedItem: &_userCompletionSelectedItem] retain]; + substringWithRange: _rangeForUserCompletion] retain]; + _userCompletions = + [[self completionsForPartialWordRange: _rangeForUserCompletion + indexOfSelectedItem: &_userCompletionSelectedItem] + retain]; if ([_userCompletions count] == 0) { [self endUserCompletion]; @@ -2098,10 +2111,10 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; // Hmm, what should be the initial text movement for the completion editor? // Docs are unclear [self insertCompletion: [_userCompletions - objectAtIndex: _userCompletionSelectedItem] - forPartialWordRange: _rangeForUserCompletion - movement: NSOtherTextMovement - isFinal: NO]; + objectAtIndex: _userCompletionSelectedItem] + forPartialWordRange: _rangeForUserCompletion + movement: NSOtherTextMovement + isFinal: NO]; } - (void) endUserCompletion { @@ -2123,14 +2136,16 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if ([sender isKindOfClass: [NSMenuItem class]]) { if (flag) { [sender setTitle: NSLocalizedStringFromTableInBundle( - @"Hide Ruler", nil, - [NSBundle bundleForClass: [NSTextView class]], - @"Hide the page ruler")]; + @"Hide Ruler", nil, + [NSBundle bundleForClass: [NSTextView + class]], + @"Hide the page ruler")]; } else { [sender setTitle: NSLocalizedStringFromTableInBundle( - @"Show Ruler", nil, - [NSBundle bundleForClass: [NSTextView class]], - @"Show the page ruler")]; + @"Show Ruler", nil, + [NSBundle bundleForClass: [NSTextView + class]], + @"Show the page ruler")]; } } } @@ -2231,12 +2246,13 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; SEL selector; NSString *name; } notes[] = { - {@selector(textDidBeginEditing:), NSTextDidBeginEditingNotification}, - {@selector(textDidEndEditing:), NSTextDidEndEditingNotification}, - {@selector(textDidChange:), NSTextDidChangeNotification}, - {@selector(textViewDidChangeSelection:), - NSTextViewDidChangeSelectionNotification}, - {NULL, nil}}; + {@selector(textDidBeginEditing:), + NSTextDidBeginEditingNotification}, + {@selector(textDidEndEditing:), NSTextDidEndEditingNotification}, + {@selector(textDidChange:), NSTextDidChangeNotification}, + {@selector(textViewDidChangeSelection:), + NSTextViewDidChangeSelectionNotification}, + {NULL, nil}}; int i; if (_delegate != nil) @@ -2284,7 +2300,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; atIndex: selectedRange.location effectiveRange: &effectiveRange]; BOOL isMultiple = - NSMaxRange(effectiveRange) < NSMaxRange(selectedRange); + NSMaxRange(effectiveRange) < NSMaxRange(selectedRange); if (font) { [[NSFontManager sharedFontManager] setSelectedFont: font isMultiple: isMultiple]; @@ -2296,12 +2312,13 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) _updateTypingAttributes { if (_isRichText == NO) { NSMutableParagraphStyle *style = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] - autorelease]; + [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] + autorelease]; [style setAlignment: _textAlignment]; NSDictionary *attributes = [NSDictionary - dictionaryWithObjectsAndKeys: _font, NSFontAttributeName, style, - NSParagraphStyleAttributeName, nil]; + dictionaryWithObjectsAndKeys: _font, NSFontAttributeName, style, + NSParagraphStyleAttributeName, + nil]; if (attributes && [attributes isEqualToDictionary: [self typingAttributes]] == NO) { [self setTypingAttributes: attributes]; @@ -2330,11 +2347,11 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } if (min >= 0 && min < length) { NSDictionary *attributes = - [[self textStorage] attributesAtIndex: min - effectiveRange: NULL]; + [[self textStorage] attributesAtIndex: min + effectiveRange: NULL]; if (attributes && [attributes isEqualToDictionary: [self typingAttributes]] == - NO) { + NO) { [self setTypingAttributes: attributes]; } } @@ -2358,11 +2375,11 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; [self breakUndoCoalescing]; NSUndoSetAttributes *undoSetAttributes = [[[NSUndoSetAttributes alloc] - initWithAffectedRange: range - layoutManager: self.layoutManager - undoManager: self.undoManager] autorelease]; + initWithAffectedRange: range + layoutManager: self.layoutManager + undoManager: self.undoManager] autorelease]; [[self.undoManager prepareWithInvocationTarget: undoSetAttributes] - undoRedo: self.textStorage]; + undoRedo: self.textStorage]; } [[self textStorage] addAttributes: attributes range: range]; } @@ -2382,11 +2399,11 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; [self breakUndoCoalescing]; NSUndoSetAttributes *undoSetAttributes = [[[NSUndoSetAttributes alloc] - initWithAffectedRange: range - layoutManager: self.layoutManager - undoManager: self.undoManager] autorelease]; + initWithAffectedRange: range + layoutManager: self.layoutManager + undoManager: self.undoManager] autorelease]; [[self.undoManager prepareWithInvocationTarget: undoSetAttributes] - undoRedo: self.textStorage]; + undoRedo: self.textStorage]; } [[self textStorage] removeAttribute: key range: range]; } @@ -2413,8 +2430,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (_firstResponderButNotEditingYet) { [[NSNotificationCenter defaultCenter] - postNotificationName: NSTextDidBeginEditingNotification - object: self]; + postNotificationName: NSTextDidBeginEditingNotification + object: self]; _firstResponderButNotEditingYet = NO; } @@ -2423,36 +2440,36 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (_undoTyping) { // Try first to coaelesce with current undo typing object if ([_undoTyping - coalesceAffectedRange: range - replacementRange: NSMakeRange(range.location, - [string length]) - selectedRange: [self selectedRange] - text: _textStorage] == NO) { + coalesceAffectedRange: range + replacementRange: NSMakeRange(range.location, + [string length]) + selectedRange: [self selectedRange] + text: _textStorage] == NO) { [self breakUndoCoalescing]; } } if (_undoTyping == nil) { _undoTyping = [[NSUndoTyping alloc] - initWithAffectedRange: range - layoutManager: self.layoutManager - undoManager: self.undoManager - replacementRange: NSMakeRange(range.location, - [string length])]; + initWithAffectedRange: range + layoutManager: self.layoutManager + undoManager: self.undoManager + replacementRange: NSMakeRange(range.location, + [string length])]; [[self.undoManager prepareWithInvocationTarget: _undoTyping] - undoRedo: self.textStorage]; + undoRedo: self.textStorage]; } } else { [self breakUndoCoalescing]; NSUndoReplaceCharacters *replace = [[[NSUndoReplaceCharacters alloc] - initWithAffectedRange: range - layoutManager: self.layoutManager - undoManager: self.undoManager - replacementRange: NSMakeRange(range.location, - [string length])] - autorelease]; + initWithAffectedRange: range + layoutManager: self.layoutManager + undoManager: self.undoManager + replacementRange: NSMakeRange(range.location, + [string length])] + autorelease]; [[self.undoManager prepareWithInvocationTarget: replace] - undoRedo: self.textStorage]; + undoRedo: self.textStorage]; } } if (_isRichText) { @@ -2463,16 +2480,16 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if (useTypingAttributes) { // We're going to merge the attributes NSMutableAttributedString *mutableAttrString = - [[string mutableCopy] autorelease]; + [[string mutableCopy] autorelease]; [mutableAttrString - addAttributes: [self typingAttributes] - range: NSMakeRange(0, [string length])]; + addAttributes: [self typingAttributes] + range: NSMakeRange(0, [string length])]; attrString = mutableAttrString; } } else { attrString = [[[NSAttributedString alloc] - initWithString: string - attributes: [self typingAttributes]] autorelease]; + initWithString: string + attributes: [self typingAttributes]] autorelease]; } [_textStorage replaceCharactersInRange: range withAttributedString: attrString]; @@ -2487,8 +2504,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; string = [str string]; } NSAttributedString *attrString = [[[NSAttributedString alloc] - initWithString: string - attributes: [self typingAttributes]] autorelease]; + initWithString: string + attributes: [self typingAttributes]] autorelease]; [_textStorage replaceCharactersInRange: range withAttributedString: attrString]; } @@ -2496,8 +2513,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; // TODO: this needs to be optimized to check the changed range expanded // (probably to paragraphs) [self _continuousSpellCheckWithInvalidatedRange: NSMakeRange( - range.location, - [string length])]; + range.location, + [string length])]; [self setSelectedRange: NSMakeRange(range.location + [string length], 0)]; } @@ -2531,7 +2548,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (BOOL) readRTFDFromFile: (NSString *) path { NSAttributedString *contents = - [NSRichTextReader attributedStringWithContentsOfFile: path]; + [NSRichTextReader attributedStringWithContentsOfFile: path]; [_textStorage setAttributedString: contents]; @@ -2540,7 +2557,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) replaceCharactersInRange: (NSRange) range withRTF: (NSData *) rtf { NSAttributedString *astring = - [NSRichTextReader attributedStringWithData: rtf]; + [NSRichTextReader attributedStringWithData: rtf]; if (![self _delegateChangeTextInRange: range replacementString: [astring string]]) @@ -2554,7 +2571,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) replaceCharactersInRange: (NSRange) range withRTFD: (NSData *) rtfd { NSAttributedString *astring = - [NSRichTextReader attributedStringWithData: rtfd]; + [NSRichTextReader attributedStringWithData: rtfd]; if (![self _delegateChangeTextInRange: range replacementString: [astring string]]) @@ -2616,14 +2633,14 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; NSMutableParagraphStyle *style = nil; if ([[self textStorage] length] > 0) - style = - [[[[self textStorage] attribute: NSParagraphStyleAttributeName - atIndex: range.location - effectiveRange: NULL] mutableCopy] autorelease]; + style = [[[[self textStorage] attribute: NSParagraphStyleAttributeName + atIndex: range.location + effectiveRange: NULL] mutableCopy] + autorelease]; if (style == nil) style = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] - autorelease]; + autorelease]; [style setAlignment: alignment]; @@ -2634,7 +2651,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; // This method is always been called with the selected range - so update the // typing attributes with that NSMutableDictionary *attributes = - [[[self typingAttributes] mutableCopy] autorelease]; + [[[self typingAttributes] mutableCopy] autorelease]; [attributes setObject: style forKey: NSParagraphStyleAttributeName]; [self setTypingAttributes: attributes]; } @@ -2706,11 +2723,11 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if ([self isHorizontallyResizable] == NO) containerSize.width = - [self bounds].size.width - _textContainerInset.width * 2; + [self bounds].size.width - _textContainerInset.width * 2; if ([self isVerticallyResizable] == NO) containerSize.height = - [self bounds].size.height - _textContainerInset.height * 2; + [self bounds].size.height - _textContainerInset.height * 2; [[self textContainer] setContainerSize: containerSize]; } @@ -2721,8 +2738,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; [self _configureTextContainerSize]; - usedRect = - [[self layoutManager] usedRectForTextContainer: [self textContainer]]; + usedRect = [[self layoutManager] + usedRectForTextContainer: [self textContainer]]; extraRect = [[self layoutManager] extraLineFragmentUsedRect]; if (!NSEqualRects(extraRect, NSZeroRect)) { extraRect.size.width = NSMaxX(usedRect) - NSMinX(extraRect); @@ -2798,7 +2815,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; font = [sender convertFont: font]; if (font) { NSRange changeRange = - NSIntersectionRange(effectiveRange, range); + NSIntersectionRange(effectiveRange, range); [_textStorage addAttribute: NSFontAttributeName value: font range: changeRange]; @@ -2819,7 +2836,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; font = [sender convertFont: font]; if (font) { NSMutableDictionary *attributes = - [[[self typingAttributes] mutableCopy] autorelease]; + [[[self typingAttributes] mutableCopy] autorelease]; [attributes setObject: font forKey: NSFontAttributeName]; [self setTypingAttributes: attributes]; } @@ -2887,7 +2904,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; [self setSelectedRange: range]; NSMutableDictionary *attributes = - [[[self typingAttributes] mutableCopy] autorelease]; + [[[self typingAttributes] mutableCopy] autorelease]; [attributes setObject: [NSNumber numberWithInt: NSUnderlineStyleSingle] forKey: NSUnderlineStyleAttributeName]; [self setTypingAttributes: attributes]; @@ -2941,9 +2958,9 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; // in a death spiral. _didSendTextDidEndNotification = YES; NSNotification *note = [NSNotification - notificationWithName: NSTextDidEndEditingNotification - object: self - userInfo: nil]; + notificationWithName: NSTextDidEndEditingNotification + object: self + userInfo: nil]; [[NSNotificationCenter defaultCenter] postNotification: note]; _didSendTextDidEndNotification = NO; @@ -3033,7 +3050,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) doCommandBySelector: (SEL) selector { if ([_delegate respondsToSelector: @selector(textView: - doCommandBySelector:)]) + doCommandBySelector:)]) if ([_delegate textView: self doCommandBySelector: selector] == YES) return; @@ -3044,11 +3061,11 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; selector != @selector(insertNewline:) && selector != @selector(cancel:)) [self insertCompletion: - [_userCompletions - objectAtIndex: _userCompletionSelectedItem] - forPartialWordRange: _rangeForUserCompletion - movement: NSOtherTextMovement - isFinal: YES]; + [_userCompletions + objectAtIndex: _userCompletionSelectedItem] + forPartialWordRange: _rangeForUserCompletion + movement: NSOtherTextMovement + isFinal: YES]; } [super doCommandBySelector: selector]; @@ -3061,8 +3078,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; glyphRect.origin.x -= _textContainerInset.width; glyphRect.origin.y -= _textContainerInset.height; NSRange gRange = gRange = - [layoutManager glyphRangeForBoundingRect: glyphRect - inTextContainer: [self textContainer]]; + [layoutManager glyphRangeForBoundingRect: glyphRect + inTextContainer: [self textContainer]]; if ([self drawsBackground]) { [_backgroundColor setFill]; @@ -3189,7 +3206,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; [_selectedRanges removeAllObjects]; [_selectedRanges - addObject: [NSValue valueWithRange: NSMakeRange(location, 0)]]; + addObject: [NSValue valueWithRange: NSMakeRange(location, 0)]]; [self setNeedsDisplay: YES]; if ([sender draggingSourceOperationMask] & NSDragOperationGeneric) @@ -3213,7 +3230,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; NSPoint point = [self convertPoint: [sender draggingLocation] fromView: nil]; NSString *string = - [[sender draggingPasteboard] stringForType: NSStringPboardType]; + [[sender draggingPasteboard] stringForType: NSStringPboardType]; CGFloat fraction = 0; NSUInteger location = [self glyphIndexForPoint: point fractionOfDistanceThroughGlyph: &fraction]; @@ -3267,8 +3284,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if ([_delegate respondsToSelector: @selector (textView:shouldChangeTextInRange:replacementString:)]) { if ([_delegate textView: self - shouldChangeTextInRange: range - replacementString: string] == NO) + shouldChangeTextInRange: range + replacementString: string] == NO) return NO; } @@ -3280,25 +3297,25 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; { NSArray *result = to; if ([_delegate - respondsToSelector: @selector - (textView: - willChangeSelectionFromCharacterRanges:toCharacterRanges:)]) + respondsToSelector: @selector + (textView: + willChangeSelectionFromCharacterRanges:toCharacterRanges + :)]) result = [_delegate textView: self - willChangeSelectionFromCharacterRanges: from - toCharacterRanges: to]; - else if ([_delegate - respondsToSelector: @selector - (textView: - willChangeSelectionFromCharacterRange:toCharacterRange - :)]) { + willChangeSelectionFromCharacterRanges: from + toCharacterRanges: to]; + else if ([_delegate respondsToSelector: @selector + (textView: + willChangeSelectionFromCharacterRange: + toCharacterRange:)]) { NSRange fromRange = [[from objectAtIndex: 0] rangeValue]; NSRange toRange = [[to objectAtIndex: 0] rangeValue]; NSRange resultRange = [_delegate textView: self - willChangeSelectionFromCharacterRange: fromRange - toCharacterRange: toRange]; + willChangeSelectionFromCharacterRange: fromRange + toCharacterRange: toRange]; - result = - [NSArray arrayWithObject: [NSValue valueWithRange: resultRange]]; + result = [NSArray + arrayWithObject: [NSValue valueWithRange: resultRange]]; } return result; @@ -3309,14 +3326,17 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; [_textStorage setAttributedString: attrString]; } else { [_textStorage - setAttributedString: - [[[NSAttributedString alloc] - initWithString: NSLocalizedStringFromTableInBundle( - @"", nil, - [NSBundle - bundleForClass: [NSTextView class]], - @"") - attributes: nil] autorelease]]; + setAttributedString: + [[[NSAttributedString alloc] + initWithString: + NSLocalizedStringFromTableInBundle( + @"", nil, + [NSBundle + bundleForClass: + [NSTextView + class]], + @"") + attributes: nil] autorelease]]; } } @@ -3354,14 +3374,14 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) ignoreSpelling: sender { [[NSSpellChecker sharedSpellChecker] - ignoreWord: [[sender selectedCell] stringValue] - inSpellDocumentWithTag: [self spellCheckerDocumentTag]]; + ignoreWord: [[sender selectedCell] stringValue] + inSpellDocumentWithTag: [self spellCheckerDocumentTag]]; } - (void) showGuessPanel: sender { [self moveToBeginningOfDocument: sender]; [[[NSSpellChecker sharedSpellChecker] spellingPanel] - makeKeyAndOrderFront: self]; + makeKeyAndOrderFront: self]; } - (void) _continuousSpellCheckWithInvalidatedRange: (NSRange) invalidatedRange { @@ -3379,8 +3399,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; invalidatedRange = NSMakeRange(start, end - start); if (invalidatedRange.length > 0) { [[self layoutManager] - removeTemporaryAttribute: NSSpellingStateAttributeName - forCharacterRange: invalidatedRange]; + removeTemporaryAttribute: NSSpellingStateAttributeName + forCharacterRange: invalidatedRange]; } if (_isContinuousSpellCheckingEnabled) { NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker]; @@ -3411,9 +3431,10 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } - (void) _continuousSpellCheck { - [self - _continuousSpellCheckWithInvalidatedRange: NSMakeRange(0, [[self string] - length])]; + [self _continuousSpellCheckWithInvalidatedRange: NSMakeRange( + 0, + [[self string] + length])]; } - (void) checkSpelling: sender { @@ -3431,8 +3452,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } } - NSRange range = - NSMakeRange(selection.location, [string length] - selection.location); + NSRange range = NSMakeRange(selection.location, + [string length] - selection.location); NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker]; NSArray *checking = [checker checkString: string @@ -3470,27 +3491,30 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; @try { NSRange range = [_textStorage - doubleClickAtIndex: [self glyphIndexForPoint: point - fractionOfDistanceThroughGlyph: &fraction]]; + doubleClickAtIndex: + [self glyphIndexForPoint: point + fractionOfDistanceThroughGlyph: &fraction]]; [self setSelectedRange: range]; NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker]; - NSArray *guesses = [checker - guessesForWordRange: range - inString: [self string] - language: [[NSLocale currentLocale] localeIdentifier] - inSpellDocumentWithTag: [self spellCheckerDocumentTag]]; + NSArray *guesses = + [checker guessesForWordRange: range + inString: [self string] + language: [[NSLocale currentLocale] + localeIdentifier] + inSpellDocumentWithTag: [self spellCheckerDocumentTag]]; if ([guesses count] == 0) { NSMenuItem *item = [menu - addItemWithTitle: NSLocalizedStringFromTableInBundle( - @"No Guesses Found", nil, - [NSBundle - bundleForClass: [NSTextView class]], - @"Spell checker guesses") - action: @selector(cut:) - keyEquivalent: @""]; + addItemWithTitle: + NSLocalizedStringFromTableInBundle( + @"No Guesses Found", nil, + [NSBundle + bundleForClass: [NSTextView class]], + @"Spell checker guesses") + action: @selector(cut:) + keyEquivalent: @""]; [item setEnabled: NO]; } else { for (NSString *guess in guesses) { @@ -3505,28 +3529,32 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; // means there's nothing to spellcheck } [menu addItemWithTitle: NSLocalizedStringFromTableInBundle( - @"Cut", nil, - [NSBundle bundleForClass: [NSTextView class]], - @"Cut the selection") + @"Cut", nil, + [NSBundle + bundleForClass: [NSTextView class]], + @"Cut the selection") action: @selector(cut:) keyEquivalent: @""]; [menu addItemWithTitle: NSLocalizedStringFromTableInBundle( - @"Copy", nil, - [NSBundle bundleForClass: [NSTextView class]], - @"Copy the selection") + @"Copy", nil, + [NSBundle + bundleForClass: [NSTextView class]], + @"Copy the selection") action: @selector(copy:) keyEquivalent: @""]; [menu addItemWithTitle: NSLocalizedStringFromTableInBundle( - @"Paste", nil, - [NSBundle bundleForClass: [NSTextView class]], - @"Paste the selection") + @"Paste", nil, + [NSBundle + bundleForClass: [NSTextView class]], + @"Paste the selection") action: @selector(paste:) keyEquivalent: @""]; [menu addItem: [NSMenuItem separatorItem]]; [menu addItemWithTitle: NSLocalizedStringFromTableInBundle( - @"Select All", nil, - [NSBundle bundleForClass: [NSTextView class]], - @"Select all the content") + @"Select All", nil, + [NSBundle + bundleForClass: [NSTextView class]], + @"Select all the content") action: @selector(selectAll:) keyEquivalent: @""]; @@ -3550,7 +3578,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if ([checkContainer textView]->_spellCheckerDocumentTag != 0) { // Direct access the ivar to avoid the method logic here. _spellCheckerDocumentTag = - [checkContainer textView]->_spellCheckerDocumentTag; + [checkContainer textView]->_spellCheckerDocumentTag; } if (_spellCheckerDocumentTag == 0) @@ -3587,7 +3615,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) toggleAutomaticSpellingCorrection: sender { _isAutomaticSpellingCorrectionEnabled = - !_isAutomaticSpellingCorrectionEnabled; + !_isAutomaticSpellingCorrectionEnabled; NSUnimplementedMethod(); } @@ -3602,48 +3630,48 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; - (void) setSpellingState: (NSInteger) value range: (NSRange) characterRange { [[self layoutManager] - addTemporaryAttribute: NSSpellingStateAttributeName - value: [NSNumber numberWithLong: value] - forCharacterRange: characterRange]; + addTemporaryAttribute: NSSpellingStateAttributeName + value: [NSNumber numberWithLong: value] + forCharacterRange: characterRange]; } #pragma mark Ruler client view - (void) rulerView: (NSRulerView *) rulerView - willSetClientView: (NSView *) clientView + willSetClientView: (NSView *) clientView { } - (void) rulerView: (NSRulerView *) rulerView - handleMouseDown: (NSEvent *) event + handleMouseDown: (NSEvent *) event { // Add a new tab stop NSPoint point = [self convertPoint: event.locationInWindow fromView: nil]; CGFloat delta = rulerView.originOffset; NSRulerMarker *marker = - [NSRulerMarker leftTabMarkerWithRulerView: rulerView - location: point.x + delta]; + [NSRulerMarker leftTabMarkerWithRulerView: rulerView + location: point.x + delta]; NSTextTab *tabstop = - [[[NSTextTab alloc] initWithType: NSLeftTabStopType - location: point.x] autorelease]; + [[[NSTextTab alloc] initWithType: NSLeftTabStopType + location: point.x] autorelease]; [marker setRepresentedObject: tabstop]; [rulerView trackMarker: marker withMouseEvent: event]; } - (BOOL) rulerView: (NSRulerView *) rulerView - shouldMoveMarker: (NSRulerMarker *) marker + shouldMoveMarker: (NSRulerMarker *) marker { return YES; } - (CGFloat) rulerView: (NSRulerView *) rulerView - willMoveMarker: (NSRulerMarker *) marker - toLocation: (CGFloat) location + willMoveMarker: (NSRulerMarker *) marker + toLocation: (CGFloat) location { if (location < rulerView.originOffset) { location = rulerView.originOffset; } if (location > self.textContainer.containerSize.width - - self.textContainer.lineFragmentPadding) { + self.textContainer.lineFragmentPadding) { location = self.textContainer.containerSize.width - self.textContainer.lineFragmentPadding; } @@ -3651,7 +3679,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } - (void) rulerView: (NSRulerView *) rulerView - didMoveMarker: (NSRulerMarker *) marker + didMoveMarker: (NSRulerMarker *) marker { CGFloat delta = rulerView.originOffset; CGFloat location = marker.markerLocation - delta; @@ -3660,8 +3688,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if ([representedObject isKindOfClass: [NSTextTab class]]) { NSTextTab *textTab = (NSTextTab *) representedObject; NSTextTab *newTab = - [[[NSTextTab alloc] initWithType: [textTab tabStopType] - location: location] autorelease]; + [[[NSTextTab alloc] initWithType: [textTab tabStopType] + location: location] autorelease]; // We need to expand the range to full paragraphs NSRange range = [self rangeForUserParagraphAttributeChange]; @@ -3672,27 +3700,29 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; while (location < NSMaxRange(range)) { NSRange effectiveRange; NSParagraphStyle *style = - [_textStorage attribute: NSParagraphStyleAttributeName - atIndex: location - effectiveRange: &effectiveRange]; + [_textStorage attribute: NSParagraphStyleAttributeName + atIndex: location + effectiveRange: &effectiveRange]; NSRange rangeToChange = NSIntersectionRange(effectiveRange, range); if (style == nil) { style = [NSParagraphStyle defaultParagraphStyle]; } // Copy the paragraph style, changing only the tab NSMutableParagraphStyle *newStyle = - [[style mutableCopy] autorelease]; + [[style mutableCopy] autorelease]; NSMutableArray *tabstops = - [[[newStyle tabStops] mutableCopy] autorelease]; + [[[newStyle tabStops] mutableCopy] autorelease]; [tabstops addObject: newTab]; [tabstops removeObject: textTab]; // keep the tabstops sorted [tabstops - sortUsingDescriptors: - [NSArray - arrayWithObject: [NSSortDescriptor - sortDescriptorWithKey: @"location" - ascending: YES]]]; + sortUsingDescriptors: + [NSArray arrayWithObject: + [NSSortDescriptor + sortDescriptorWithKey: + @"location" + ascending: + YES]]]; [newStyle setTabStops: tabstops]; [_textStorage addAttribute: NSParagraphStyleAttributeName value: newStyle @@ -3704,22 +3734,24 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; // Update the typing attributes too NSParagraphStyle *style = - [_typingAttributes objectForKey: NSParagraphStyleAttributeName]; + [_typingAttributes objectForKey: NSParagraphStyleAttributeName]; if (style == nil) { style = [NSParagraphStyle defaultParagraphStyle]; } // Copy the paragraph style, changing only the tab NSMutableParagraphStyle *newStyle = [[style mutableCopy] autorelease]; NSMutableArray *tabstops = - [[[newStyle tabStops] mutableCopy] autorelease]; + [[[newStyle tabStops] mutableCopy] autorelease]; [tabstops addObject: newTab]; [tabstops removeObject: textTab]; // keep the tabstops sorted [tabstops - sortUsingDescriptors: - [NSArray arrayWithObject: [NSSortDescriptor - sortDescriptorWithKey: @"location" - ascending: YES]]]; + sortUsingDescriptors: + [NSArray arrayWithObject: + [NSSortDescriptor + sortDescriptorWithKey: + @"location" + ascending: YES]]]; [newStyle setTabStops: tabstops]; if (![_typingAttributes isKindOfClass: [NSMutableDictionary class]]) { NSDictionary *dict = [_typingAttributes mutableCopy]; @@ -3727,14 +3759,14 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; _typingAttributes = dict; } [(NSMutableDictionary *) _typingAttributes - setObject: newStyle - forKey: NSParagraphStyleAttributeName]; + setObject: newStyle + forKey: NSParagraphStyleAttributeName]; marker.representedObject = newTab; } else if ([representedObject isEqual: @"NSHeadIndentRulerMarkerTag"] || [representedObject isEqual: @"NSTailIndentRulerMarkerTag"] || [representedObject - isEqual: @"NSFirstLineHeadIndentRulerMarkerTag"]) { + isEqual: @"NSFirstLineHeadIndentRulerMarkerTag"]) { // TODO // style.headIndent = location // style.tailIndent = view.textContainer.containerSize.width - location @@ -3743,7 +3775,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } - (BOOL) rulerView: (NSRulerView *) rulerView - shouldAddMarker: (NSRulerMarker *) marker + shouldAddMarker: (NSRulerMarker *) marker { return YES; } @@ -3756,7 +3788,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; location = rulerView.originOffset; } if (location > self.textContainer.containerSize.width - - self.textContainer.lineFragmentPadding) { + self.textContainer.lineFragmentPadding) { location = self.textContainer.containerSize.width - self.textContainer.lineFragmentPadding; } @@ -3764,7 +3796,7 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } - (void) rulerView: (NSRulerView *) rulerView - didAddMarker: (NSRulerMarker *) marker + didAddMarker: (NSRulerMarker *) marker { CGFloat delta = rulerView.originOffset; @@ -3774,8 +3806,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; if ([representedObject isKindOfClass: [NSTextTab class]]) { NSTextTab *textTab = (NSTextTab *) representedObject; NSTextTab *newTab = - [[[NSTextTab alloc] initWithType: [textTab tabStopType] - location: location] autorelease]; + [[[NSTextTab alloc] initWithType: [textTab tabStopType] + location: location] autorelease]; // Change the tab stop value for all of the selection NSRange range = [self rangeForUserParagraphAttributeChange]; @@ -3784,26 +3816,28 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; while (location < NSMaxRange(range)) { NSRange effectiveRange; NSParagraphStyle *style = - [_textStorage attribute: NSParagraphStyleAttributeName - atIndex: location - effectiveRange: &effectiveRange]; + [_textStorage attribute: NSParagraphStyleAttributeName + atIndex: location + effectiveRange: &effectiveRange]; NSRange rangeToChange = NSIntersectionRange(effectiveRange, range); if (style == nil) { style = [NSParagraphStyle defaultParagraphStyle]; } // Copy the paragraph style, changing only the tab NSMutableParagraphStyle *newStyle = - [[style mutableCopy] autorelease]; + [[style mutableCopy] autorelease]; NSMutableArray *tabstops = - [[[newStyle tabStops] mutableCopy] autorelease]; + [[[newStyle tabStops] mutableCopy] autorelease]; [tabstops addObject: newTab]; // keep the tabstops sorted [tabstops - sortUsingDescriptors: - [NSArray - arrayWithObject: [NSSortDescriptor - sortDescriptorWithKey: @"location" - ascending: YES]]]; + sortUsingDescriptors: + [NSArray arrayWithObject: + [NSSortDescriptor + sortDescriptorWithKey: + @"location" + ascending: + YES]]]; [newStyle setTabStops: tabstops]; [_textStorage addAttribute: NSParagraphStyleAttributeName value: newStyle @@ -3814,21 +3848,23 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; // Update the typing attributes too NSParagraphStyle *style = - [_typingAttributes objectForKey: NSParagraphStyleAttributeName]; + [_typingAttributes objectForKey: NSParagraphStyleAttributeName]; if (style == nil) { style = [NSParagraphStyle defaultParagraphStyle]; } // Copy the paragraph style, changing only the tab NSMutableParagraphStyle *newStyle = [[style mutableCopy] autorelease]; NSMutableArray *tabstops = - [[[newStyle tabStops] mutableCopy] autorelease]; + [[[newStyle tabStops] mutableCopy] autorelease]; [tabstops addObject: newTab]; // keep the tabstops sorted [tabstops - sortUsingDescriptors: - [NSArray arrayWithObject: [NSSortDescriptor - sortDescriptorWithKey: @"location" - ascending: YES]]]; + sortUsingDescriptors: + [NSArray arrayWithObject: + [NSSortDescriptor + sortDescriptorWithKey: + @"location" + ascending: YES]]]; [newStyle setTabStops: tabstops]; if (![_typingAttributes isKindOfClass: [NSMutableDictionary class]]) { NSDictionary *dict = [_typingAttributes mutableCopy]; @@ -3836,8 +3872,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; _typingAttributes = dict; } [(NSMutableDictionary *) _typingAttributes - setObject: newStyle - forKey: NSParagraphStyleAttributeName]; + setObject: newStyle + forKey: NSParagraphStyleAttributeName]; marker.representedObject = newTab; @@ -3846,14 +3882,14 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; } - (BOOL) rulerView: (NSRulerView *) rulerView - shouldRemoveMarker: (NSRulerMarker *) marker + shouldRemoveMarker: (NSRulerMarker *) marker { return [(NSObject *) marker.representedObject - isKindOfClass: [NSTextTab class]]; + isKindOfClass: [NSTextTab class]]; } - (void) rulerView: (NSRulerView *) rulerView - didRemoveMarker: (NSRulerMarker *) marker + didRemoveMarker: (NSRulerMarker *) marker { id representedObject = marker.representedObject; if ([representedObject isKindOfClass: [NSTextTab class]]) { @@ -3867,18 +3903,18 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; while (location < NSMaxRange(range)) { NSRange effectiveRange; NSParagraphStyle *style = - [_textStorage attribute: NSParagraphStyleAttributeName - atIndex: location - effectiveRange: &effectiveRange]; + [_textStorage attribute: NSParagraphStyleAttributeName + atIndex: location + effectiveRange: &effectiveRange]; NSRange rangeToChange = NSIntersectionRange(effectiveRange, range); if (style == nil) { style = [NSParagraphStyle defaultParagraphStyle]; } // Copy the paragraph style, changing only the tab NSMutableParagraphStyle *newStyle = - [[style mutableCopy] autorelease]; + [[style mutableCopy] autorelease]; NSMutableArray *tabstops = - [[[newStyle tabStops] mutableCopy] autorelease]; + [[[newStyle tabStops] mutableCopy] autorelease]; [tabstops removeObject: textTab]; [newStyle setTabStops: tabstops]; [_textStorage addAttribute: NSParagraphStyleAttributeName @@ -3890,14 +3926,14 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; // Update the typing attributes NSParagraphStyle *style = - [_typingAttributes objectForKey: NSParagraphStyleAttributeName]; + [_typingAttributes objectForKey: NSParagraphStyleAttributeName]; if (style == nil) { style = [NSParagraphStyle defaultParagraphStyle]; } // Copy the paragraph style, changing only the tab NSMutableParagraphStyle *newStyle = [[style mutableCopy] autorelease]; NSMutableArray *tabstops = - [[[newStyle tabStops] mutableCopy] autorelease]; + [[[newStyle tabStops] mutableCopy] autorelease]; [tabstops removeObject: textTab]; [newStyle setTabStops: tabstops]; if (![_typingAttributes isKindOfClass: [NSMutableDictionary class]]) { @@ -3906,8 +3942,8 @@ NSString *const NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; _typingAttributes = dict; } [(NSMutableDictionary *) _typingAttributes - setObject: newStyle - forKey: NSParagraphStyleAttributeName]; + setObject: newStyle + forKey: NSParagraphStyleAttributeName]; marker.representedObject = nil; diff --git a/AppKit/NSTextView.subproj/NSTextViewSharedData.m b/AppKit/NSTextView.subproj/NSTextViewSharedData.m index ed186240..49e20dea 100644 --- a/AppKit/NSTextView.subproj/NSTextViewSharedData.m +++ b/AppKit/NSTextView.subproj/NSTextViewSharedData.m @@ -32,18 +32,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSKeyedUnarchiver *keyed = (NSKeyedUnarchiver *) coder; _backgroundColor = - [[keyed decodeObjectForKey: @"NSBackgroundColor"] retain]; + [[keyed decodeObjectForKey: @"NSBackgroundColor"] retain]; _defaultParagraphStyle = - [[keyed decodeObjectForKey: @"NSDefaultParagraphStyle"] retain]; + [[keyed decodeObjectForKey: @"NSDefaultParagraphStyle"] retain]; _flags = [keyed decodeIntForKey: @"NSFlags"]; _insertionColor = - [[keyed decodeObjectForKey: @"NSInsertionColor"] retain]; + [[keyed decodeObjectForKey: @"NSInsertionColor"] retain]; _linkAttributes = - [[keyed decodeObjectForKey: @"NSLinkAttributes"] retain]; + [[keyed decodeObjectForKey: @"NSLinkAttributes"] retain]; _markedAttributes = - [[keyed decodeObjectForKey: @"NSMarkedAttributes"] retain]; + [[keyed decodeObjectForKey: @"NSMarkedAttributes"] retain]; _selectedAttributes = - [[keyed decodeObjectForKey: @"NSSelectedAttributes"] retain]; + [[keyed decodeObjectForKey: @"NSSelectedAttributes"] retain]; } else { [NSException raise: NSInvalidArgumentException format: @"-[%@ %s] is not implemented for coder %@", diff --git a/AppKit/NSTextView.subproj/NSTypesetter.m b/AppKit/NSTextView.subproj/NSTypesetter.m index 4a21b277..aa75b239 100644 --- a/AppKit/NSTextView.subproj/NSTypesetter.m +++ b/AppKit/NSTextView.subproj/NSTypesetter.m @@ -23,7 +23,7 @@ + (NSSize) printingAdjustmentInLayoutManager: (NSLayoutManager *) layoutManager forNominallySpacedGlyphRange: (NSRange) glyphRange packedGlyphs: - (const unsigned char *) packedGlyphs + (const unsigned char *) packedGlyphs count: (NSUInteger) count { return NSMakeSize(0, 0); @@ -34,8 +34,8 @@ } + sharedSystemTypesetter { - return [self - sharedSystemTypesetterForBehavior: [self defaultTypesetterBehavior]]; + return [self sharedSystemTypesetterForBehavior: + [self defaultTypesetterBehavior]]; } - (void) dealloc { @@ -112,13 +112,13 @@ } - (void) getLineFragmentRect: (NSRect *) fragmentRect - usedRect: (NSRect *) usedRect - remainingRect: (NSRect *) remainingRect - forStartingGlyphAtIndex: (NSUInteger) startingGlyphIndex - proposedRect: (NSRect) proposedRect - lineSpacing: (CGFloat) lineSpacing - paragraphSpacingBefore: (CGFloat) paragraphSpacingBefore - paragraphSpacingAfter: (CGFloat) paragraphSpacingAfter + usedRect: (NSRect *) usedRect + remainingRect: (NSRect *) remainingRect + forStartingGlyphAtIndex: (NSUInteger) startingGlyphIndex + proposedRect: (NSRect) proposedRect + lineSpacing: (CGFloat) lineSpacing + paragraphSpacingBefore: (CGFloat) paragraphSpacingBefore + paragraphSpacingAfter: (CGFloat) paragraphSpacingAfter { NSInvalidAbstractInvocation(); } @@ -140,8 +140,8 @@ } - (void) insertGlyph: (NSGlyph) glyph - atGlyphIndex: (NSUInteger) glyphIndex - characterIndex: (NSUInteger) characterIndex + atGlyphIndex: (NSUInteger) glyphIndex + characterIndex: (NSUInteger) characterIndex { [_layoutManager insertGlyph: glyph atGlyphIndex: glyphIndex @@ -169,8 +169,8 @@ } - (void) setLocation: (NSPoint) location - withAdvancements: (const CGFloat *) nominalAdvancements - forStartOfGlyphRange: (NSRange) glyphRange + withAdvancements: (const CGFloat *) nominalAdvancements + forStartOfGlyphRange: (NSRange) glyphRange { [_layoutManager setLocation: location forStartOfGlyphRange: glyphRange]; } @@ -195,14 +195,14 @@ } - (BOOL) shouldBreakLineByHyphenatingBeforeCharacterAtIndex: - (NSUInteger) characterIndex + (NSUInteger) characterIndex { NSInvalidAbstractInvocation(); return NO; } - (BOOL) shouldBreakLineByWordBeforeCharacterAtIndex: - (NSUInteger) characterIndex + (NSUInteger) characterIndex { NSInvalidAbstractInvocation(); return NO; @@ -272,7 +272,7 @@ } - (NSTypesetterControlCharacterAction) actionForControlCharacterAtIndex: - (NSUInteger) characterIndex + (NSUInteger) characterIndex { unichar c = [[_attributedString string] characterAtIndex: characterIndex]; if ([[NSCharacterSet newlineCharacterSet] characterIsMember: c]) { @@ -361,9 +361,9 @@ } - (void) getLineFragmentRect: (NSRect *) fragmentRect - usedRect: (NSRect *) usedRect - forParagraphSeparatorGlyphRange: (NSRange) glyphRange - atProposedOrigin: (NSPoint) proposedOrigin + usedRect: (NSRect *) usedRect + forParagraphSeparatorGlyphRange: (NSRange) glyphRange + atProposedOrigin: (NSPoint) proposedOrigin { NSInvalidAbstractInvocation(); } @@ -395,7 +395,7 @@ withProposedLineFragmentRect: (NSRect) rect { return [[self _paragraphStyleBeforeGlyphIndex: glyphIndex] - paragraphSpacingBefore]; + paragraphSpacingBefore]; } - (NSUInteger) layoutParagraphAtPoint: (NSPoint *) point { @@ -421,9 +421,9 @@ } - (void) insertGlyphs: (const NSGlyph *) glyphs - length: (NSUInteger) length - forStartingGlyphAtIndex: (NSUInteger) glyphIndex - characterIndex: (NSUInteger) characterIndex + length: (NSUInteger) length + forStartingGlyphAtIndex: (NSUInteger) glyphIndex + characterIndex: (NSUInteger) characterIndex { NSInvalidAbstractInvocation(); } diff --git a/AppKit/NSTextView.subproj/NSTypesetter_concrete.m b/AppKit/NSTextView.subproj/NSTypesetter_concrete.m index 3a9e0365..824bd7e9 100644 --- a/AppKit/NSTextView.subproj/NSTypesetter_concrete.m +++ b/AppKit/NSTextView.subproj/NSTypesetter_concrete.m @@ -46,13 +46,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - init { [super init]; _layoutNextFragment = - [self methodForSelector: @selector(layoutNextFragment)]; + [self methodForSelector: @selector(layoutNextFragment)]; _glyphCacheRange = NSMakeRange(0, 0); _glyphCacheCapacity = 256; _glyphCache = - NSZoneMalloc([self zone], sizeof(NSGlyph) * _glyphCacheCapacity); + NSZoneMalloc([self zone], sizeof(NSGlyph) * _glyphCacheCapacity); _characterCache = - NSZoneMalloc([self zone], sizeof(unichar) * _glyphCacheCapacity); + NSZoneMalloc([self zone], sizeof(unichar) * _glyphCacheCapacity); _glyphRangesInLine = [NSRangeArray new]; return self; @@ -89,13 +89,13 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, * remaining rectangle for a line fragment. */ - (void) getLineFragmentRect: (NSRectPointer) lineFragmentRect - usedRect: (NSRectPointer) lineFragmentUsedRect - remainingRect: (NSRectPointer) remainingRect - forStartingGlyphAtIndex: (NSUInteger) startingGlyphIndex - proposedRect: (NSRect) proposedRect - lineSpacing: (CGFloat) lineSpacing - paragraphSpacingBefore: (CGFloat) paragraphSpacingBefore - paragraphSpacingAfter: (CGFloat) paragraphSpacingAfter + usedRect: (NSRectPointer) lineFragmentUsedRect + remainingRect: (NSRectPointer) remainingRect + forStartingGlyphAtIndex: (NSUInteger) startingGlyphIndex + proposedRect: (NSRect) proposedRect + lineSpacing: (CGFloat) lineSpacing + paragraphSpacingBefore: (CGFloat) paragraphSpacingBefore + paragraphSpacingAfter: (CGFloat) paragraphSpacingAfter { #if DEBUG_TYPESETTER NSLog(@"getLineFragmentRect: %p usedRect: %p remainingRect: %p " @@ -181,7 +181,7 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, _scanRect.origin.y = NSMinY(proposedRect); _scanRect.size.width = 0; _scanRect.size.height = - MAX(proposedRect.size.height, fragmentHeight); + MAX(proposedRect.size.height, fragmentHeight); #if DEBUG_GETLINEFRAGMENTRECT NSLog(@"No more room on that line - we will try next one. " @"_scanRect now: %@", @@ -262,14 +262,14 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, #endif NSTextAttachment *attachment = - [_attributes objectForKey: NSAttachmentAttributeName]; + [_attributes objectForKey: NSAttachmentAttributeName]; id cell = [attachment attachmentCell]; NSSize size = [cell cellSize]; fragmentHeight = size.height; glyphAdvance = _positionOfGlyph(_font, NULL, NSNullGlyph, _previousGlyph, &isNominal) - .x; + .x; glyphMaxWidth = size.width; _previousGlyph = NSNullGlyph; } else { @@ -279,7 +279,7 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, #endif fragmentWidth += _positionOfGlyph(_font, NULL, NSNullGlyph, _previousGlyph, &isNominal) - .x; + .x; _previousGlyph = NSNullGlyph; switch ([self actionForControlCharacterAtIndex: glyphIndex]) { @@ -304,21 +304,22 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, #endif CGFloat x = _scanRect.origin.x + fragmentWidth; NSTextTab *tab = - [self textTabForGlyphLocation: x - writingDirection: [_currentParagraphStyle - baseWritingDirection] - maxLocation: NSMaxX(_scanRect)]; + [self textTabForGlyphLocation: x + writingDirection: + [_currentParagraphStyle + baseWritingDirection] + maxLocation: NSMaxX(_scanRect)]; CGFloat nextx; if (tab != nil) nextx = [tab location]; else { CGFloat interval = - [_currentParagraphStyle defaultTabInterval]; + [_currentParagraphStyle defaultTabInterval]; if (interval > 0) - nextx = - (((NSInteger)(x / interval)) + 1) * interval; + nextx = (((NSInteger)(x / interval)) + 1) * + interval; else nextx = x; } @@ -350,9 +351,9 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, break; } - glyphAdvance = - _positionOfGlyph(_font, NULL, glyph, _previousGlyph, &isNominal) - .x; + glyphAdvance = _positionOfGlyph(_font, NULL, glyph, _previousGlyph, + &isNominal) + .x; if (!isNominal && fragmentRange.length > 1) { #if DEBUG_GETLINEFRAGMENTRECT NSLog(@"found special kerning pair"); @@ -365,8 +366,9 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, break; } // Get the width of the glyph - glyphMaxWidth = - _positionOfGlyph(_font, NULL, NSNullGlyph, glyph, &isNominal).x; + glyphMaxWidth = _positionOfGlyph(_font, NULL, NSNullGlyph, glyph, + &isNominal) + .x; } switch (_lineBreakMode) { @@ -386,7 +388,7 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, if (wordWrapWidth > 0) { // Break the line at previously found wrap location _lineRange.length = - NSMaxRange(wordWrapRange) - _lineRange.location; + NSMaxRange(wordWrapRange) - _lineRange.location; fragmentRange = wordWrapRange; fragmentWidth = wordWrapWidth; _previousGlyph = wordWrapPreviousGlyph; @@ -404,14 +406,14 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, // wrapable one do { NSRange range = [_glyphRangesInLine - rangeAtIndex: [_glyphRangesInLine - count] - - 1]; + rangeAtIndex: [_glyphRangesInLine + count] - + 1]; [_layoutManager _rollbackLatestFragment]; [_glyphRangesInLine - removeRangeAtIndex: [_glyphRangesInLine - count] - - 1]; + removeRangeAtIndex: + [_glyphRangesInLine count] - + 1]; if (_wordWrapRange.location == range.location) { break; @@ -431,8 +433,9 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, _scanRect.origin.x = NSMaxX(_fullLineRect); _scanRect.origin.y = NSMinY(proposedRect); _scanRect.size.width = 0; - _scanRect.size.height = MAX( - proposedRect.size.height, fragmentHeight); + _scanRect.size.height = + MAX(proposedRect.size.height, + fragmentHeight); _lineRange.length -= fragmentRange.length; fragmentRange.length = 0; fragmentWidth = 0; @@ -536,9 +539,9 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, loadGlyphAndCharacterCacheForLocation(self, _nextGlyphLocation); NSInteger nextChar = - _characterCache[glyphIndex - _glyphCacheRange.location]; + _characterCache[glyphIndex - _glyphCacheRange.location]; if ([[NSCharacterSet newlineCharacterSet] - characterIsMember: nextChar]) { + characterIsMember: nextChar]) { #if DEBUG_GETLINEFRAGMENTRECT NSLog(@"and at the end of the line..."); #endif @@ -549,7 +552,7 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, if (!advanceScanRect) { CGFloat glyphAdvance = _positionOfGlyph(_font, NULL, NSNullGlyph, _previousGlyph, &isNominal) - .x; + .x; fragmentWidth += glyphAdvance; @@ -572,11 +575,11 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, #endif // Check we still fit if something changed our height _scanRect.size.height = height; - _scanRect = - [_container lineFragmentRectForProposedRect: _scanRect - sweepDirection: NSLineSweepRight - movementDirection: NSLineMovesDown - remainingRect: remainingRect]; + _scanRect = [_container + lineFragmentRectForProposedRect: _scanRect + sweepDirection: NSLineSweepRight + movementDirection: NSLineMovesDown + remainingRect: remainingRect]; } if (!NSEqualRects(_scanRect, NSZeroRect)) { #if DEBUG_GETLINEFRAGMENTRECT @@ -592,7 +595,7 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, forGlyphRange: fragmentRange usedRect: fragmentRect]; [_layoutManager setLocation: _scanRect.origin - forStartOfGlyphRange: fragmentRange]; + forStartOfGlyphRange: fragmentRange]; } else { #if DEBUG_GETLINEFRAGMENTRECT NSLog(@"no more room for text - bailing"); @@ -628,7 +631,7 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, NSRange range = [_glyphRangesInLine rangeAtIndex: 0]; NSPoint currentLocation = - [_layoutManager locationForGlyphAtIndex: range.location]; + [_layoutManager locationForGlyphAtIndex: range.location]; for (NSInteger i = 0; i < count; ++i) { NSInteger idx = indexes[i]; NSRange range = [_glyphRangesInLine rangeAtIndex: idx]; @@ -636,28 +639,28 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, NSLog(@"reordering fragment range: %@", NSStringFromRange(range)); #endif - NSPoint location = - [_layoutManager locationForGlyphAtIndex: range.location]; + NSPoint location = [_layoutManager + locationForGlyphAtIndex: range.location]; NSRect usedRect = [_layoutManager - lineFragmentUsedRectForGlyphAtIndex: range.location - effectiveRange: NULL]; + lineFragmentUsedRectForGlyphAtIndex: range.location + effectiveRange: NULL]; NSRect rect = [_layoutManager - lineFragmentRectForGlyphAtIndex: range.location - effectiveRange: NULL]; + lineFragmentRectForGlyphAtIndex: range.location + effectiveRange: NULL]; usedRect.origin = currentLocation; rect.origin = currentLocation; [_layoutManager setLineFragmentRect: rect forGlyphRange: range usedRect: usedRect]; [_layoutManager setLocation: currentLocation - forStartOfGlyphRange: range]; + forStartOfGlyphRange: range]; currentLocation.x += usedRect.size.width; } // Reorder the ranges LtoR for (NSInteger i = 0; i < count; ++i) { NSInteger idx = indexes[i]; [_glyphRangesInLine - addRange: [_glyphRangesInLine rangeAtIndex: idx]]; + addRange: [_glyphRangesInLine rangeAtIndex: idx]]; } for (NSInteger i = 0; i < count; ++i) { [_glyphRangesInLine removeRangeAtIndex: 0]; @@ -676,8 +679,8 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, if (count) { NSRange range = [_glyphRangesInLine rangeAtIndex: count - 1]; NSRect usedRect = [_layoutManager - lineFragmentUsedRectForGlyphAtIndex: range.location - effectiveRange: NULL]; + lineFragmentUsedRectForGlyphAtIndex: range.location + effectiveRange: NULL]; totalUsedWidth = NSMaxX(usedRect); } @@ -710,18 +713,18 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, if (!NSLocationInRange(range.location, _glyphCacheRange)) loadGlyphAndCharacterCacheForLocation( - self, range.location - 1); + self, range.location - 1); int character = - _characterCache[range.location - 1 - - _glyphCacheRange.location]; + _characterCache[range.location - 1 - + _glyphCacheRange.location]; if (character == ' ') { blankCount++; } } if (blankCount) { alignmentDelta = - (totalWidth - totalUsedWidth) / blankCount; + (totalWidth - totalUsedWidth) / blankCount; } } break; @@ -740,14 +743,14 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, NSLog(@"adjusting glyph range: %@", NSStringFromRange(range)); #endif - NSRect backRect = - [_layoutManager lineFragmentRectForGlyphAtIndex: range.location - effectiveRange: NULL]; - NSRect usedRect = [_layoutManager - lineFragmentUsedRectForGlyphAtIndex: range.location + NSRect backRect = [_layoutManager + lineFragmentRectForGlyphAtIndex: range.location effectiveRange: NULL]; + NSRect usedRect = [_layoutManager + lineFragmentUsedRectForGlyphAtIndex: range.location + effectiveRange: NULL]; NSPoint location = - [_layoutManager locationForGlyphAtIndex: range.location]; + [_layoutManager locationForGlyphAtIndex: range.location]; #if DEBUG_GETLINEFRAGMENTRECT NSLog(@" backRect: %@", NSStringFromRect(backRect)); @@ -764,11 +767,11 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, if (i > 0) { if (!NSLocationInRange(range.location, _glyphCacheRange)) loadGlyphAndCharacterCacheForLocation( - self, range.location - 1); + self, range.location - 1); NSInteger character = - _characterCache[range.location - 1 - - _glyphCacheRange.location]; + _characterCache[range.location - 1 - + _glyphCacheRange.location]; if (character == ' ') { // Add some more pixels from here blankCount++; @@ -871,13 +874,13 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, // of its code (like filing the typesetter layout info) should really be // moved to the layoutNextFragment mehod [self getLineFragmentRect: &_scanRect - usedRect: &lineFragmentUsedRect - remainingRect: &remainingRect - forStartingGlyphAtIndex: _nextGlyphLocation - proposedRect: proposedRect - lineSpacing: 1 - paragraphSpacingBefore: 0 - paragraphSpacingAfter: 0]; + usedRect: &lineFragmentUsedRect + remainingRect: &remainingRect + forStartingGlyphAtIndex: _nextGlyphLocation + proposedRect: proposedRect + lineSpacing: 1 + paragraphSpacingBefore: 0 + paragraphSpacingAfter: 0]; } - (void) fetchAttributes { @@ -947,15 +950,15 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, _fontAscender = ceilf([_font ascender]); _fontDefaultLineHeight = ceilf([_font defaultLineHeightForFont]); _positionOfGlyph = (void *) [_font - methodForSelector: @selector(positionOfGlyph: - precededByGlyph:isNominal:)]; + methodForSelector: @selector(positionOfGlyph: + precededByGlyph:isNominal:)]; [_font getGlyphs: &spaceGlyph forCharacters: &space length: 1]; _whitespaceAdvancement = [_font advancementForGlyph: spaceGlyph].width; } - if ((_currentParagraphStyle = - [_attributes objectForKey: NSParagraphStyleAttributeName]) == nil) + if ((_currentParagraphStyle = [_attributes + objectForKey: NSParagraphStyleAttributeName]) == nil) #if DEBUG_FETCHATTRIBUTES NSLog(@"using default paragraph style"); #endif @@ -964,8 +967,8 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, _alignment = [_currentParagraphStyle alignment]; _currentParagraphBidiLevel = 0; if (_bidiLevels) { - NSRange paragraphRange = - [_string paragraphRangeForRange: NSMakeRange(characterIndex, 0)]; + NSRange paragraphRange = [_string + paragraphRangeForRange: NSMakeRange(characterIndex, 0)]; _currentParagraphBidiLevel = _bidiLevels[paragraphRange.location]; } if (_alignment == NSNaturalTextAlignment) { @@ -1058,30 +1061,30 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, _fontAscender = ceilf([_font ascender]); _fontDefaultLineHeight = ceilf([_font defaultLineHeightForFont]); _positionOfGlyph = (void *) [_font - methodForSelector: @selector(positionOfGlyph: - precededByGlyph:isNominal:)]; + methodForSelector: @selector(positionOfGlyph: + precededByGlyph:isNominal:)]; } if (((_paragraphBreak && _nextGlyphLocation >= _numberOfGlyphs) || _numberOfGlyphs == 0)) { NSRect remainingRect; // Ignored for now _scanRect.size.height = - MAX(_scanRect.size.height, _fontDefaultLineHeight); + MAX(_scanRect.size.height, _fontDefaultLineHeight); if (_currentParagraphStyle) { if (_currentParagraphStyle.maximumLineHeight != 0) { _scanRect.size.height = - MIN(_scanRect.size.height, - _currentParagraphStyle.maximumLineHeight); + MIN(_scanRect.size.height, + _currentParagraphStyle.maximumLineHeight); } _scanRect.size.height = - MAX(_scanRect.size.height, - _currentParagraphStyle.minimumLineHeight); + MAX(_scanRect.size.height, + _currentParagraphStyle.minimumLineHeight); } _scanRect = - [_container lineFragmentRectForProposedRect: _scanRect - sweepDirection: NSLineSweepRight - movementDirection: NSLineMovesDown - remainingRect: &remainingRect]; + [_container lineFragmentRectForProposedRect: _scanRect + sweepDirection: NSLineSweepRight + movementDirection: NSLineMovesDown + remainingRect: &remainingRect]; NSRect usedRect = _scanRect; usedRect.size.width = 10; [_layoutManager setExtraLineFragmentRect: _scanRect @@ -1105,9 +1108,9 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, } - (void) insertGlyphs: (const NSGlyph *) glyphs - length: (NSUInteger) length - forStartingGlyphAtIndex: (NSUInteger) glyphIndex - characterIndex: (NSUInteger) characterIndex + length: (NSUInteger) length + forStartingGlyphAtIndex: (NSUInteger) glyphIndex + characterIndex: (NSUInteger) characterIndex { NSUnimplementedMethod(); } @@ -1202,15 +1205,16 @@ static void loadGlyphAndCharacterCacheForLocation(NSTypesetter_concrete *self, if (_bidiLevels == NULL) { _bidiLevelsCapacity = MAX([_attributedString length], 32); _bidiLevels = (uint8_t *) NSZoneMalloc( - [self zone], _bidiLevelsCapacity * sizeof(uint8_t)); + [self zone], _bidiLevelsCapacity * sizeof(uint8_t)); // Anything new is left-to-right by default bzero(_bidiLevels, _bidiLevelsCapacity); } if (_bidiLevelsCapacity < NSMaxRange(glyphRange)) { NSInteger newBidiLevelsCapacity = - MAX(_bidiLevelsCapacity * 2, NSMaxRange(glyphRange)); - _bidiLevels = (uint8_t *) NSZoneRealloc( - [self zone], _bidiLevels, newBidiLevelsCapacity * sizeof(uint8_t)); + MAX(_bidiLevelsCapacity * 2, NSMaxRange(glyphRange)); + _bidiLevels = (uint8_t *) NSZoneRealloc([self zone], _bidiLevels, + newBidiLevelsCapacity * + sizeof(uint8_t)); // Anything new is left-to-right by default bzero(_bidiLevels + _bidiLevelsCapacity, newBidiLevelsCapacity - _bidiLevelsCapacity); diff --git a/AppKit/NSTextView.subproj/NSUndoTextOperation.m b/AppKit/NSTextView.subproj/NSUndoTextOperation.m index fe39f352..d90f6c9b 100644 --- a/AppKit/NSTextView.subproj/NSUndoTextOperation.m +++ b/AppKit/NSTextView.subproj/NSUndoTextOperation.m @@ -44,12 +44,12 @@ do { NSRange effectiveRange; NSDictionary *attrs = - [textStorage attributesAtIndex: location - effectiveRange: &effectiveRange]; + [textStorage attributesAtIndex: location + effectiveRange: &effectiveRange]; NSRange attrRange = NSIntersectionRange(range, effectiveRange); _NSAttributes *attributes = [[[_NSAttributes alloc] - initWithAttributes: attrs - range: attrRange] autorelease]; + initWithAttributes: attrs + range: attrRange] autorelease]; [_attributesArray addObject: attributes]; location = NSMaxRange(effectiveRange); @@ -150,7 +150,7 @@ undoManager: undoManager])) { _replacementRange = replacementRange; _attributedString = [[layoutManager.textStorage - attributedSubstringFromRange: affectedRange] mutableCopy]; + attributedSubstringFromRange: affectedRange] mutableCopy]; } return self; } @@ -189,9 +189,10 @@ _affectedRange.length += delta; _affectedRange.location -= delta; NSAttributedString *killedString = [string - attributedSubstringFromRange: NSMakeRange( - _affectedRange.location, - delta)]; + attributedSubstringFromRange: NSMakeRange( + _affectedRange + .location, + delta)]; [_attributedString insertAttributedString: killedString atIndex: 0]; } @@ -207,19 +208,19 @@ // Register the undo/redo operation NSUndoTyping *undoOperation = [[[[self class] alloc] - initWithAffectedRange: _replacementRange - layoutManager: _layoutManager - undoManager: _undoManager - replacementRange: _affectedRange] autorelease]; + initWithAffectedRange: _replacementRange + layoutManager: _layoutManager + undoManager: _undoManager + replacementRange: _affectedRange] autorelease]; [[_undoManager prepareWithInvocationTarget: undoOperation] - undoRedo: textStorage]; + undoRedo: textStorage]; // Undo the change // Reset the old value and select it [textStorage replaceCharactersInRange: _replacementRange withAttributedString: _attributedString]; [[self firstTextViewForTextStorage: textStorage] - setSelectedRange: _affectedRange]; + setSelectedRange: _affectedRange]; [[self firstTextViewForTextStorage: textStorage] didChangeText]; } @@ -239,8 +240,8 @@ layoutManager: layoutManager undoManager: undoManager])) { _attributes = [[_NSAttributeRun alloc] - initWithTextStorage: layoutManager.textStorage - range: affectedRange]; + initWithTextStorage: layoutManager.textStorage + range: affectedRange]; } return self; } @@ -256,11 +257,11 @@ // Register the undo/redo operation NSUndoSetAttributes *undoOperation = [[[[self class] alloc] - initWithAffectedRange: _affectedRange - layoutManager: _layoutManager - undoManager: _undoManager] autorelease]; + initWithAffectedRange: _affectedRange + layoutManager: _layoutManager + undoManager: _undoManager] autorelease]; [[_undoManager prepareWithInvocationTarget: undoOperation] - undoRedo: textStorage]; + undoRedo: textStorage]; // Undo the change [_attributes restoreAttributesOfTextStorage: textStorage]; @@ -280,7 +281,7 @@ undoManager: undoManager])) { _replacementRange = replacementRange; _attributedString = [[layoutManager.textStorage - attributedSubstringFromRange: affectedRange] retain]; + attributedSubstringFromRange: affectedRange] retain]; } return self; } @@ -296,19 +297,19 @@ // Register the undo/redo operation NSUndoReplaceCharacters *undoOperation = [[[[self class] alloc] - initWithAffectedRange: _replacementRange - layoutManager: _layoutManager - undoManager: _undoManager - replacementRange: _affectedRange] autorelease]; + initWithAffectedRange: _replacementRange + layoutManager: _layoutManager + undoManager: _undoManager + replacementRange: _affectedRange] autorelease]; [[_undoManager prepareWithInvocationTarget: undoOperation] - undoRedo: textStorage]; + undoRedo: textStorage]; // Undo the change // Reset the old value and select it [textStorage replaceCharactersInRange: _replacementRange withAttributedString: _attributedString]; [[self firstTextViewForTextStorage: textStorage] - setSelectedRange: _affectedRange]; + setSelectedRange: _affectedRange]; [[self firstTextViewForTextStorage: textStorage] didChangeText]; } diff --git a/AppKit/NSThemeFrame.m b/AppKit/NSThemeFrame.m index e13aea46..0ec827c0 100644 --- a/AppKit/NSThemeFrame.m +++ b/AppKit/NSThemeFrame.m @@ -99,22 +99,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // subtracts menu height but not toolbar height NSRect contentFrame = [[[self window] class] - contentRectForFrameRect: [self bounds] - styleMask: [[self window] styleMask]]; + contentRectForFrameRect: [self bounds] + styleMask: [[self window] styleMask]]; // If the class thinks there is a menu but the instance does not want an // instance we need to add the menu height back to the content view as // contentRectForFrameRect subtracts it if ([[[self window] class] - hasMainMenuForStyleMask: [[self window] styleMask]]) { + hasMainMenuForStyleMask: [[self window] styleMask]]) { if (![[self window] hasMainMenu]) contentFrame.size.height += [NSMainMenuView menuHeight]; } NSRect menuFrame = (menuView != nil) ? [menuView frame] : NSZeroRect; NSRect toolbarFrame = - (toolbarView != nil) ? [toolbarView frame] : NSZeroRect; + (toolbarView != nil) ? [toolbarView frame] : NSZeroRect; menuFrame.origin.y = NSMaxY(contentFrame); menuFrame.origin.x = contentFrame.origin.x; @@ -138,13 +138,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSPoint origin = [[self window] frame].origin; NSPoint firstLocation = - [[self window] convertBaseToScreen: [event locationInWindow]]; + [[self window] convertBaseToScreen: [event locationInWindow]]; do { - event = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; NSPoint delta = - [[self window] convertBaseToScreen: [event locationInWindow]]; + [[self window] convertBaseToScreen: [event locationInWindow]]; delta.x -= firstLocation.x; delta.y -= firstLocation.y; diff --git a/AppKit/NSToolTipWindow.m b/AppKit/NSToolTipWindow.m index 77b300b6..f92403ce 100644 --- a/AppKit/NSToolTipWindow.m +++ b/AppKit/NSToolTipWindow.m @@ -41,10 +41,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (singleton == nil) { singleton = [[NSToolTipWindow alloc] - initWithContentRect: NSMakeRect(0, 0, 20, 20) - styleMask: NSBorderlessWindowMask - backing: NSBackingStoreBuffered - defer: NO]; + initWithContentRect: NSMakeRect(0, 0, 20, 20) + styleMask: NSBorderlessWindowMask + backing: NSBackingStoreBuffered + defer: NO]; [singleton setLevel: NSPopUpMenuWindowLevel]; } @@ -62,7 +62,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ defer: defer]; _textField = [[NSTextField alloc] - initWithFrame: contentRect]; // Will be adjusted later. + initWithFrame: contentRect]; // Will be adjusted later. [_textField setFrameOrigin: NSMakePoint(2., -3.)]; // Should be (0., 0.). [_textField setFont: [NSFont toolTipsFontOfSize: 0.]]; [_textField setEditable: NO]; @@ -103,7 +103,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ messageSize = [[NSScreen mainScreen] visibleFrame].size; if ([[NSUserDefaults standardUserDefaults] - boolForKey: @"NSToolTipAutoWrappingDisabled"] == NO) { + boolForKey: @"NSToolTipAutoWrappingDisabled"] == NO) { messageSize.width /= 4.; } else { messageSize.width = NSStringDrawerLargeDimension; @@ -111,11 +111,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSStringDrawer *stringDrawer = [NSStringDrawer sharedStringDrawer]; messageSize = [stringDrawer - sizeOfString: [_textField stringValue] - withAttributes: @{ - NSFontAttributeName : [NSFont toolTipsFontOfSize: 0.] - } - inSize: messageSize]; + sizeOfString: [_textField stringValue] + withAttributes: @{ + NSFontAttributeName : [NSFont toolTipsFontOfSize: 0.] + } + inSize: messageSize]; messageSize.width += TEXTFIELD_MARGIN * 2; messageSize.width += 2.; // Shouldn't be neccessary. messageSize.height += TEXTFIELD_MARGIN * 2; diff --git a/AppKit/NSToolbar.subproj/NSToolbar.m b/AppKit/NSToolbar.subproj/NSToolbar.m index b46dc6b3..9ddfcd1e 100644 --- a/AppKit/NSToolbar.subproj/NSToolbar.m +++ b/AppKit/NSToolbar.subproj/NSToolbar.m @@ -35,13 +35,13 @@ NSSize _NSToolbarIconSizeRegular = {32, 32}; NSSize _NSToolbarIconSizeSmall = {24, 24}; const NSNotificationName NSToolbarWillAddItemNotification = - @"NSToolbarWillAddItemNotification"; + @"NSToolbarWillAddItemNotification"; const NSNotificationName NSToolbarDidRemoveItemNotification = - @"NSToolbarDidRemoveItemNotification"; + @"NSToolbarDidRemoveItemNotification"; // Private inter-toolbar notification. const NSNotificationName NSToolbarChangeAppearanceNotification = - @"__NSToolbarChangeAppearanceNotification"; + @"__NSToolbarChangeAppearanceNotification"; @interface NSWindow (NSToolbarPrivate) - (void) _toolbarSizeDidChangeFromOldHeight: (CGFloat) oldHeight; @@ -54,8 +54,8 @@ const NSNotificationName NSToolbarChangeAppearanceNotification = @implementation NSToolbar - (NSDictionary *) _labelAttributesForSizeMode: (NSToolbarSizeMode) sizeMode { - NSMutableParagraphStyle *style = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; + NSMutableParagraphStyle *style = [[[NSParagraphStyle defaultParagraphStyle] + mutableCopy] autorelease]; [style setLineBreakMode: NSLineBreakByClipping]; [style setAlignment: NSCenterTextAlignment]; @@ -63,17 +63,19 @@ const NSNotificationName NSToolbarChangeAppearanceNotification = switch (sizeMode) { case NSToolbarSizeModeSmall: return [NSDictionary - dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize: 10.0], - NSFontAttributeName, style, - NSParagraphStyleAttributeName, nil]; + dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize: 10.0], + NSFontAttributeName, style, + NSParagraphStyleAttributeName, + nil]; case NSToolbarSizeModeRegular: case NSToolbarSizeModeDefault: default: return [NSDictionary - dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize: 11.0], - NSFontAttributeName, style, - NSParagraphStyleAttributeName, nil]; + dictionaryWithObjectsAndKeys: [NSFont systemFontOfSize: 11.0], + NSFontAttributeName, style, + NSParagraphStyleAttributeName, + nil]; } } @@ -103,10 +105,10 @@ const NSNotificationName NSToolbarChangeAppearanceNotification = _loadDefaultItems = YES; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(toolbarChangedAppearance:) - name: NSToolbarChangeAppearanceNotification - object: nil]; + addObserver: self + selector: @selector(toolbarChangedAppearance:) + name: NSToolbarChangeAppearanceNotification + object: nil]; // these cause notification loops // [[NSNotificationCenter defaultCenter] addObserver:self // selector:@selector(toolbarWillAddItem:) @@ -151,7 +153,7 @@ const NSNotificationName NSToolbarChangeAppearanceNotification = - (BOOL) loadConfiguration { NSDictionary *dictionary = [[NSUserDefaults standardUserDefaults] - objectForKey: [self _configurationKey]]; + objectForKey: [self _configurationKey]]; if (dictionary != nil) { _isLoadingConfiguration = YES; @@ -166,8 +168,8 @@ const NSNotificationName NSToolbarChangeAppearanceNotification = - (void) saveConfiguration { if (_isLoadingConfiguration == NO) { [[NSUserDefaults standardUserDefaults] - setObject: [self configurationDictionary] - forKey: [self _configurationKey]]; + setObject: [self configurationDictionary] + forKey: [self _configurationKey]]; } } @@ -221,13 +223,13 @@ const NSNotificationName NSToolbarChangeAppearanceNotification = - (NSDictionary *) configurationDictionary { NSDictionary *dictionary = [NSDictionary - dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt: _displayMode], @"displayMode", - [NSNumber numberWithInt: _sizeMode], @"sizeMode", - [NSNumber numberWithBool: _visible], @"isVisible", - [NSNumber numberWithBool: _autosavesConfiguration], - @"autosavesConfiguration", [self itemIdentifiers], - @"itemIdentifiers", nil]; + dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt: _displayMode], @"displayMode", + [NSNumber numberWithInt: _sizeMode], @"sizeMode", + [NSNumber numberWithBool: _visible], @"isVisible", + [NSNumber numberWithBool: _autosavesConfiguration], + @"autosavesConfiguration", [self itemIdentifiers], + @"itemIdentifiers", nil]; return dictionary; } @@ -264,11 +266,11 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { if (_delegate == nil || standardItem) item = [[[[self toolbarItemClass] alloc] - initWithItemIdentifier: identifier] autorelease]; + initWithItemIdentifier: identifier] autorelease]; else { item = [_delegate toolbar: self - itemForItemIdentifier: identifier - willBeInsertedIntoToolbar: intoToolbar]; + itemForItemIdentifier: identifier + willBeInsertedIntoToolbar: intoToolbar]; } if (item != nil) { @@ -296,9 +298,9 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { - (void) _insertItem: (NSToolbarItem *) item atIndex: (NSInteger) index { [[NSNotificationCenter defaultCenter] - postNotificationName: NSToolbarWillAddItemNotification - object: self - userInfo: @{@"item" : item, @"index" : @(index)}]; + postNotificationName: NSToolbarWillAddItemNotification + object: self + userInfo: @{@"item" : item, @"index" : @(index)}]; [_items insertObject: item atIndex: index]; [_view _insertItem: item atIndex: index]; @@ -311,9 +313,9 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { [_view _removeItemAtIndex: index]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSToolbarDidRemoveItemNotification - object: self - userInfo: @{@"item" : item, @"index" : @(index)}]; + postNotificationName: NSToolbarDidRemoveItemNotification + object: self + userInfo: @{@"item" : item, @"index" : @(index)}]; } - (void) toolbarWillAddItem: (NSNotification *) note { @@ -378,10 +380,9 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { NSArray *result = nil; if ([_delegate - respondsToSelector: @selector(toolbarDefaultItemIdentifiers:)]) - result = [self - _itemsWithIdentifiers: [_delegate - toolbarDefaultItemIdentifiers: self]]; + respondsToSelector: @selector(toolbarDefaultItemIdentifiers:)]) + result = [self _itemsWithIdentifiers: + [_delegate toolbarDefaultItemIdentifiers: self]]; if (result == nil) result = _defaultItems; @@ -432,9 +433,10 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { NSString *name; SEL selector; } notes[] = { - {NSToolbarWillAddItemNotification, @selector(toolbarWillAddItem:)}, - {NSToolbarDidRemoveItemNotification, @selector(toolbarDidRemoveItem:)}, - {nil, NULL}}; + {NSToolbarWillAddItemNotification, @selector(toolbarWillAddItem:)}, + {NSToolbarDidRemoveItemNotification, + @selector(toolbarDidRemoveItem:)}, + {nil, NULL}}; NSInteger i; if (_delegate != nil) @@ -468,8 +470,8 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { [_window _toolbarSizeDidChangeFromOldHeight: [self visibleHeight]]; if (global) [[NSNotificationCenter defaultCenter] - postNotificationName: NSToolbarChangeAppearanceNotification - object: self]; + postNotificationName: NSToolbarChangeAppearanceNotification + object: self]; } - (void) setVisible: (BOOL) flag { @@ -494,12 +496,12 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { - (void) setConfigurationFromDictionary: (NSDictionary *) dictionary { NSToolbarDisplayMode displayMode = - [[dictionary objectForKey: @"displayMode"] intValue]; + [[dictionary objectForKey: @"displayMode"] intValue]; NSToolbarSizeMode sizeMode = - [[dictionary objectForKey: @"sizeMode"] intValue]; + [[dictionary objectForKey: @"sizeMode"] intValue]; BOOL visible = [[dictionary objectForKey: @"isVisible"] boolValue]; BOOL autosavesConfiguration = - [[dictionary objectForKey: @"autosavesConfiguration"] boolValue]; + [[dictionary objectForKey: @"autosavesConfiguration"] boolValue]; NSArray *identifiers = [dictionary objectForKey: @"itemIdentifiers"]; [self setDisplayMode: displayMode]; @@ -537,10 +539,10 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { - (void) didSelectToolbarItem: (NSString *) identifier { // Cocoa says the selectedItemIdentifier is updated only if the item is in // the selectableItems - if ([_delegate - respondsToSelector: @selector(toolbarSelectableItemIdentifiers:)]) { + if ([_delegate respondsToSelector: @selector + (toolbarSelectableItemIdentifiers:)]) { NSArray *selectableIdentifiers = - [_delegate toolbarSelectableItemIdentifiers: self]; + [_delegate toolbarSelectableItemIdentifiers: self]; if ([selectableIdentifiers containsObject: identifier]) { [self setSelectedItemIdentifier: identifier]; } @@ -564,15 +566,15 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { if (_palette != nil || _allowsUserCustomization == NO || _visible == NO) return; - _palette = - [[NSToolbarCustomizationPalette toolbarCustomizationPalette] retain]; + _palette = [[NSToolbarCustomizationPalette toolbarCustomizationPalette] + retain]; [_palette setToolbar: self]; [NSApp beginSheet: _palette - modalForWindow: _window - modalDelegate: self - didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) - contextInfo: NULL]; + modalForWindow: _window + modalDelegate: self + didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) + contextInfo: NULL]; } - (void) _setWindow: (NSWindow *) window { @@ -583,10 +585,9 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { NSArray *result = nil; if ([_delegate - respondsToSelector: @selector(toolbarAllowedItemIdentifiers:)]) - result = [self - _itemsWithIdentifiers: [_delegate - toolbarAllowedItemIdentifiers: self]]; + respondsToSelector: @selector(toolbarAllowedItemIdentifiers:)]) + result = [self _itemsWithIdentifiers: + [_delegate toolbarAllowedItemIdentifiers: self]]; if (result == nil) result = _allowedItems; @@ -599,22 +600,22 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { NSUnimplementedMethod(); else { _identifier = - [[coder decodeObjectForKey: @"NSToolbarIdentifier"] retain]; + [[coder decodeObjectForKey: @"NSToolbarIdentifier"] retain]; [self setDelegate: [coder decodeObjectForKey: @"NSToolbarDelegate"]]; _items = [[coder decodeObjectForKey: @"NSToolbarIBDefaultItems"] - mutableCopy]; + mutableCopy]; _selectedItemIdentifier = nil; _allowedItems = - [[coder decodeObjectForKey: @"NSToolbarIBAllowedItems"] retain]; + [[coder decodeObjectForKey: @"NSToolbarIBAllowedItems"] retain]; _defaultItems = - [[coder decodeObjectForKey: @"NSToolbarIBDefaultItems"] retain]; - _selectableItems = - [[coder decodeObjectForKey: @"NSToolbarIBSelectableItems"] retain]; + [[coder decodeObjectForKey: @"NSToolbarIBDefaultItems"] retain]; + _selectableItems = [[coder + decodeObjectForKey: @"NSToolbarIBSelectableItems"] retain]; _identifiedItems = [[coder - decodeObjectForKey: @"NSToolbarIBIdentifiedItems"] mutableCopy]; + decodeObjectForKey: @"NSToolbarIBIdentifiedItems"] mutableCopy]; [[_identifiedItems allValues] - makeObjectsPerformSelector: @selector(_setToolbar:) - withObject: self]; + makeObjectsPerformSelector: @selector(_setToolbar:) + withObject: self]; _window = nil; _view = [[NSToolbarView alloc] init]; [_view setToolbar: self]; @@ -622,17 +623,17 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { _sizeMode = [coder decodeIntForKey: @"NSToolbarSizeMode"]; _displayMode = [coder decodeIntForKey: @"NSToolbarDisplayMode"]; _autosavesConfiguration = - [coder decodeBoolForKey: @"NSToolbarAutosavesConfiguration"]; + [coder decodeBoolForKey: @"NSToolbarAutosavesConfiguration"]; _visible = YES; _allowsUserCustomization = - [coder decodeBoolForKey: @"NSToolbarAllowsUserCustomization"]; + [coder decodeBoolForKey: @"NSToolbarAllowsUserCustomization"]; _isLoadingConfiguration = NO; _loadDefaultItems = NO; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(toolbarChangedAppearance:) - name: NSToolbarChangeAppearanceNotification - object: nil]; + addObserver: self + selector: @selector(toolbarChangedAppearance:) + name: NSToolbarChangeAppearanceNotification + object: nil]; /* NSToolbarPrefersToBeShown = 1; NSToolbarShowsBaselineSeparator = 1; @@ -644,8 +645,8 @@ static BOOL isStandardItemIdentifier(NSString *identifier) { - (void) postAwakeFromNib { // this causes animation, display, frame changes, do post in initWithCoder: [[NSNotificationCenter defaultCenter] - postNotificationName: NSToolbarChangeAppearanceNotification - object: self]; + postNotificationName: NSToolbarChangeAppearanceNotification + object: self]; } @end diff --git a/AppKit/NSToolbar.subproj/NSToolbarCustomizationPalette.m b/AppKit/NSToolbar.subproj/NSToolbarCustomizationPalette.m index ac50fcb8..cfc3b5ce 100644 --- a/AppKit/NSToolbar.subproj/NSToolbarCustomizationPalette.m +++ b/AppKit/NSToolbar.subproj/NSToolbarCustomizationPalette.m @@ -69,8 +69,9 @@ static NSToolbarCustomizationPalette *_nextPanel; [_displayModePopUp selectItemAtIndex: (index == -1) ? 0 : index]; [_smallSizeModeButton - setState: ([_toolbar sizeMode] == NSToolbarSizeModeSmall) ? NSOnState - : NSOffState]; + setState: ([_toolbar sizeMode] == NSToolbarSizeModeSmall) + ? NSOnState + : NSOffState]; [self setDefaultButtonCell: [_button cell]]; NSSize oldSize, newSize; @@ -113,8 +114,8 @@ static NSToolbarCustomizationPalette *_nextPanel; - (void) sizeModeChanged: sender { NSToolbarSizeMode sizeMode = [_smallSizeModeButton state] - ? NSToolbarSizeModeSmall - : NSToolbarSizeModeRegular; + ? NSToolbarSizeModeSmall + : NSToolbarSizeModeRegular; [_toolbar setSizeMode: sizeMode]; } diff --git a/AppKit/NSToolbar.subproj/NSToolbarCustomizationView.m b/AppKit/NSToolbar.subproj/NSToolbarCustomizationView.m index 7c2fdfcb..bfbd9c06 100644 --- a/AppKit/NSToolbar.subproj/NSToolbarCustomizationView.m +++ b/AppKit/NSToolbar.subproj/NSToolbarCustomizationView.m @@ -138,11 +138,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSData *data = nil; if (_isDefaultSetView) { - image = - [[[NSImage alloc] initWithSize: [self bounds].size] autorelease]; - data = [NSArchiver - archivedDataWithRootObject: [[_toolbar _defaultToolbarItems] - valueForKey: @"itemIdentifier"]]; + image = [[[NSImage alloc] initWithSize: [self bounds].size] + autorelease]; + data = [NSArchiver archivedDataWithRootObject: + [[_toolbar _defaultToolbarItems] + valueForKey: @"itemIdentifier"]]; [image setCachedSeparately: YES]; [image lockFocus]; @@ -162,9 +162,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSToolbarItem *item = [items objectAtIndex: i]; image = [[[NSImage alloc] initWithSize: frames[i].size] - autorelease]; + autorelease]; data = [NSArchiver - archivedDataWithRootObject: [item itemIdentifier]]; + archivedDataWithRootObject: [item itemIdentifier]]; [image setCachedSeparately: YES]; [image lockFocus]; @@ -176,18 +176,19 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (data != nil) { [pasteboard - declareTypes: - [NSArray arrayWithObject: NSToolbarItemIdentifierPboardType] - owner: nil]; + declareTypes: [NSArray + arrayWithObject: + NSToolbarItemIdentifierPboardType] + owner: nil]; [pasteboard setData: data forType: NSToolbarItemIdentifierPboardType]; [self dragImage: image - at: NSMakePoint(0, 0) - offset: NSMakeSize(0, 0) - event: event - pasteboard: pasteboard - source: self - slideBack: YES]; + at: NSMakePoint(0, 0) + offset: NSMakeSize(0, 0) + event: event + pasteboard: pasteboard + source: self + slideBack: YES]; } } @@ -198,4 +199,4 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @end const NSPasteboardType NSToolbarItemIdentifierPboardType = - @"NSToolbarItemIdentifierPboardType"; + @"NSToolbarItemIdentifierPboardType"; diff --git a/AppKit/NSToolbar.subproj/NSToolbarItem.m b/AppKit/NSToolbar.subproj/NSToolbarItem.m index 24fbf766..081bb271 100644 --- a/AppKit/NSToolbar.subproj/NSToolbarItem.m +++ b/AppKit/NSToolbar.subproj/NSToolbarItem.m @@ -32,19 +32,19 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import const NSToolbarItemIdentifier NSToolbarCustomizeToolbarItemIdentifier = - @"NSToolbarCustomizeToolbarItem"; + @"NSToolbarCustomizeToolbarItem"; const NSToolbarItemIdentifier NSToolbarFlexibleSpaceItemIdentifier = - @"NSToolbarFlexibleSpaceItem"; + @"NSToolbarFlexibleSpaceItem"; const NSToolbarItemIdentifier NSToolbarPrintItemIdentifier = - @"NSToolbarPrintItem"; + @"NSToolbarPrintItem"; const NSToolbarItemIdentifier NSToolbarSeparatorItemIdentifier = - @"NSToolbarSeparatorItem"; + @"NSToolbarSeparatorItem"; const NSToolbarItemIdentifier NSToolbarShowColorsItemIdentifier = - @"NSToolbarShowColorsItem"; + @"NSToolbarShowColorsItem"; const NSToolbarItemIdentifier NSToolbarShowFontsItemIdentifier = - @"NSToolbarShowFontsItem"; + @"NSToolbarShowFontsItem"; const NSToolbarItemIdentifier NSToolbarSpaceItemIdentifier = - @"NSToolbarSpaceItem"; + @"NSToolbarSpaceItem"; extern NSSize _NSToolbarSizeRegular; extern NSSize _NSToolbarSizeSmall; @@ -69,10 +69,11 @@ extern NSSize _NSToolbarIconSizeSmall; [self setLabel: @""]; [self setPaletteLabel: NSLocalizedStringFromTableInBundle( - @"Separator", nil, - [NSBundle - bundleForClass: [NSToolbarItem class]], - @"Describes a toolbar separator item")]; + @"Separator", nil, + [NSBundle + bundleForClass: [NSToolbarItem + class]], + @"Describes a toolbar separator item")]; [self setEnabled: NO]; size = [self minSize]; @@ -83,15 +84,16 @@ extern NSSize _NSToolbarIconSizeSmall; [self setMaxSize: size]; } else if ([_itemIdentifier - isEqualToString: NSToolbarSpaceItemIdentifier]) { + isEqualToString: NSToolbarSpaceItemIdentifier]) { NSSize size; [self setLabel: @""]; [self setPaletteLabel: NSLocalizedStringFromTableInBundle( - @"Space", nil, - [NSBundle - bundleForClass: [NSToolbarItem class]], - @"Describes a toolbar space item")]; + @"Space", nil, + [NSBundle + bundleForClass: [NSToolbarItem + class]], + @"Describes a toolbar space item")]; [self setEnabled: NO]; size = [self minSize]; @@ -102,15 +104,16 @@ extern NSSize _NSToolbarIconSizeSmall; [self setMaxSize: size]; } else if ([_itemIdentifier - isEqualToString: NSToolbarFlexibleSpaceItemIdentifier]) { + isEqualToString: NSToolbarFlexibleSpaceItemIdentifier]) { NSSize size; [self setLabel: @""]; - [self setPaletteLabel: NSLocalizedStringFromTableInBundle( - @"Flexible Space", nil, - [NSBundle - bundleForClass: [NSToolbarItem class]], - @"Describes a toolbar flexible space item")]; + [self setPaletteLabel: + NSLocalizedStringFromTableInBundle( + @"Flexible Space", nil, + [NSBundle + bundleForClass: [NSToolbarItem class]], + @"Describes a toolbar flexible space item")]; [self setEnabled: NO]; size = [self minSize]; @@ -119,80 +122,93 @@ extern NSSize _NSToolbarIconSizeSmall; [self setMaxSize: NSMakeSize(-1, [self maxSize].height)]; } else if ([_itemIdentifier - isEqualToString: NSToolbarShowColorsItemIdentifier]) { + isEqualToString: NSToolbarShowColorsItemIdentifier]) { [self setLabel: NSLocalizedStringFromTableInBundle( - @"Colors", nil, - [NSBundle bundleForClass: [NSToolbarItem class]], - @"Reveals a color picker")]; + @"Colors", nil, + [NSBundle + bundleForClass: [NSToolbarItem class]], + @"Reveals a color picker")]; [self setPaletteLabel: NSLocalizedStringFromTableInBundle( - @"Show Colors", nil, - [NSBundle - bundleForClass: [NSToolbarItem class]], - @"Reveals a color picker")]; + @"Show Colors", nil, + [NSBundle + bundleForClass: [NSToolbarItem + class]], + @"Reveals a color picker")]; [self setTarget: [NSApplication sharedApplication]]; [self setAction: @selector(orderFrontColorPanel:)]; - [self - setImage: [NSImage imageNamed: NSToolbarShowColorsItemIdentifier]]; + [self setImage: [NSImage + imageNamed: NSToolbarShowColorsItemIdentifier]]; [self setToolTip: NSLocalizedStringFromTableInBundle( - @"Show the Colors panel.", nil, - [NSBundle bundleForClass: [NSToolbarItem class]], - @"Reveals a color picker")]; + @"Show the Colors panel.", nil, + [NSBundle bundleForClass: [NSToolbarItem + class]], + @"Reveals a color picker")]; } else if ([_itemIdentifier - isEqualToString: NSToolbarShowFontsItemIdentifier]) { + isEqualToString: NSToolbarShowFontsItemIdentifier]) { [self setLabel: NSLocalizedStringFromTableInBundle( - @"Fonts", nil, - [NSBundle bundleForClass: [NSToolbarItem class]], - @"Reveals a font picker")]; + @"Fonts", nil, + [NSBundle + bundleForClass: [NSToolbarItem class]], + @"Reveals a font picker")]; [self setPaletteLabel: NSLocalizedStringFromTableInBundle( - @"Show Fonts", nil, - [NSBundle - bundleForClass: [NSToolbarItem class]], - @"Reveals a font picker")]; + @"Show Fonts", nil, + [NSBundle + bundleForClass: [NSToolbarItem + class]], + @"Reveals a font picker")]; [self setTarget: [NSFontManager sharedFontManager]]; [self setAction: @selector(orderFrontFontPanel:)]; [self setImage: [NSImage imageNamed: NSToolbarShowFontsItemIdentifier]]; [self setToolTip: NSLocalizedStringFromTableInBundle( - @"Show the Fonts panel.", nil, - [NSBundle bundleForClass: [NSToolbarItem class]], - @"Reveals a font picker")]; + @"Show the Fonts panel.", nil, + [NSBundle bundleForClass: [NSToolbarItem + class]], + @"Reveals a font picker")]; } else if ([_itemIdentifier - isEqualToString: NSToolbarCustomizeToolbarItemIdentifier]) { + isEqualToString: + NSToolbarCustomizeToolbarItemIdentifier]) { [self setLabel: NSLocalizedStringFromTableInBundle( - @"Customize", nil, - [NSBundle bundleForClass: [NSToolbarItem class]], - @"Reveals a toolbar customization dialog")]; - [self setPaletteLabel: NSLocalizedStringFromTableInBundle( - @"Customize", nil, - [NSBundle - bundleForClass: [NSToolbarItem class]], - @"Reveals a toolbar customization dialog")]; + @"Customize", nil, + [NSBundle + bundleForClass: [NSToolbarItem class]], + @"Reveals a toolbar customization dialog")]; + [self setPaletteLabel: + NSLocalizedStringFromTableInBundle( + @"Customize", nil, + [NSBundle + bundleForClass: [NSToolbarItem class]], + @"Reveals a toolbar customization dialog")]; [self setTarget: nil]; [self setAction: @selector(runToolbarCustomizationPalette:)]; - [self - setImage: [NSImage - imageNamed: NSToolbarCustomizeToolbarItemIdentifier]]; + [self setImage: [NSImage + imageNamed: + NSToolbarCustomizeToolbarItemIdentifier]]; [self setToolTip: NSLocalizedStringFromTableInBundle( - @"Customize this toolbar.", nil, - [NSBundle bundleForClass: [NSToolbarItem class]], - @"Reveals a toolbar customization dialog")]; + @"Customize this toolbar.", nil, + [NSBundle bundleForClass: [NSToolbarItem + class]], + @"Reveals a toolbar customization dialog")]; } else if ([_itemIdentifier - isEqualToString: NSToolbarPrintItemIdentifier]) { + isEqualToString: NSToolbarPrintItemIdentifier]) { [self setLabel: NSLocalizedStringFromTableInBundle( - @"Print", nil, - [NSBundle bundleForClass: [NSToolbarItem class]], - @"")]; + @"Print", nil, + [NSBundle + bundleForClass: [NSToolbarItem class]], + @"")]; [self setPaletteLabel: NSLocalizedStringFromTableInBundle( - @"Print Document", nil, - [NSBundle - bundleForClass: [NSToolbarItem class]], - @"")]; + @"Print Document", nil, + [NSBundle + bundleForClass: [NSToolbarItem + class]], + @"")]; [self setTarget: nil]; [self setAction: @selector(printDocument:)]; [self setImage: [NSImage imageNamed: NSToolbarPrintItemIdentifier]]; [self setToolTip: NSLocalizedStringFromTableInBundle( - @"Print this document.", nil, - [NSBundle bundleForClass: [NSToolbarItem class]], - @"")]; + @"Print this document.", nil, + [NSBundle bundleForClass: [NSToolbarItem + class]], + @"")]; } } @@ -274,9 +290,9 @@ extern NSSize _NSToolbarIconSizeSmall; // FIX should update standard item for action/target/label changes? if (_menuFormRepresentation == nil && [self label] != nil) { _menuFormRepresentation = - [[NSMenuItem alloc] initWithTitle: [self label] - action: [self action] - keyEquivalent: @""]; + [[NSMenuItem alloc] initWithTitle: [self label] + action: [self action] + keyEquivalent: @""]; [_menuFormRepresentation setImage: [self image]]; [_menuFormRepresentation setTarget: [self target]]; [_menuFormRepresentation setRepresentedObject: self]; @@ -495,8 +511,8 @@ extern NSSize _NSToolbarIconSizeSmall; case NSToolbarDisplayModeDefault: default: return [_label - sizeWithAttributes: - [_toolbar _labelAttributesForSizeMode: [_toolbar sizeMode]]]; + sizeWithAttributes: [_toolbar _labelAttributesForSizeMode: + [_toolbar sizeMode]]]; } } @@ -529,7 +545,8 @@ extern NSSize _NSToolbarIconSizeSmall; result.height = maxSize.height; NSSize labelSize = [_label - sizeWithAttributes: [_toolbar _labelAttributesForSizeMode: sizeMode]]; + sizeWithAttributes: [_toolbar + _labelAttributesForSizeMode: sizeMode]]; labelSize.width += 8; // label margins switch (displayMode) { @@ -600,7 +617,7 @@ extern NSSize _NSToolbarIconSizeSmall; if ([_toolbar displayMode] != NSToolbarDisplayModeIconOnly) { NSMutableDictionary *attributes = [NSMutableDictionary - dictionaryWithDictionary: [_toolbar _labelAttributes]]; + dictionaryWithDictionary: [_toolbar _labelAttributes]]; NSColor *color = [self isEnabled] ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]; @@ -609,12 +626,12 @@ extern NSSize _NSToolbarIconSizeSmall; NSRect labelRect; labelRect.size = [_label sizeWithAttributes: attributes]; labelRect.origin.x = - floor((bounds.size.width - labelRect.size.width) / 2); + floor((bounds.size.width - labelRect.size.width) / 2); labelRect.origin.y = bounds.origin.y; if (!highlighted) { NSMutableDictionary *shadowAttributes = - [[attributes mutableCopy] autorelease]; + [[attributes mutableCopy] autorelease]; NSRect shadowRect = labelRect; [shadowAttributes setObject: [NSColor whiteColor] @@ -643,8 +660,8 @@ extern NSSize _NSToolbarIconSizeSmall; imageRect.origin.y = bounds.origin.y + labelHeight; imageRect.origin.x = - bounds.origin.x + - floor((bounds.size.width - imageRect.size.width) / 2); + bounds.origin.x + + floor((bounds.size.width - imageRect.size.width) / 2); CGContextRef ctx = NULL; if ([self isEnabled] == NO) { ctx = [[NSGraphicsContext currentContext] graphicsPort]; @@ -666,9 +683,9 @@ extern NSSize _NSToolbarIconSizeSmall; - (NSString *) description { return [NSString - stringWithFormat: @"<%@[%p] %@ label: \"%@\" image: %@ view: %@>", - [self class], self, _itemIdentifier, _label, - [self image], _view]; + stringWithFormat: @"<%@[%p] %@ label: \"%@\" image: %@ view: %@>", + [self class], self, _itemIdentifier, _label, + [self image], _view]; } - initWithCoder: (NSCoder *) coder { @@ -676,30 +693,31 @@ extern NSSize _NSToolbarIconSizeSmall; NSUnimplementedMethod(); else { _itemIdentifier = - [[coder decodeObjectForKey: @"NSToolbarItemIdentifier"] retain]; + [[coder decodeObjectForKey: @"NSToolbarItemIdentifier"] retain]; _enclosingView = [[NSToolbarItemView alloc] init]; [_enclosingView setToolbarItem: self]; [self setView: [coder decodeObjectForKey: @"NSToolbarItemView"]]; [self setTarget: [coder decodeObjectForKey: @"NSToolbarItemTarget"]]; [self setAction: NSSelectorFromString([coder - decodeObjectForKey: @"NSToolbarItemAction"])]; + decodeObjectForKey: @"NSToolbarItemAction"])]; [self setImage: [coder decodeObjectForKey: @"NSToolbarItemImage"]]; [self setLabel: [coder decodeObjectForKey: @"NSToolbarItemLabel"]]; - [self setPaletteLabel: - [coder decodeObjectForKey: @"NSToolbarItemPaletteLabel"]]; + [self setPaletteLabel: [coder decodeObjectForKey: + @"NSToolbarItemPaletteLabel"]]; _maxSize = [coder decodeSizeForKey: @"NSToolbarItemMaxSize"]; _minSize = [coder decodeSizeForKey: @"NSToolbarItemMinSize"]; [self setEnabled: [coder decodeBoolForKey: @"NSToolbarItemEnabled"]]; [self setTag: [coder decodeIntForKey: @"NSToolbarItemTag"]]; - [self setAutovalidates: - [coder decodeBoolForKey: @"NSToolbarItemAutovalidates"]]; + [self setAutovalidates: [coder decodeBoolForKey: + @"NSToolbarItemAutovalidates"]]; [self setToolTip: [coder decodeObjectForKey: @"NSToolbarItemToolTip"]]; [self setVisibilityPriority: - [coder decodeIntForKey: @"NSToolbarItemVisibilityPriority"]]; + [coder decodeIntForKey: + @"NSToolbarItemVisibilityPriority"]]; /* NSToolbarIsUserRemovable = 1; diff --git a/AppKit/NSToolbar.subproj/NSToolbarItemView.m b/AppKit/NSToolbar.subproj/NSToolbarItemView.m index a1d06b84..c1e8fa77 100644 --- a/AppKit/NSToolbar.subproj/NSToolbarItemView.m +++ b/AppKit/NSToolbar.subproj/NSToolbarItemView.m @@ -66,8 +66,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ CGFloat labelHeight = [_toolbarItem _labelSize].height; rect.size.height -= labelHeight; rect.origin.y += - labelHeight + - 4; // 4 is Cocotron magic padding (see NSToolbarItem drawInRect: + labelHeight + + 4; // 4 is Cocotron magic padding (see NSToolbarItem drawInRect: return rect; } @@ -112,31 +112,33 @@ const CGFloat kEdgeThickness = 2.f; - (void) drawRect: (NSRect) rect { if ([[_toolbarItem itemIdentifier] - isEqual: [[_toolbarItem toolbar] selectedItemIdentifier]]) { + isEqual: [[_toolbarItem toolbar] selectedItemIdentifier]]) { NSArray *colors = [NSArray - arrayWithObjects: [NSColor colorWithCalibratedWhite: kFillGrayLevel - alpha: 0], - [NSColor colorWithCalibratedWhite: kFillGrayLevel - alpha: 0.5], - [NSColor colorWithCalibratedWhite: kFillGrayLevel - alpha: 1], - [NSColor colorWithCalibratedWhite: kFillGrayLevel - alpha: 0.0], - nil]; + arrayWithObjects: + [NSColor colorWithCalibratedWhite: kFillGrayLevel + alpha: 0], + [NSColor colorWithCalibratedWhite: kFillGrayLevel + alpha: 0.5], + [NSColor colorWithCalibratedWhite: kFillGrayLevel + alpha: 1], + [NSColor colorWithCalibratedWhite: kFillGrayLevel + alpha: 0.0], + nil]; NSGradient *gradient = - [[[NSGradient alloc] initWithColors: colors] autorelease]; + [[[NSGradient alloc] initWithColors: colors] autorelease]; [gradient drawInRect: [self bounds] angle: 270]; // fill the edges colors = [NSArray - arrayWithObjects: [NSColor colorWithCalibratedWhite: kEdgeGrayLevel - alpha: 0], - [NSColor colorWithCalibratedWhite: kEdgeGrayLevel - alpha: 1], - [NSColor colorWithCalibratedWhite: kEdgeGrayLevel - alpha: 0.0], - nil]; + arrayWithObjects: + [NSColor colorWithCalibratedWhite: kEdgeGrayLevel + alpha: 0], + [NSColor colorWithCalibratedWhite: kEdgeGrayLevel + alpha: 1], + [NSColor colorWithCalibratedWhite: kEdgeGrayLevel + alpha: 0.0], + nil]; gradient = [[[NSGradient alloc] initWithColors: colors] autorelease]; NSRect edgeRect = [self bounds]; edgeRect.size.width = kEdgeThickness; @@ -160,14 +162,14 @@ const CGFloat kEdgeThickness = 2.f; _isHighlighted = NSMouseInRect(point, [self bounds], [self isFlipped]); [self setNeedsDisplay: YES]; - event = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while ([event type] != NSLeftMouseUp); if (_isHighlighted) { _isHighlighted = NO; [[_toolbarItem toolbar] - didSelectToolbarItem: [_toolbarItem itemIdentifier]]; + didSelectToolbarItem: [_toolbarItem itemIdentifier]]; [NSApp sendAction: [_toolbarItem action] to: [_toolbarItem target] from: _toolbarItem]; diff --git a/AppKit/NSToolbar.subproj/NSToolbarView.m b/AppKit/NSToolbar.subproj/NSToolbarView.m index ebaa8653..4b5923f3 100644 --- a/AppKit/NSToolbar.subproj/NSToolbarView.m +++ b/AppKit/NSToolbar.subproj/NSToolbarView.m @@ -127,10 +127,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSInteger totalVisible = 0; NSInteger priorities[4] = { - NSToolbarItemVisibilityPriorityUser, - NSToolbarItemVisibilityPriorityHigh, - NSToolbarItemVisibilityPriorityStandard, - NSToolbarItemVisibilityPriorityLow, + NSToolbarItemVisibilityPriorityUser, + NSToolbarItemVisibilityPriorityHigh, + NSToolbarItemVisibilityPriorityStandard, + NSToolbarItemVisibilityPriorityLow, }; int priorityCount = 4; @@ -149,12 +149,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ notSpace[i] = NO; if ([identifier - isEqualToString: NSToolbarFlexibleSpaceItemIdentifier]) { + isEqualToString: NSToolbarFlexibleSpaceItemIdentifier]) { isFlexible[i] = YES; } else if (![identifier - isEqualToString: NSToolbarSeparatorItemIdentifier] && + isEqualToString: NSToolbarSeparatorItemIdentifier] && ![identifier - isEqualToString: NSToolbarSpaceItemIdentifier]) { + isEqualToString: NSToolbarSpaceItemIdentifier]) { notSpace[i] = YES; totalNonSpace++; } @@ -200,7 +200,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ while (consumedWidth < desiredWidth && totalConsumers > 0) { CGFloat availablePerItem = - floor((desiredWidth - consumedWidth) / totalConsumers); + floor((desiredWidth - consumedWidth) / totalConsumers); if (availablePerItem < 1) break; @@ -280,7 +280,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) _removeItemAtIndex: (NSInteger) index { [[[[self subviews] copy] autorelease] - makeObjectsPerformSelector: @selector(removeFromSuperview)]; + makeObjectsPerformSelector: @selector(removeFromSuperview)]; [self layoutViews]; } @@ -330,9 +330,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSPasteboard *pboard = [sender draggingPasteboard]; if ([_toolbar customizationPaletteIsRunning]) { if ([[pboard types] - containsObject: NSToolbarItemIdentifierPboardType]) { + containsObject: NSToolbarItemIdentifierPboardType]) { NSData *data = - [pboard dataForType: NSToolbarItemIdentifierPboardType]; + [pboard dataForType: NSToolbarItemIdentifierPboardType]; id droppedObject = [NSUnarchiver unarchiveObjectWithData: data]; if ([droppedObject isKindOfClass: [NSArray class]]) { @@ -374,9 +374,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSRect frame = NSMakeRect(0, 0, [subview frame].size.width + 4, [subview frame].size.height + 4); NSImage *image = - [[[NSImage alloc] initWithSize: frame.size] autorelease]; + [[[NSImage alloc] initWithSize: frame.size] autorelease]; NSData *data = - [NSArchiver archivedDataWithRootObject: [item itemIdentifier]]; + [NSArchiver archivedDataWithRootObject: [item itemIdentifier]]; [image setCachedSeparately: YES]; [image lockFocus]; @@ -392,13 +392,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [_toolbar removeItemAtIndex: index]; [self dragImage: image - at: NSMakePoint([[item image] size].width / 2, - [[item image] size].height / 2) - offset: NSZeroSize - event: event - pasteboard: pboard - source: self - slideBack: YES]; + at: NSMakePoint([[item image] size].width / 2, + [[item image] size].height / 2) + offset: NSZeroSize + event: event + pasteboard: pboard + source: self + slideBack: YES]; [item release]; return; @@ -414,8 +414,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSArray *items = [_toolbar items]; NSString *menuTitle = NSLocalizedStringFromTableInBundle( - @"Overflow", nil, [NSBundle bundleForClass: [NSToolbarView class]], - @"Describes the overflow area of the toolbar"); + @"Overflow", nil, [NSBundle bundleForClass: [NSToolbarView class]], + @"Describes the overflow area of the toolbar"); NSMenu *menu = [[NSMenu alloc] initWithTitle: menuTitle]; NSRect menuFrame = [self frame]; @@ -423,7 +423,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSToolbarItemIdentifier identifier = [item itemIdentifier]; if ([identifier - isEqualToString: NSToolbarFlexibleSpaceItemIdentifier] || + isEqualToString: NSToolbarFlexibleSpaceItemIdentifier] || [identifier isEqualToString: NSToolbarSeparatorItemIdentifier] || [identifier isEqualToString: NSToolbarSpaceItemIdentifier]) { continue; @@ -439,7 +439,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([[item label] sizeWithAttributes: nil].width > menuFrame.size.width) menuFrame.size.width = - [[item label] sizeWithAttributes: nil].width + 20.0; // argh + [[item label] sizeWithAttributes: nil].width + 20.0; // argh } NSMenuWindow *window = [[NSMenuWindow alloc] initWithMenu: menu]; diff --git a/AppKit/NSTouchBarItem.m b/AppKit/NSTouchBarItem.m index 3b835a2b..eff67ee9 100644 --- a/AppKit/NSTouchBarItem.m +++ b/AppKit/NSTouchBarItem.m @@ -20,13 +20,13 @@ #import NSTouchBarItemIdentifier const NSTouchBarItemIdentifierFixedSpaceLarge = - @"NSTouchBarItemIdentifierFixedSpaceLarge"; + @"NSTouchBarItemIdentifierFixedSpaceLarge"; NSTouchBarItemIdentifier const NSTouchBarItemIdentifierFixedSpaceSmall = - @"NSTouchBarItemIdentifierFixedSpaceSmall"; + @"NSTouchBarItemIdentifierFixedSpaceSmall"; NSTouchBarItemIdentifier const NSTouchBarItemIdentifierFlexibleSpace = - @"NSTouchBarItemIdentifierFlexibleSpace"; + @"NSTouchBarItemIdentifierFlexibleSpace"; NSTouchBarItemIdentifier const NSTouchBarItemIdentifierOtherItemsProxy = - @"NSTouchBarItemIdentifierOtherItemsProxy"; + @"NSTouchBarItemIdentifierOtherItemsProxy"; @implementation NSTouchBarItem @end diff --git a/AppKit/NSTrackingArea.m b/AppKit/NSTrackingArea.m index 07e8af31..e70e1361 100644 --- a/AppKit/NSTrackingArea.m +++ b/AppKit/NSTrackingArea.m @@ -46,12 +46,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (id) _initWithRect: (NSRect) rect - options: (NSTrackingAreaOptions) options - owner: (id) owner - userData: (void *) userData - retainUserData: (BOOL) retainUserData - isToolTip: (BOOL) isToolTip - isLegacy: (BOOL) legacy + options: (NSTrackingAreaOptions) options + owner: (id) owner + userData: (void *) userData + retainUserData: (BOOL) retainUserData + isToolTip: (BOOL) isToolTip + isLegacy: (BOOL) legacy { self = [super init]; if (self != nil) { @@ -138,13 +138,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: - @"<%@[%p] rect:%@ options:%d owner:%@ userInfo:%p view:%@ " - @"rectInWindow:%@ mouseInside:%@ isToolTip:%@>", - [self class], self, NSStringFromRect(_rect), _options, - [_owner class], _userData, [_view class], - NSStringFromRect(_rectInWindow), _mouseInside ? @"YES" : @"NO", - _isToolTip ? @"YES" : @"NO"]; + stringWithFormat: + @"<%@[%p] rect:%@ options:%d owner:%@ userInfo:%p view:%@ " + @"rectInWindow:%@ mouseInside:%@ isToolTip:%@>", + [self class], self, NSStringFromRect(_rect), _options, + [_owner class], _userData, [_view class], + NSStringFromRect(_rectInWindow), + _mouseInside ? @"YES" : @"NO", _isToolTip ? @"YES" : @"NO"]; } @end diff --git a/AppKit/NSView.m b/AppKit/NSView.m index bb66bcad..b8d3ce90 100644 --- a/AppKit/NSView.m +++ b/AppKit/NSView.m @@ -47,13 +47,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSViewFrameDidChangeNotification = - @"NSViewFrameDidChangeNotification"; + @"NSViewFrameDidChangeNotification"; NSString *const NSViewBoundsDidChangeNotification = - @"NSViewBoundsDidChangeNotification"; + @"NSViewBoundsDidChangeNotification"; NSString *const NSViewFocusDidChangeNotification = - @"NSViewFocusDidChangeNotification"; + @"NSViewFocusDidChangeNotification"; const NSNotificationName NSViewGlobalFrameDidChangeNotification = - @"NSViewGlobalFrameDidChangeNotification"; + @"NSViewGlobalFrameDidChangeNotification"; @interface NSView (NSView_forward) - (CGAffineTransform) transformFromWindow; @@ -184,14 +184,14 @@ typedef struct __VFlags { // Subviews come in from the nib in back to front order [_subviews - addObjectsFromArray: [keyed decodeObjectForKey: @"NSSubviews"]]; + addObjectsFromArray: [keyed decodeObjectForKey: @"NSSubviews"]]; [_subviews - makeObjectsPerformSelector: @selector(viewWillMoveToSuperview:) - withObject: self]; + makeObjectsPerformSelector: @selector(viewWillMoveToSuperview:) + withObject: self]; [_subviews makeObjectsPerformSelector: @selector(_setSuperview:) withObject: self]; [_subviews - makeObjectsPerformSelector: @selector(viewDidMoveToSuperview)]; + makeObjectsPerformSelector: @selector(viewDidMoveToSuperview)]; _window = [keyed decodeObjectForKey: @"NSWindow"]; _superview = [keyed decodeObjectForKey: @"NSSuperview"]; @@ -202,18 +202,20 @@ typedef struct __VFlags { if ([keyed containsValueForKey: @"NSViewCompositeFilter"]) [self setCompositingFilter: - [keyed decodeObjectForKey: @"NSViewCompositeFilter"]]; + [keyed decodeObjectForKey: + @"NSViewCompositeFilter"]]; if ([keyed containsValueForKey: @"NSViewBackgroundFilters"]) [self setBackgroundFilters: - [keyed decodeObjectForKey: @"NSViewBackgroundFilters"]]; + [keyed decodeObjectForKey: + @"NSViewBackgroundFilters"]]; if ([keyed containsValueForKey: @"NSViewAnimations"]) - [self - setAnimations: [keyed decodeObjectForKey: @"NSViewAnimations"]]; + [self setAnimations: + [keyed decodeObjectForKey: @"NSViewAnimations"]]; [self setCanDrawConcurrently: - [keyed decodeBoolForKey: @"NSViewCanDrawConcurrently"]]; + [keyed decodeBoolForKey: @"NSViewCanDrawConcurrently"]]; // TODO: NSViewConstraints, NSViewLayoutGuides, ... @@ -221,14 +223,14 @@ typedef struct __VFlags { _invalidRectCount = 0; _invalidRects = NULL; _trackingAreas = [[NSMutableArray alloc] init]; - [self - setWantsLayer: [keyed decodeBoolForKey: @"NSViewIsLayerTreeHost"]]; + [self setWantsLayer: + [keyed decodeBoolForKey: @"NSViewIsLayerTreeHost"]]; _layerContentsRedrawPolicy = - [keyed decodeIntegerForKey: @"NSViewLayerContentsRedrawPolicy"]; + [keyed decodeIntegerForKey: @"NSViewLayerContentsRedrawPolicy"]; _contentFilters = - [[keyed decodeObjectForKey: @"NSViewContentFilters"] retain]; + [[keyed decodeObjectForKey: @"NSViewContentFilters"] retain]; } else { NSInteger version = [coder versionForClassName: @"NSView"]; if (version == 0) @@ -263,7 +265,7 @@ typedef struct __VFlags { vflags.vf.rotatedFromBase = (flags1 & 0x400) != 0; vflags.vf.rotatedOrScaledFromBase = vflags.vf.validGState = - (flags1 & 0x200) != 0; + (flags1 & 0x200) != 0; vflags.vf.autosizing = (flags2 & 0xFC00) >> 10; vflags.vf.autoresizeSubviews = (flags2 & 0x200) != 0; vflags.vf.wantsGState = (flags2 & 0x10) != 0; @@ -353,8 +355,8 @@ typedef struct __VFlags { _postsNotificationOnBoundsChange = YES; _autoresizesSubviews = YES; _autoresizingMask = NSViewNotSizable; - _tag = - -1; // according to the docs - loading from a nib gets a default of 0. + _tag = -1; // according to the docs - loading from a nib gets a default of + // 0. _needsDisplay = YES; _invalidRectCount = 0; _invalidRects = NULL; @@ -415,22 +417,23 @@ static CGAffineTransform concatViewTransform(CGAffineTransform result, NSRect frame = [view frame]; if (doFrame) - result = - CGAffineTransformTranslate(result, frame.origin.x, frame.origin.y); + result = CGAffineTransformTranslate(result, frame.origin.x, + frame.origin.y); // Apply bounds scaling to fit in the frame - CGAffineTransform scale = CGAffineTransformMakeScale( - NSWidth(frame) / NSWidth(bounds), NSHeight(frame) / NSHeight(bounds)); + CGAffineTransform scale = + CGAffineTransformMakeScale(NSWidth(frame) / NSWidth(bounds), + NSHeight(frame) / NSHeight(bounds)); result = CGAffineTransformConcat(scale, result); if (flip) { CGAffineTransform flip = - CGAffineTransformMake(1, 0, 0, -1, 0, bounds.size.height); + CGAffineTransformMake(1, 0, 0, -1, 0, bounds.size.height); result = CGAffineTransformConcat(flip, result); } - result = - CGAffineTransformTranslate(result, -bounds.origin.x, -bounds.origin.y); + result = CGAffineTransformTranslate(result, -bounds.origin.x, + -bounds.origin.y); return result; } @@ -460,12 +463,12 @@ static CGAffineTransform concatViewTransform(CGAffineTransform result, if ([self isFlipped]) { CGAffineTransform flip = - CGAffineTransformMake(1, 0, 0, -1, 0, bounds.size.height); + CGAffineTransformMake(1, 0, 0, -1, 0, bounds.size.height); result = CGAffineTransformConcat(flip, result); } - result = - CGAffineTransformTranslate(result, -bounds.origin.x, -bounds.origin.y); + result = CGAffineTransformTranslate(result, -bounds.origin.x, + -bounds.origin.y); return result; } @@ -511,7 +514,7 @@ static inline void buildTransformsIfNeeded(NSView *self) { if (!self->_validTransforms) { self->_transformToWindow = [self createTransformToWindow]; self->_transformFromWindow = - CGAffineTransformInvert(self->_transformToWindow); + CGAffineTransformInvert(self->_transformToWindow); self->_transformToLayer = [self createTransformToLayer]; self->_validTransforms = YES; @@ -871,56 +874,56 @@ static inline void buildTransformsIfNeeded(NSView *self) { - (NSPoint) convertPoint: (NSPoint) point fromView: (NSView *) viewOrNil { NSView *fromView = - (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; + (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; CGAffineTransform toWindow = [fromView transformToWindow]; CGAffineTransform fromWindow = [self transformFromWindow]; return CGPointApplyAffineTransform( - CGPointApplyAffineTransform(point, toWindow), fromWindow); + CGPointApplyAffineTransform(point, toWindow), fromWindow); } - (NSPoint) convertPoint: (NSPoint) point toView: (NSView *) viewOrNil { NSView *toView = - (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; + (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; CGAffineTransform toWindow = [self transformToWindow]; CGAffineTransform fromWindow = [toView transformFromWindow]; return CGPointApplyAffineTransform( - CGPointApplyAffineTransform(point, toWindow), fromWindow); + CGPointApplyAffineTransform(point, toWindow), fromWindow); } - (NSSize) convertSize: (NSSize) size fromView: (NSView *) viewOrNil { NSView *fromView = - (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; + (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; CGAffineTransform toWindow = [fromView transformToWindow]; CGAffineTransform fromWindow = [self transformFromWindow]; return CGSizeApplyAffineTransform( - CGSizeApplyAffineTransform(size, toWindow), fromWindow); + CGSizeApplyAffineTransform(size, toWindow), fromWindow); } - (NSSize) convertSize: (NSSize) size toView: (NSView *) viewOrNil { NSView *toView = - (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; + (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; CGAffineTransform toWindow = [self transformToWindow]; CGAffineTransform fromWindow = [toView transformFromWindow]; return CGSizeApplyAffineTransform( - CGSizeApplyAffineTransform(size, toWindow), fromWindow); + CGSizeApplyAffineTransform(size, toWindow), fromWindow); } - (NSRect) convertRect: (NSRect) rect fromView: (NSView *) viewOrNil { NSView *fromView = - (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; + (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; CGAffineTransform toWindow = [fromView transformToWindow]; CGAffineTransform fromWindow = [self transformFromWindow]; NSPoint point1 = rect.origin; NSPoint point2 = NSMakePoint(NSMaxX(rect), NSMaxY(rect)); point1 = CGPointApplyAffineTransform( - CGPointApplyAffineTransform(point1, toWindow), fromWindow); + CGPointApplyAffineTransform(point1, toWindow), fromWindow); point2 = CGPointApplyAffineTransform( - CGPointApplyAffineTransform(point2, toWindow), fromWindow); + CGPointApplyAffineTransform(point2, toWindow), fromWindow); if (point2.y < point1.y) { CGFloat temp = point2.y; point2.y = point1.y; @@ -933,16 +936,16 @@ static inline void buildTransformsIfNeeded(NSView *self) { - (NSRect) convertRect: (NSRect) rect toView: (NSView *) viewOrNil { NSView *toView = - (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; + (viewOrNil != nil) ? viewOrNil : [[self window] _backgroundView]; CGAffineTransform toWindow = [self transformToWindow]; CGAffineTransform fromWindow = [toView transformFromWindow]; NSPoint point1 = rect.origin; NSPoint point2 = NSMakePoint(NSMaxX(rect), NSMaxY(rect)); point1 = CGPointApplyAffineTransform( - CGPointApplyAffineTransform(point1, toWindow), fromWindow); + CGPointApplyAffineTransform(point1, toWindow), fromWindow); point2 = CGPointApplyAffineTransform( - CGPointApplyAffineTransform(point2, toWindow), fromWindow); + CGPointApplyAffineTransform(point2, toWindow), fromWindow); if (point2.y < point1.y) { CGFloat temp = point2.y; point2.y = point1.y; @@ -976,8 +979,8 @@ static inline void buildTransformsIfNeeded(NSView *self) { _bounds.size = frame.size; } else { // Get the bounds->frame transform - CGAffineTransform transform = - concatViewTransform(CGAffineTransformIdentity, self, nil, YES, NO); + CGAffineTransform transform = concatViewTransform( + CGAffineTransformIdentity, self, nil, YES, NO); // ... and invert it so we can get the new bounds size from the new // frame size transform = CGAffineTransformInvert(transform); @@ -1004,8 +1007,8 @@ static inline void buildTransformsIfNeeded(NSView *self) { if (_postsNotificationOnFrameChange) [[NSNotificationCenter defaultCenter] - postNotificationName: NSViewFrameDidChangeNotification - object: self]; + postNotificationName: NSViewFrameDidChangeNotification + object: self]; } - (void) setFrameSize: (NSSize) size { @@ -1040,8 +1043,8 @@ static inline void buildTransformsIfNeeded(NSView *self) { if (_postsNotificationOnBoundsChange) [[NSNotificationCenter defaultCenter] - postNotificationName: NSViewBoundsDidChangeNotification - object: self]; + postNotificationName: NSViewBoundsDidChangeNotification + object: self]; } } @@ -1076,7 +1079,7 @@ static inline void buildTransformsIfNeeded(NSView *self) { - (void) _setWindow: (NSWindow *) window { if (_window != window) { BOOL windowRecalulatesKeyViewLoop = - [window autorecalculatesKeyViewLoop]; + [window autorecalculatesKeyViewLoop]; if (windowRecalulatesKeyViewLoop) [self setNextKeyView: nil]; @@ -1151,10 +1154,10 @@ static inline void buildTransformsIfNeeded(NSView *self) { if (index == NSNotFound) index = (ordering == NSWindowBelow) ? 0 : NSNotFound; else - index = - (ordering == NSWindowBelow) - ? index - : ((index + 1 == [_subviews count]) ? NSNotFound : index + 1); + index = (ordering == NSWindowBelow) + ? index + : ((index + 1 == [_subviews count]) ? NSNotFound + : index + 1); [self _insertSubview: view atIndex: index]; } @@ -1181,7 +1184,7 @@ static inline void buildTransformsIfNeeded(NSView *self) { } - (void) sortSubviewsUsingFunction: - (NSComparisonResult (*)(id, id, void *)) compareFunction + (NSComparisonResult (*)(id, id, void *)) compareFunction context: (void *) context { NSUnimplementedMethod(); @@ -1295,13 +1298,13 @@ static inline void buildTransformsIfNeeded(NSView *self) { NSTrackingArea *area = nil; area = [[NSTrackingArea alloc] - _initWithRect: rect - options: NSTrackingCursorUpdate | NSTrackingActiveInKeyWindow - owner: cursorRect - userData: NULL - retainUserData: NO - isToolTip: NO - isLegacy: YES]; + _initWithRect: rect + options: NSTrackingCursorUpdate | NSTrackingActiveInKeyWindow + owner: cursorRect + userData: NULL + retainUserData: NO + isToolTip: NO + isLegacy: YES]; [_trackingAreas addObject: area]; [area release]; [cursorRect release]; @@ -1383,7 +1386,7 @@ static inline void buildTransformsIfNeeded(NSView *self) { count = [subviews count]; for (i = 0; i < count; i++) [(NSView *) [subviews objectAtIndex: i] - _collectTrackingAreasForWindowInto: collector]; + _collectTrackingAreasForWindowInto: collector]; } } @@ -1415,7 +1418,7 @@ static inline void buildTransformsIfNeeded(NSView *self) { assumeInside: (BOOL) assumeInside { NSTrackingAreaOptions options = - NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways; + NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways; NSTrackingArea *area = nil; if (assumeInside == YES) @@ -1526,11 +1529,11 @@ static inline void buildTransformsIfNeeded(NSView *self) { if (_autoresizingMask & NSViewMaxXMargin) { frame.origin.x += ((superFrame.size.width - oldSize.width) / 3); frame.size.width += - ((superFrame.size.width - oldSize.width) / 3); + ((superFrame.size.width - oldSize.width) / 3); } else { frame.origin.x += ((superFrame.size.width - oldSize.width) / 2); frame.size.width += - ((superFrame.size.width - oldSize.width) / 2); + ((superFrame.size.width - oldSize.width) / 2); } originChanged = YES; sizeChanged = YES; @@ -1555,14 +1558,14 @@ static inline void buildTransformsIfNeeded(NSView *self) { if (_autoresizingMask & NSViewHeightSizable) { if (_autoresizingMask & NSViewMaxYMargin) { frame.origin.y += - ((superFrame.size.height - oldSize.height) / 3); + ((superFrame.size.height - oldSize.height) / 3); frame.size.height += - ((superFrame.size.height - oldSize.height) / 3); + ((superFrame.size.height - oldSize.height) / 3); } else { frame.origin.y += - ((superFrame.size.height - oldSize.height) / 2); + ((superFrame.size.height - oldSize.height) / 2); frame.size.height += - ((superFrame.size.height - oldSize.height) / 2); + ((superFrame.size.height - oldSize.height) / 2); } originChanged = YES; sizeChanged = YES; @@ -1576,7 +1579,7 @@ static inline void buildTransformsIfNeeded(NSView *self) { } else if (_autoresizingMask & NSViewHeightSizable) { if (_autoresizingMask & NSViewMaxYMargin) frame.size.height += - ((superFrame.size.height - oldSize.height) / 2); + ((superFrame.size.height - oldSize.height) / 2); else frame.size.height += superFrame.size.height - oldSize.height; sizeChanged = YES; @@ -1814,8 +1817,8 @@ static inline void buildTransformsIfNeeded(NSView *self) { return; if (value != _layer) { - [_subviews - makeObjectsPerformSelector: @selector(_removeLayerFromSuperlayer)]; + [_subviews makeObjectsPerformSelector: @selector + (_removeLayerFromSuperlayer)]; value = [value retain]; @@ -1835,7 +1838,7 @@ static inline void buildTransformsIfNeeded(NSView *self) { } [_subviews - makeObjectsPerformSelector: @selector(_addLayerToSuperlayer)]; + makeObjectsPerformSelector: @selector(_addLayerToSuperlayer)]; } } @@ -1931,7 +1934,7 @@ static void removeRectFromInvalidInVisibleRect(NSView *self, NSRect rect, while (--count >= 0) { self->_invalidRects[count] = - NSIntersectionRect(self->_invalidRects[count], visibleRect); + NSIntersectionRect(self->_invalidRects[count], visibleRect); if (NSContainsRect(rect, self->_invalidRects[count])) { int i; @@ -2065,11 +2068,11 @@ static NSView *viewBeingPrinted = nil; CGFloat width = _frame.size.width; CGFloat height = _frame.size.height; CGContextRef graphicsPort = CGBitmapContextCreate( - NULL, width, height, 8, 0, colorSpace, - kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); - context = - [NSGraphicsContext graphicsContextWithGraphicsPort: graphicsPort - flipped: NO]; + NULL, width, height, 8, 0, colorSpace, + kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); + context = [NSGraphicsContext + graphicsContextWithGraphicsPort: graphicsPort + flipped: NO]; CGColorSpaceRelease(colorSpace); CGContextRelease(graphicsPort); // we'll re-fetch it below } else { @@ -2092,13 +2095,13 @@ static NSView *viewBeingPrinted = nil; } else { CGAffineTransform transform = CGAffineTransformIdentity; if (viewBeingPrinted != nil) { - transform = - CGAffineTransformConcat([self transformToWindow], - [viewBeingPrinted transformFromWindow]); + transform = CGAffineTransformConcat( + [self transformToWindow], + [viewBeingPrinted transformFromWindow]); } NSView *targetView = viewBeingPrinted == nil ? self : viewBeingPrinted; - transform = - CGAffineTransformConcat(transform, [targetView transformToLayer]); + transform = CGAffineTransformConcat(transform, + [targetView transformToLayer]); CGContextSetCTM(graphicsPort, transform); } @@ -2175,8 +2178,8 @@ static NSView *viewBeingPrinted = nil; [opaqueAncestor getRectsBeingDrawn: &ancestorRects count: &_rectsBeingRedrawnCount]; if (_rectsBeingRedrawnCount) { - _rectsBeingRedrawn = - NSZoneCalloc(NULL, _rectsBeingRedrawnCount, sizeof(NSRect)); + _rectsBeingRedrawn = NSZoneCalloc(NULL, _rectsBeingRedrawnCount, + sizeof(NSRect)); int rectsCount = 0; for (int i = 0; i < _rectsBeingRedrawnCount; ++i) { NSRect r = [opaqueAncestor convertRect: ancestorRects[i] @@ -2201,8 +2204,8 @@ static NSView *viewBeingPrinted = nil; count: &ancestorRectsCount]; if (ancestorRectsCount || _invalidRectCount) { _rectsBeingRedrawn = NSZoneCalloc( - NULL, _invalidRectCount + ancestorRectsCount, - sizeof(NSRect)); + NULL, _invalidRectCount + ancestorRectsCount, + sizeof(NSRect)); NSInteger rectsCount = 0; for (int i = 0; i < ancestorRectsCount; ++i) { NSRect r = [opaqueAncestor convertRect: ancestorRects[i] @@ -2296,7 +2299,7 @@ static NSView *viewBeingPrinted = nil; NSView *child = nil; while ((child = [viewEnumerator nextObject])) { NSRect converted = NSIntersectionRect( - [self convertRect: rect toView: child], [child bounds]); + [self convertRect: rect toView: child], [child bounds]); if (!NSIsEmptyRect(converted)) { [child displayIfNeededInRect: converted]; } @@ -2315,7 +2318,7 @@ static NSView *viewBeingPrinted = nil; NSView *child = nil; while ((child = [viewEnumerator nextObject])) { NSRect converted = NSIntersectionRect( - [self convertRect: rect toView: child], [child bounds]); + [self convertRect: rect toView: child], [child bounds]); if (!NSIsEmptyRect(converted)) { [child displayIfNeededInRectIgnoringOpacity: converted]; @@ -2479,12 +2482,12 @@ static NSView *viewBeingPrinted = nil; transform = CGAffineTransformIdentity; if ([self isFlipped]) { - transform = - CGAffineTransformMake(1, 0, 0, -1, 0, [printInfo paperSize].height); + transform = CGAffineTransformMake(1, 0, 0, -1, 0, + [printInfo paperSize].height); } - transform = - CGAffineTransformTranslate(transform, -rect.origin.x, -rect.origin.y); + transform = CGAffineTransformTranslate(transform, -rect.origin.x, + -rect.origin.y); CGContextConcatCTM(graphicsPort, transform); @@ -2561,9 +2564,9 @@ static NSView *viewBeingPrinted = nil; - (NSData *) dataWithEPSInsideRect: (NSRect) rect { NSMutableData *result = [NSMutableData data]; NSPrintOperation *operation = - [NSPrintOperation EPSOperationWithView: self - insideRect: rect - toData: result]; + [NSPrintOperation EPSOperationWithView: self + insideRect: rect + toData: result]; [operation runOperation]; @@ -2573,9 +2576,9 @@ static NSView *viewBeingPrinted = nil; - (NSData *) dataWithPDFInsideRect: (NSRect) rect { NSMutableData *result = [NSMutableData data]; NSPrintOperation *operation = - [NSPrintOperation PDFOperationWithView: self - insideRect: rect - toData: result]; + [NSPrintOperation PDFOperationWithView: self + insideRect: rect + toData: result]; [operation runOperation]; @@ -2646,9 +2649,9 @@ static NSView *viewBeingPrinted = nil; CGFloat direction = [documentView isFlipped] ? -1 : 1; visible.origin.x += - [event deltaX] * [scrollView horizontalLineScroll] * 3; - visible.origin.y += - [event deltaY] * direction * [scrollView verticalLineScroll] * 3; + [event deltaX] * [scrollView horizontalLineScroll] * 3; + visible.origin.y += [event deltaY] * direction * + [scrollView verticalLineScroll] * 3; // Something equivalent to this should be in scrollRectToVisible: if (visible.origin.y < bounds.origin.y) @@ -2792,7 +2795,7 @@ static NSView *viewBeingPrinted = nil; range: (NSRange) range options: (NSDictionary *) options baselineOriginProvider: - (NSPoint (^)(NSRange adjustedRange)) originProvider + (NSPoint (^)(NSRange adjustedRange)) originProvider { NSUnimplementedMethod(); } diff --git a/AppKit/NSViewController.m b/AppKit/NSViewController.m index df083041..6de05480 100644 --- a/AppKit/NSViewController.m +++ b/AppKit/NSViewController.m @@ -16,7 +16,7 @@ _nibName = [[coder decodeObjectForKey: @"NSNibName"] copy]; _title = [[coder decodeObjectForKey: @"NSTitle"] copy]; NSString *bundleIdentifier = - [coder decodeObjectForKey: @"NSNibBundleIdentifier"]; + [coder decodeObjectForKey: @"NSNibBundleIdentifier"]; if (bundleIdentifier != nil) _nibBundle = [NSBundle bundleWithIdentifier: bundleIdentifier]; } diff --git a/AppKit/NSWindow-Drag.m b/AppKit/NSWindow-Drag.m index 4652363d..04b61dd5 100644 --- a/AppKit/NSWindow-Drag.m +++ b/AppKit/NSWindow-Drag.m @@ -68,8 +68,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } return ([types firstObjectCommonWithArray: [self _draggedTypes]] != nil) - ? (id) self - : nil; + ? (id) self + : nil; } @end diff --git a/AppKit/NSWindow-Private.h b/AppKit/NSWindow-Private.h index 4db55ebe..9a4e8efa 100644 --- a/AppKit/NSWindow-Private.h +++ b/AppKit/NSWindow-Private.h @@ -49,7 +49,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) _removeTrackingRect: (NSTrackingRectTag) tag; - (void) _removeAllToolTips; - (void) _attachSheetContextOrderFrontAndAnimate: - (NSSheetContext *) sheetContext; + (NSSheetContext *) sheetContext; - (void) _setSheetContext: (NSSheetContext *) sheetContext; - (NSSheetContext *) _sheetContext; - (void) _detachSheetContextAnimateAndOrderOut; diff --git a/AppKit/NSWindow.m b/AppKit/NSWindow.m index 36c2fea0..6ec78796 100644 --- a/AppKit/NSWindow.m +++ b/AppKit/NSWindow.m @@ -47,61 +47,61 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import const NSNotificationName NSWindowDidBecomeKeyNotification = - @"NSWindowDidBecomeKeyNotification"; + @"NSWindowDidBecomeKeyNotification"; const NSNotificationName NSWindowDidResignKeyNotification = - @"NSWindowDidResignKeyNotification"; + @"NSWindowDidResignKeyNotification"; const NSNotificationName NSWindowDidBecomeMainNotification = - @"NSWindowDidBecomeMainNotification"; + @"NSWindowDidBecomeMainNotification"; const NSNotificationName NSWindowDidResignMainNotification = - @"NSWindowDidResignMainNotification"; + @"NSWindowDidResignMainNotification"; const NSNotificationName NSWindowWillMiniaturizeNotification = - @"NSWindowWillMiniaturizeNotification"; + @"NSWindowWillMiniaturizeNotification"; const NSNotificationName NSWindowDidMiniaturizeNotification = - @"NSWindowDidMiniaturizeNotification"; + @"NSWindowDidMiniaturizeNotification"; const NSNotificationName NSWindowDidDeminiaturizeNotification = - @"NSWindowDidDeminiaturizeNotification"; + @"NSWindowDidDeminiaturizeNotification"; const NSNotificationName NSWindowDidMoveNotification = - @"NSWindowDidMoveNotification"; + @"NSWindowDidMoveNotification"; const NSNotificationName NSWindowDidResizeNotification = - @"NSWindowDidResizeNotification"; + @"NSWindowDidResizeNotification"; const NSNotificationName NSWindowDidUpdateNotification = - @"NSWindowDidUpdateNotification"; + @"NSWindowDidUpdateNotification"; const NSNotificationName NSWindowWillCloseNotification = - @"NSWindowWillCloseNotification"; + @"NSWindowWillCloseNotification"; const NSNotificationName NSWindowWillMoveNotification = - @"NSWindowWillMoveNotification"; + @"NSWindowWillMoveNotification"; const NSNotificationName NSWindowWillStartLiveResizeNotification = - @"NSWindowWillStartLiveResizeNotification"; + @"NSWindowWillStartLiveResizeNotification"; const NSNotificationName NSWindowDidEndLiveResizeNotification = - @"NSWindowDidEndLiveResizeNotification"; + @"NSWindowDidEndLiveResizeNotification"; const NSNotificationName NSWindowWillBeginSheetNotification = - @"NSWindowWillBeginSheetNotification"; + @"NSWindowWillBeginSheetNotification"; const NSNotificationName NSWindowWillAnimateNotification = - @"NSWindowWillAnimateNotification"; + @"NSWindowWillAnimateNotification"; const NSNotificationName NSWindowAnimatingNotification = - @"NSWindowAnimatingNotification"; + @"NSWindowAnimatingNotification"; const NSNotificationName NSWindowDidAnimateNotification = - @"NSWindowDidAnimateNotification"; + @"NSWindowDidAnimateNotification"; const NSNotificationName NSWindowDidChangeScreenNotification = - @"NSWindowDidChangeScreenNotification"; + @"NSWindowDidChangeScreenNotification"; const NSNotificationName NSWindowDidEndSheetNotification = - @"NSWindowDidEndSheetNotification"; + @"NSWindowDidEndSheetNotification"; const NSNotificationName NSWindowDidEnterFullScreenNotification = - @"NSWindowDidEnterFullScreenNotification"; + @"NSWindowDidEnterFullScreenNotification"; const NSNotificationName NSWindowDidExitFullScreenNotification = - @"NSWindowDidExitFullScreenNotification"; + @"NSWindowDidExitFullScreenNotification"; const NSNotificationName NSWindowDidOrderOffScreenNotification = - @"NSWindowDidOrderOffScreenNotification"; + @"NSWindowDidOrderOffScreenNotification"; const NSNotificationName NSWindowDidOrderOnScreenNotification = - @"_NSWindowDidBecomeVisible"; + @"_NSWindowDidBecomeVisible"; const NSNotificationName NSWindowWillEnterFullScreenNotification = - @"NSWindowWillEnterFullScreenNotification"; + @"NSWindowWillEnterFullScreenNotification"; const NSNotificationName NSWindowWillExitFullScreenNotification = - @"NSWindowWillExitFullScreenNotification"; + @"NSWindowWillExitFullScreenNotification"; const NSNotificationName NSWindowDidExposeNotification = - @"NSWindowDidExposeNotification"; + @"NSWindowDidExposeNotification"; NSInteger NSBitsPerPixelFromDepth(NSWindowDepth depth) { switch (depth) { @@ -159,7 +159,7 @@ NSInteger NSBitsPerPixelFromDepth(NSWindowDepth depth) { toArray: (NSMutableArray *) array { [array addObject: [[[_NSKeyViewPosition alloc] initWithView: view] - autorelease]]; + autorelease]]; for (NSView *child in [view subviews]) [self addKeyViewPositionsWithView: child toArray: array]; @@ -252,7 +252,7 @@ static BOOL _allowsAutomaticWindowTabbing; } + (NSInteger) windowNumberAtPoint: (NSPoint) point - belowWindowWithWindowNumber: (NSInteger) window + belowWindowWithWindowNumber: (NSInteger) window { NSUnimplementedMethod(); return 0; @@ -337,10 +337,10 @@ static BOOL _allowsAutomaticWindowTabbing; NSRect backgroundFrame = {NSZeroPoint, _frame.size}; _backgroundView = [[[[self class] frameViewClassForStyleMask: styleMask] - alloc] initWithFrame: backgroundFrame]; + alloc] initWithFrame: backgroundFrame]; [_backgroundView setAutoresizesSubviews: YES]; [_backgroundView - setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; + setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [_backgroundView _setWindow: self]; [_backgroundView setNextResponder: self]; @@ -348,12 +348,12 @@ static BOOL _allowsAutomaticWindowTabbing; _contentView = [[NSView alloc] initWithFrame: contentViewFrame]; [_contentView setAutoresizesSubviews: YES]; [_contentView - setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; + setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; if ([self hasMainMenu]) { NSRect menuFrame = NSMakeRect( - contentViewFrame.origin.x, NSMaxY(contentViewFrame), - contentViewFrame.size.width, [NSMainMenuView menuHeight]); + contentViewFrame.origin.x, NSMaxY(contentViewFrame), + contentViewFrame.size.width, [NSMainMenuView menuHeight]); // We all need to share the main menu! _menu = [[NSApp mainMenu] retain]; @@ -641,7 +641,7 @@ static BOOL _allowsAutomaticWindowTabbing; - (NSSize) contentAspectRatio { return NSMakeSize(1.0, _contentResizeIncrements.height / - _contentResizeIncrements.width); + _contentResizeIncrements.width); } - (BOOL) autorecalculatesKeyViewLoop { @@ -743,25 +743,28 @@ static BOOL _allowsAutomaticWindowTabbing; NSNotificationName name; SEL selector; } notes[] = { - {NSWindowDidBecomeKeyNotification, @selector(windowDidBecomeKey:)}, - {NSWindowDidBecomeMainNotification, @selector(windowDidBecomeMain:)}, - {NSWindowDidDeminiaturizeNotification, - @selector(windowDidDeminiaturize:)}, - {NSWindowDidMiniaturizeNotification, @selector(windowDidMiniaturize:)}, - {NSWindowDidMoveNotification, @selector(windowDidMove:)}, - {NSWindowDidResignKeyNotification, @selector(windowDidResignKey:)}, - {NSWindowDidResignMainNotification, @selector(windowDidResignMain:)}, - {NSWindowDidResizeNotification, @selector(windowDidResize:)}, - {NSWindowWillStartLiveResizeNotification, - @selector(windowWillStartLiveResize:)}, - {NSWindowDidEndLiveResizeNotification, - @selector(windowDidEndLiveResize:)}, - {NSWindowDidUpdateNotification, @selector(windowDidUpdate:)}, - {NSWindowWillCloseNotification, @selector(windowWillClose:)}, - {NSWindowWillMiniaturizeNotification, - @selector(windowWillMiniaturize:)}, - {NSWindowWillMoveNotification, @selector(windowWillMove:)}, - {nil, NULL}}; + {NSWindowDidBecomeKeyNotification, @selector(windowDidBecomeKey:)}, + {NSWindowDidBecomeMainNotification, + @selector(windowDidBecomeMain:)}, + {NSWindowDidDeminiaturizeNotification, + @selector(windowDidDeminiaturize:)}, + {NSWindowDidMiniaturizeNotification, + @selector(windowDidMiniaturize:)}, + {NSWindowDidMoveNotification, @selector(windowDidMove:)}, + {NSWindowDidResignKeyNotification, @selector(windowDidResignKey:)}, + {NSWindowDidResignMainNotification, + @selector(windowDidResignMain:)}, + {NSWindowDidResizeNotification, @selector(windowDidResize:)}, + {NSWindowWillStartLiveResizeNotification, + @selector(windowWillStartLiveResize:)}, + {NSWindowDidEndLiveResizeNotification, + @selector(windowDidEndLiveResize:)}, + {NSWindowDidUpdateNotification, @selector(windowDidUpdate:)}, + {NSWindowWillCloseNotification, @selector(windowWillClose:)}, + {NSWindowWillMiniaturizeNotification, + @selector(windowWillMiniaturize:)}, + {NSWindowWillMoveNotification, @selector(windowWillMove:)}, + {nil, NULL}}; if (_delegate != nil) { for (struct note *note = ¬es[0]; note->name != nil; note++) { @@ -879,9 +882,9 @@ static BOOL _allowsAutomaticWindowTabbing; [self class], NSStringFromSelector(_cmd)]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSWindowWillAnimateNotification - object: self - userInfo: userInfo]; + postNotificationName: NSWindowWillAnimateNotification + object: self + userInfo: userInfo]; [context decrement]; @@ -896,9 +899,9 @@ static BOOL _allowsAutomaticWindowTabbing; [self setFrame: frame display: [context display]]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSWindowAnimatingNotification - object: self - userInfo: userInfo]; + postNotificationName: NSWindowAnimatingNotification + object: self + userInfo: userInfo]; if ([context stepCount] > 0) { [self performSelector: _cmd @@ -906,9 +909,9 @@ static BOOL _allowsAutomaticWindowTabbing; afterDelay: [context stepInterval]]; } else { [[NSNotificationCenter defaultCenter] - postNotificationName: NSWindowDidAnimateNotification - object: self - userInfo: userInfo]; + postNotificationName: NSWindowDidAnimateNotification + object: self + userInfo: userInfo]; [_animationContext release]; _animationContext = nil; @@ -957,11 +960,11 @@ static BOOL _allowsAutomaticWindowTabbing; if (animate) { NSWindowAnimationContext *context; context = [NSWindowAnimationContext - contextToTransformWindow: self - startRect: [self frame] - targetRect: newFrame - resizeTime: [self animationResizeTime: newFrame] - display: display]; + contextToTransformWindow: self + startRect: [self frame] + targetRect: newFrame + resizeTime: [self animationResizeTime: newFrame] + display: display]; [self _animateWithContext: context]; } } @@ -1079,10 +1082,11 @@ static BOOL _allowsAutomaticWindowTabbing; } - (void) setTitleWithRepresentedFilename: (NSString *) filename { - [self - setTitle: [NSString stringWithFormat: - @"%@ -- %@", [filename lastPathComponent], - [filename stringByDeletingLastPathComponent]]]; + [self setTitle: [NSString + stringWithFormat: + @"%@ -- %@", [filename lastPathComponent], + [filename + stringByDeletingLastPathComponent]]]; if ([self _isApplicationWindow]) [NSApp changeWindowsItem: self title: filename filename: YES]; @@ -1138,7 +1142,7 @@ static BOOL _allowsAutomaticWindowTabbing; NSRect frame = [self frame]; [_toolbar - layoutFrameSizeWithWidth: NSWidth([[self _backgroundView] bounds])]; + layoutFrameSizeWithWidth: NSWidth([[self _backgroundView] bounds])]; CGFloat newHeight = [_toolbar visibleHeight]; CGFloat contentHeightDelta = newHeight - oldHeight; @@ -1786,7 +1790,7 @@ static BOOL _allowsAutomaticWindowTabbing; - (void) recalculateKeyViewLoopIfNeeded { // _needsKeyViewLoop = NO; NSArray<_NSKeyViewPosition *> *sorted = - [_NSKeyViewPosition sortedKeyViewPositionsWithView: _contentView]; + [_NSKeyViewPosition sortedKeyViewPositionsWithView: _contentView]; NSUInteger count = [sorted count]; for (NSUInteger i = 0; i < count; i++) { @@ -1838,7 +1842,7 @@ static BOOL _allowsAutomaticWindowTabbing; [_currentFieldEditor setVerticallyResizable: NO]; [_currentFieldEditor setFieldEditor: YES]; [_currentFieldEditor - setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; + setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; } return _currentFieldEditor; @@ -2061,7 +2065,7 @@ static BOOL _allowsAutomaticWindowTabbing; } NSInteger count; BOOL toolTipsAllowed = - [NSApp isActive] || [self allowsToolTipsWhenApplicationIsInactive]; + [NSApp isActive] || [self allowsToolTipsWhenApplicationIsInactive]; NSMutableArray *collectedAreas = [[NSMutableArray alloc] init]; [[self _backgroundView] _collectTrackingAreasForWindowInto: collectedAreas]; @@ -2084,9 +2088,9 @@ static BOOL _allowsAutomaticWindowTabbing; NSToolTipWindow *toolTipWindow = [NSToolTipWindow sharedToolTipWindow]; [NSObject - cancelPreviousPerformRequestsWithTarget: toolTipWindow - selector: @selector(orderFront:) - object: nil]; + cancelPreviousPerformRequestsWithTarget: toolTipWindow + selector: @selector(orderFront:) + object: nil]; [toolTipWindow orderOut: nil]; } } @@ -2267,7 +2271,8 @@ static BOOL _allowsAutomaticWindowTabbing; } else if ([event type] == NSPlatformSpecific) { // [self _setSheetOriginAndFront]; [_platformWindow - sendEvent: [(NSEvent_CoreGraphics *) event coreGraphicsEvent]]; + sendEvent: [(NSEvent_CoreGraphics *) + event coreGraphicsEvent]]; return; } } @@ -2299,12 +2304,12 @@ static BOOL _allowsAutomaticWindowTabbing; case NSRightMouseDown: _mouseDownLocationInWindow = [event locationInWindow]; [[_backgroundView hitTest: [event locationInWindow]] - rightMouseDown: event]; + rightMouseDown: event]; break; case NSRightMouseUp: [[_backgroundView hitTest: _mouseDownLocationInWindow] - rightMouseUp: event]; + rightMouseUp: event]; _mouseDownLocationInWindow = NSMakePoint(NAN, NAN); break; @@ -2321,22 +2326,22 @@ static BOOL _allowsAutomaticWindowTabbing; case NSLeftMouseDragged: [[_backgroundView hitTest: _mouseDownLocationInWindow] - mouseDragged: event]; + mouseDragged: event]; break; case NSRightMouseDragged: [[_backgroundView hitTest: _mouseDownLocationInWindow] - rightMouseDragged: event]; + rightMouseDragged: event]; break; case NSMouseEntered: [[_backgroundView hitTest: [event locationInWindow]] - mouseEntered: event]; + mouseEntered: event]; break; case NSMouseExited: [[_backgroundView hitTest: [event locationInWindow]] - mouseExited: event]; + mouseExited: event]; break; case NSKeyDown: @@ -2353,12 +2358,12 @@ static BOOL _allowsAutomaticWindowTabbing; case NSPlatformSpecific: [_platformWindow - sendEvent: [(NSEvent_CoreGraphics *) event coreGraphicsEvent]]; + sendEvent: [(NSEvent_CoreGraphics *) event coreGraphicsEvent]]; break; case NSScrollWheel: [[_backgroundView hitTest: [event locationInWindow]] - scrollWheel: event]; + scrollWheel: event]; break; case NSAppKitDefined: @@ -2483,8 +2488,8 @@ static BOOL _allowsAutomaticWindowTabbing; - (void) update { [[self toolbar] validateVisibleItems]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSWindowDidUpdateNotification - object: self]; + postNotificationName: NSWindowDidUpdateNotification + object: self]; } - (void) makeKeyAndOrderFront: (id) sender { @@ -2560,8 +2565,8 @@ static BOOL _allowsAutomaticWindowTabbing; } - (void) _document: (NSDocument *) document - shouldClose: (BOOL) shouldClose - contextInfo: (void *) context + shouldClose: (BOOL) shouldClose + contextInfo: (void *) context { // Callback used by performClose: if (shouldClose) { @@ -2586,10 +2591,10 @@ static BOOL _allowsAutomaticWindowTabbing; zoomedFrame = [_delegate windowWillUseStandardFrame: self defaultFrame: zoomedFrame]; } else if ([self respondsToSelector: @selector - (windowWillUseStandardFrame:defaultFrame:)]) { + (windowWillUseStandardFrame:defaultFrame:)]) { zoomedFrame = [(id) self - windowWillUseStandardFrame: self - defaultFrame: zoomedFrame]; + windowWillUseStandardFrame: self + defaultFrame: zoomedFrame]; } // zoomedFrame = [self constrainFrameRect: zoomedFrame toScreen: screen]; @@ -2617,8 +2622,8 @@ static BOOL _allowsAutomaticWindowTabbing; } else if ([self respondsToSelector: @selector(windowShouldZoom: toFrame:)]) { shouldZoom = - [(id) self windowShouldZoom: self - toFrame: zoomedFrame]; + [(id) self windowShouldZoom: self + toFrame: zoomedFrame]; } if (shouldZoom) { @@ -2657,10 +2662,10 @@ static BOOL _allowsAutomaticWindowTabbing; - (void) toggleToolbarShown: (id) sender { [_toolbar setVisible: ![_toolbar isVisible]]; - [sender - setTitle: [NSString stringWithFormat: @"%@ Toolbar", - [_toolbar isVisible] ? @"Hide" - : @"Show"]]; + [sender setTitle: [NSString stringWithFormat: @"%@ Toolbar", + [_toolbar isVisible] + ? @"Hide" + : @"Show"]]; } - (void) runToolbarCustomizationPalette: (id) sender { @@ -2832,8 +2837,8 @@ static BOOL _allowsAutomaticWindowTabbing; NSPoint origin; origin.y = frame.origin.y + (frame.size.height - sheetFrame.size.height); - origin.x = - frame.origin.x + floor((frame.size.width - sheetFrame.size.width) / 2); + origin.x = frame.origin.x + + floor((frame.size.width - sheetFrame.size.width) / 2); if ([self toolbar] != nil) { if (_menuView != nil) @@ -2858,7 +2863,7 @@ static BOOL _allowsAutomaticWindowTabbing; } - (void) _attachSheetContextOrderFrontAndAnimate: - (NSSheetContext *) sheetContext + (NSSheetContext *) sheetContext { NSWindow *sheet = [sheetContext sheet]; @@ -2869,7 +2874,7 @@ static BOOL _allowsAutomaticWindowTabbing; _sheetContext = [sheetContext retain]; [(NSThemeFrame *) [sheet _backgroundView] - setWindowBorderType: NSWindowSheetBorderType]; + setWindowBorderType: NSWindowSheetBorderType]; [self _setSheetOrigin]; NSRect sheetFrame = [sheet frame]; @@ -2918,8 +2923,8 @@ static BOOL _allowsAutomaticWindowTabbing; [self _setSheetOriginAndFront]; [_childWindows - makeObjectsPerformSelector: @selector(_parentWindowDidActivate:) - withObject: self]; + makeObjectsPerformSelector: @selector(_parentWindowDidActivate:) + withObject: self]; [_drawers makeObjectsPerformSelector: @selector(parentWindowDidActivate:) withObject: self]; @@ -2946,8 +2951,8 @@ static BOOL _allowsAutomaticWindowTabbing; [NSApp _windowWillBecomeDeactive: self]; [_childWindows - makeObjectsPerformSelector: @selector(_parentWindowDidDeactivate:) - withObject: self]; + makeObjectsPerformSelector: @selector(_parentWindowDidDeactivate:) + withObject: self]; [_drawers makeObjectsPerformSelector: @selector(parentWindowDidDeactivate:) withObject: self]; @@ -2992,8 +2997,8 @@ static BOOL _allowsAutomaticWindowTabbing; } [_childWindows - makeObjectsPerformSelector: @selector(_parentWindowDidMiniaturize:) - withObject: self]; + makeObjectsPerformSelector: @selector(_parentWindowDidMiniaturize:) + withObject: self]; [_drawers makeObjectsPerformSelector: @selector(parentWindowDidMiniaturize:) withObject: self]; @@ -3005,9 +3010,9 @@ static BOOL _allowsAutomaticWindowTabbing; NSDictionary *userInfo = @{@"NSExposedRect" : nsrect}; [[NSNotificationCenter defaultCenter] - postNotificationName: NSWindowDidExposeNotification - object: self - userInfo: userInfo]; + postNotificationName: NSWindowDidExposeNotification + object: self + userInfo: userInfo]; } - (void) platformWindow: (CGWindow *) window @@ -3036,8 +3041,8 @@ static BOOL _allowsAutomaticWindowTabbing; [self _setSheetOriginAndFront]; [_childWindows - makeObjectsPerformSelector: @selector(_parentWindowDidChangeFrame:) - withObject: self]; + makeObjectsPerformSelector: @selector(_parentWindowDidChangeFrame:) + withObject: self]; [_drawers makeObjectsPerformSelector: @selector(parentWindowDidChangeFrame:) withObject: self]; @@ -3057,14 +3062,14 @@ static BOOL _allowsAutomaticWindowTabbing; - (void) platformWindowExitMove: (CGWindow *) window { [self _setSheetOriginAndFront]; [_childWindows - makeObjectsPerformSelector: @selector(_parentWindowDidExitMove:) - withObject: self]; + makeObjectsPerformSelector: @selector(_parentWindowDidExitMove:) + withObject: self]; [_drawers makeObjectsPerformSelector: @selector(parentWindowDidExitMove:) withObject: self]; } - (NSSize) platformWindow: (CGWindow *) window - frameSizeWillChange: (NSSize) size + frameSizeWillChange: (NSSize) size { if (_resizeIncrements.width != 1 || _resizeIncrements.height != 1) { NSSize vertical = size; @@ -3152,7 +3157,7 @@ static BOOL _allowsAutomaticWindowTabbing; if ([area _isToolTip]) { NSToolTipWindow *toolTipWindow = - [NSToolTipWindow sharedToolTipWindow]; + [NSToolTipWindow sharedToolTipWindow]; if (![self isKeyWindow] || [self _sheetContext] != nil) { mouseIsInside = NO; @@ -3177,13 +3182,13 @@ static BOOL _allowsAutomaticWindowTabbing; NSString *tooltip = nil; if ([owner respondsToSelector: @selector - (view:stringForToolTip:point:userData:)]) { + (view:stringForToolTip:point:userData:)]) { NSPoint pt = [[area _view] convertPoint: mousePoint fromView: nil]; tooltip = [owner view: [area _view] - stringForToolTip: area - point: pt - userData: [area userInfo]]; + stringForToolTip: area + point: pt + userData: [area userInfo]]; } else { tooltip = [owner description]; } @@ -3271,15 +3276,16 @@ static BOOL _allowsAutomaticWindowTabbing; if ([owner respondsToSelector: @selector(mouseExited:)]) { NSEvent *event = [NSEvent - enterExitEventWithType: NSMouseExited - location: mousePoint - modifierFlags: [NSEvent modifierFlags] - timestamp: [NSDate timeIntervalSinceReferenceDate] - windowNumber: [self windowNumber] - context: [self graphicsContext] - eventNumber: 0 // NSEvent currently ignores this. - trackingNumber: (NSInteger) check - userData: [check userInfo]]; + enterExitEventWithType: NSMouseExited + location: mousePoint + modifierFlags: [NSEvent modifierFlags] + timestamp: + [NSDate timeIntervalSinceReferenceDate] + windowNumber: [self windowNumber] + context: [self graphicsContext] + eventNumber: 0 // NSEvent currently ignores this. + trackingNumber: (NSInteger) check + userData: [check userInfo]]; [owner mouseExited: event]; } } @@ -3289,15 +3295,16 @@ static BOOL _allowsAutomaticWindowTabbing; if ([owner respondsToSelector: @selector(mouseEntered:)]) { NSEvent *event = [NSEvent - enterExitEventWithType: NSMouseEntered - location: mousePoint - modifierFlags: [NSEvent modifierFlags] - timestamp: [NSDate timeIntervalSinceReferenceDate] - windowNumber: [self windowNumber] - context: [self graphicsContext] - eventNumber: 0 // NSEvent currently ignores this. - trackingNumber: (NSInteger) check - userData: [check userInfo]]; + enterExitEventWithType: NSMouseEntered + location: mousePoint + modifierFlags: [NSEvent modifierFlags] + timestamp: + [NSDate timeIntervalSinceReferenceDate] + windowNumber: [self windowNumber] + context: [self graphicsContext] + eventNumber: 0 // NSEvent currently ignores this. + trackingNumber: (NSInteger) check + userData: [check userInfo]]; [owner mouseEntered: event]; } } @@ -3307,15 +3314,15 @@ static BOOL _allowsAutomaticWindowTabbing; if ([owner respondsToSelector: @selector(mouseMoved:)]) { NSEvent *event = [NSEvent - mouseEventWithType: NSMouseMoved - location: mousePoint - modifierFlags: [NSEvent modifierFlags] - timestamp: [NSDate timeIntervalSinceReferenceDate] - windowNumber: [self windowNumber] - context: [self graphicsContext] - eventNumber: 0 // NSEvent currently ignores this. - clickCount: 0 - pressure: 0.]; + mouseEventWithType: NSMouseMoved + location: mousePoint + modifierFlags: [NSEvent modifierFlags] + timestamp: [NSDate timeIntervalSinceReferenceDate] + windowNumber: [self windowNumber] + context: [self graphicsContext] + eventNumber: 0 // NSEvent currently ignores this. + clickCount: 0 + pressure: 0.]; [owner mouseMoved: event]; } } @@ -3325,32 +3332,33 @@ static BOOL _allowsAutomaticWindowTabbing; if ([owner respondsToSelector: @selector(cursorUpdate:)]) { NSEvent *event = [NSEvent - enterExitEventWithType: NSCursorUpdate - location: mousePoint - modifierFlags: [NSEvent modifierFlags] - timestamp: [NSDate timeIntervalSinceReferenceDate] - windowNumber: [self windowNumber] - context: [self graphicsContext] - eventNumber: 0 // NSEvent currently ignores this. - trackingNumber: (NSInteger) check - userData: [check userInfo]]; + enterExitEventWithType: NSCursorUpdate + location: mousePoint + modifierFlags: [NSEvent modifierFlags] + timestamp: + [NSDate timeIntervalSinceReferenceDate] + windowNumber: [self windowNumber] + context: [self graphicsContext] + eventNumber: 0 // NSEvent currently ignores this. + trackingNumber: (NSInteger) check + userData: [check userInfo]]; [owner cursorUpdate: event]; } } if (raiseToolTipWindow) { NSTimeInterval delay = - ((NSTimeInterval) [[NSUserDefaults standardUserDefaults] - integerForKey: @"NSInitialToolTipDelay"]) / - 1000.; + ((NSTimeInterval) [[NSUserDefaults standardUserDefaults] + integerForKey: @"NSInitialToolTipDelay"]) / + 1000.; if (delay <= 0.) { delay = 2.; } [[NSToolTipWindow sharedToolTipWindow] - performSelector: @selector(orderFront:) - withObject: nil - afterDelay: delay]; + performSelector: @selector(orderFront:) + withObject: nil + afterDelay: delay]; } if (!cursorIsSet) { @@ -3382,7 +3390,7 @@ static BOOL _allowsAutomaticWindowTabbing; // responsibility, but that's not how it works in real life. if (_undoManager == nil) { _undoManager = - [[[[self windowController] document] undoManager] retain]; + [[[[self windowController] document] undoManager] retain]; } // If the delegate does not implement this method, the NSWindow creates an @@ -3454,7 +3462,7 @@ static BOOL _allowsAutomaticWindowTabbing; - (CGWindow *) platformWindow { if (_platformWindow == nil) { [self performSelectorOnMainThread: @selector - (_createPlatformWindowOnMainThread) + (_createPlatformWindowOnMainThread) withObject: nil waitUntilDone: YES modes: @[ NSDefaultRunLoopMode ]]; diff --git a/AppKit/NSWindowAnimationContext.h b/AppKit/NSWindowAnimationContext.h index f2b98819..402271b9 100644 --- a/AppKit/NSWindowAnimationContext.h +++ b/AppKit/NSWindowAnimationContext.h @@ -32,7 +32,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ startRect: (NSRect) startRect targetRect: (NSRect) targetRect resizeTime: - (NSTimeInterval) resizeTime + (NSTimeInterval) resizeTime display: (BOOL) display; - (id) initWithWindow: (id) window diff --git a/AppKit/NSWindowAnimationContext.m b/AppKit/NSWindowAnimationContext.m index 76d7a3bf..e7a99761 100644 --- a/AppKit/NSWindowAnimationContext.m +++ b/AppKit/NSWindowAnimationContext.m @@ -27,7 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ startRect: (NSRect) startRect targetRect: (NSRect) targetRect resizeTime: - (NSTimeInterval) resizeTime + (NSTimeInterval) resizeTime display: (BOOL) display { NSRect deltaRect, stepRect; @@ -53,12 +53,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } return [[[NSWindowAnimationContext alloc] - initWithWindow: window - targetRect: targetRect - stepRect: stepRect - stepCount: stepCount - stepInterval: (resizeTime / FRAMES_PER_STEP) - display: display] autorelease]; + initWithWindow: window + targetRect: targetRect + stepRect: stepRect + stepCount: stepCount + stepInterval: (resizeTime / FRAMES_PER_STEP) + display: display] autorelease]; } - (id) initWithWindow: (id) window @@ -114,12 +114,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: @"<%@[%p] window: %@ targetRect: %@ stepRect: %@ " - @"stepCount: %d stepInterval: %g display: %d", - [self class], self, _window, - NSStringFromRect(_targetRect), - NSStringFromRect(_stepRect), _stepCount, - _stepInterval, _display]; + stringWithFormat: @"<%@[%p] window: %@ targetRect: %@ stepRect: %@ " + @"stepCount: %d stepInterval: %g display: %d", + [self class], self, _window, + NSStringFromRect(_targetRect), + NSStringFromRect(_stepRect), _stepCount, + _stepInterval, _display]; } @end diff --git a/AppKit/NSWindowController.m b/AppKit/NSWindowController.m index 553b59a8..dbc5dae0 100644 --- a/AppKit/NSWindowController.m +++ b/AppKit/NSWindowController.m @@ -32,10 +32,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_window != nil) [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(_windowWillClose:) - name: NSWindowWillCloseNotification - object: _window]; + addObserver: self + selector: @selector(_windowWillClose:) + name: NSWindowWillCloseNotification + object: _window]; _nibName = nil; _nibPath = nil; @@ -62,7 +62,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithWindowNibPath: (NSString *) nibPath owner: owner { [self initWithWindow: nil]; _nibName = - [[[nibPath lastPathComponent] stringByDeletingPathExtension] copy]; + [[[nibPath lastPathComponent] stringByDeletingPathExtension] copy]; _nibPath = [nibPath copy]; _owner = owner; return self; @@ -151,12 +151,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _topLevelObjects = [[NSMutableArray alloc] init]; nameTable = [NSDictionary - dictionaryWithObjectsAndKeys: _owner, NSNibOwner, _topLevelObjects, - NSNibTopLevelObjects, nil]; + dictionaryWithObjectsAndKeys: _owner, NSNibOwner, + _topLevelObjects, + NSNibTopLevelObjects, nil]; if (![NSBundle loadNibFile: path - externalNameTable: nameTable - withZone: NULL]) { + externalNameTable: nameTable + withZone: NULL]) { NSLog(@"%s: unable to load nib from file '%@'", __PRETTY_FUNCTION__, path); } @@ -165,7 +166,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_shouldCascadeWindows) cascadeTopLeftSavedPoint = - [_window cascadeTopLeftFromPoint: cascadeTopLeftSavedPoint]; + [_window cascadeTopLeftFromPoint: cascadeTopLeftSavedPoint]; } } @@ -257,8 +258,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSString *) windowTitleForDocumentDisplayName: (NSString *) displayName { - NSString *appName = - [[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleName"]; + NSString *appName = [[[NSBundle mainBundle] infoDictionary] + objectForKey: @"CFBundleName"]; if (appName) return [NSString stringWithFormat: @"%@ - %@", displayName, appName]; else diff --git a/AppKit/NSWorkspace.m b/AppKit/NSWorkspace.m index f09f2478..388e1e0a 100644 --- a/AppKit/NSWorkspace.m +++ b/AppKit/NSWorkspace.m @@ -24,35 +24,35 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSString *const NSWorkspaceApplicationKey = @"NSWorkspaceApplicationKey"; NSString *const NSWorkspaceWillPowerOffNotification = - @"NSWorkspaceWillPowerOffNotification"; + @"NSWorkspaceWillPowerOffNotification"; NSString *const NSWorkspaceRecycleOperation = @"NSWorkspaceRecycleOperation"; NSString *const NSWorkspaceLaunchConfigurationAppleEvent = - @"NSWorkspaceLaunchConfigurationAppleEvent"; + @"NSWorkspaceLaunchConfigurationAppleEvent"; NSString *const NSWorkspaceLaunchConfigurationArguments = - @"NSWorkspaceLaunchConfigurationArguments"; + @"NSWorkspaceLaunchConfigurationArguments"; NSString *const NSWorkspaceLaunchConfigurationEnvironment = - @"NSWorkspaceLaunchConfigurationEnvironment"; + @"NSWorkspaceLaunchConfigurationEnvironment"; NSString *const NSWorkspaceLaunchConfigurationArchitecture = - @"NSWorkspaceLaunchConfigurationArchitecture"; + @"NSWorkspaceLaunchConfigurationArchitecture"; NSString *const NSWorkspaceActiveSpaceDidChangeNotification = - @"NSWorkspaceActiveSpaceDidChangeNotification"; + @"NSWorkspaceActiveSpaceDidChangeNotification"; const NSNotificationName NSWorkspaceDidDeactivateApplicationNotification = - @"NSWorkspaceDidDeactivateApplicationNotification"; + @"NSWorkspaceDidDeactivateApplicationNotification"; NSString *const NSWorkspaceDidLaunchApplicationNotification = - @"NSWorkspaceDidLaunchApplicationNotification"; + @"NSWorkspaceDidLaunchApplicationNotification"; NSString *const NSWorkspaceDidTerminateApplicationNotification = - @"NSWorkspaceDidTerminateApplicationNotification"; + @"NSWorkspaceDidTerminateApplicationNotification"; const NSNotificationName NSWorkspaceSessionDidBecomeActiveNotification = - @"NSWorkspaceSessionDidBecomeActiveNotification"; + @"NSWorkspaceSessionDidBecomeActiveNotification"; const NSNotificationName NSWorkspaceSessionDidResignActiveNotification = - @"NSWorkspaceSessionDidResignActiveNotification"; + @"NSWorkspaceSessionDidResignActiveNotification"; const NSNotificationName - NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification = - @"NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification"; + NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification = + @"NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification"; @implementation NSWorkspace @@ -136,8 +136,8 @@ const NSNotificationName } - (BOOL) openFile: (NSString *) path - withApplication: (NSString *) application - andDeactivate: (BOOL) deactivate + withApplication: (NSString *) application + andDeactivate: (BOOL) deactivate { NSInvalidAbstractInvocation(); return 0; @@ -149,7 +149,7 @@ const NSNotificationName } - (BOOL) selectFile: (NSString *) path - inFileViewerRootedAtPath: (NSString *) rootedAtPath + inFileViewerRootedAtPath: (NSString *) rootedAtPath { NSInvalidAbstractInvocation(); return 0; diff --git a/AppKit/RTF.subproj/NSRichTextReader.m b/AppKit/RTF.subproj/NSRichTextReader.m index 7a91d4eb..1dee58c0 100644 --- a/AppKit/RTF.subproj/NSRichTextReader.m +++ b/AppKit/RTF.subproj/NSRichTextReader.m @@ -86,7 +86,7 @@ static const NSString *kStateCharacterBytesCountKey = @"characterBytesCount"; return [self initWithData: data]; } else if ([type isEqualToString: @"rtfd"]) { NSString *txt = [[path stringByAppendingPathComponent: @"TXT"] - stringByAppendingPathExtension: @"rtf"]; + stringByAppendingPathExtension: @"rtf"]; NSData *data = [NSData dataWithContentsOfFile: txt]; if (data != nil) @@ -116,7 +116,7 @@ static const NSString *kStateCharacterBytesCountKey = @"characterBytesCount"; + (NSAttributedString *) attributedStringWithData: (NSData *) data { NSRichTextReader *reader = [[self alloc] initWithData: data]; NSAttributedString *result = - [[[reader parseAttributedString] retain] autorelease]; + [[[reader parseAttributedString] retain] autorelease]; [reader release]; @@ -126,7 +126,7 @@ static const NSString *kStateCharacterBytesCountKey = @"characterBytesCount"; + (NSAttributedString *) attributedStringWithContentsOfFile: (NSString *) path { NSRichTextReader *reader = [[self alloc] initWithContentsOfFile: path]; NSAttributedString *result = - [[[reader parseAttributedString] retain] autorelease]; + [[[reader parseAttributedString] retain] autorelease]; [reader release]; @@ -207,7 +207,7 @@ static NSInteger codePageFromCharset(NSInteger charset) { - (void) pushState { // Save a copy of the current state on the stack NSMutableDictionary *state = - [[[self currentState] mutableCopy] autorelease]; + [[[self currentState] mutableCopy] autorelease]; if (state == nil) { state = [NSMutableDictionary dictionary]; } @@ -232,7 +232,7 @@ static NSInteger codePageFromCharset(NSInteger charset) { // Default value is 1 int bytesCount = 1; NSNumber *n = - [[self currentState] objectForKey: kStateCharacterBytesCountKey]; + [[self currentState] objectForKey: kStateCharacterBytesCountKey]; if (n) { bytesCount = [n intValue]; } @@ -255,13 +255,13 @@ static inline void flushPreviousString(NSRichTextReader *self) { if ([self currentDestination] == DESTINATION_STRING) { UInt32 codePage = codePageFromCharset(self->_currentCharset); CFStringEncoding encoding = - CFStringConvertWindowsCodepageToEncoding(codePage); + CFStringConvertWindowsCodepageToEncoding(codePage); NSStringEncoding nsencoding = - CFStringConvertEncodingToNSStringEncoding(encoding); + CFStringConvertEncodingToNSStringEncoding(encoding); NSString *string = - [[[NSString alloc] initWithBytes: self->_bufferIn.bytes - length: self->_bufferIn.length - encoding: nsencoding] autorelease]; + [[[NSString alloc] initWithBytes: self->_bufferIn.bytes + length: self->_bufferIn.length + encoding: nsencoding] autorelease]; if (string) { [self appendStringWithCurrentAttributes: string]; } @@ -275,9 +275,9 @@ static inline void flushPreviousString(NSRichTextReader *self) { if ([_bufferIn length] > 0) { NSStringEncoding encoding = NSWindowsCP1252StringEncoding; NSString *fontName = - [[[NSString alloc] initWithBytes: _bufferIn.bytes - length: _bufferIn.length - encoding: encoding] autorelease]; + [[[NSString alloc] initWithBytes: _bufferIn.bytes + length: _bufferIn.length + encoding: encoding] autorelease]; [self->_bufferIn setLength: 0]; [_currentFontInfo setObject: fontName forKey: @"fontname"]; } @@ -306,10 +306,12 @@ static inline void flushPreviousString(NSRichTextReader *self) { - (void) createColorInfo { [_currentColorInfo release]; _currentColorInfo = [[NSMutableDictionary - dictionaryWithObjectsAndKeys: [NSNumber numberWithFloat: 0.], @"red", - [NSNumber numberWithFloat: 0.], @"green", - [NSNumber numberWithFloat: 0.], @"blue", - nil] retain]; + dictionaryWithObjectsAndKeys: [NSNumber numberWithFloat: 0.], + @"red", + [NSNumber numberWithFloat: 0.], + @"green", + [NSNumber numberWithFloat: 0.], + @"blue", nil] retain]; } - (void) flushColorInfo { @@ -317,8 +319,9 @@ static inline void flushPreviousString(NSRichTextReader *self) { [self createColorInfo]; } [_colorTable - setObject: _currentColorInfo - forKey: [NSNumber numberWithUnsignedInteger: [_colorTable count]]]; + setObject: _currentColorInfo + forKey: [NSNumber + numberWithUnsignedInteger: [_colorTable count]]]; [_currentColorInfo release]; _currentColorInfo = nil; } @@ -362,8 +365,8 @@ static inline void flushPreviousString(NSRichTextReader *self) { [self setCurrentDestination: DESTINATION_IGNORE]; } else if ([self isEqualToString: @"ul"]) { [_currentAttributes - setObject: [NSNumber numberWithInteger: NSUnderlineStyleSingle] - forKey: NSUnderlineStyleAttributeName]; + setObject: [NSNumber numberWithInteger: NSUnderlineStyleSingle] + forKey: NSUnderlineStyleAttributeName]; } else if ([self isEqualToString: @"ulnone"]) { [_currentAttributes removeObjectForKey: NSUnderlineStyleAttributeName]; } else if ([self isEqualToString: @"ulc"]) { @@ -371,12 +374,12 @@ static inline void flushPreviousString(NSRichTextReader *self) { [_currentAttributes setObject: c forKey: NSUnderlineColorAttributeName]; } else if ([self isEqualToString: @"uldb"]) { [_currentAttributes - setObject: [NSNumber numberWithInteger: NSUnderlineStyleDouble] - forKey: NSUnderlineStyleAttributeName]; + setObject: [NSNumber numberWithInteger: NSUnderlineStyleDouble] + forKey: NSUnderlineStyleAttributeName]; } else if ([self isEqualToString: @"ulth"]) { [_currentAttributes - setObject: [NSNumber numberWithInteger: NSUnderlineStyleThick] - forKey: NSUnderlineStyleAttributeName]; + setObject: [NSNumber numberWithInteger: NSUnderlineStyleThick] + forKey: NSUnderlineStyleAttributeName]; } else if ([self isEqualToString: @"uc"]) { [self setCurrentUnicodeCharacterBytesCount: argument]; } else if ([self isEqualToString: @"u"]) { @@ -392,15 +395,15 @@ static inline void flushPreviousString(NSRichTextReader *self) { NSFont *font = [_currentAttributes objectForKey: NSFontAttributeName]; font = [[NSFontManager sharedFontManager] - convertFont: font - toHaveTrait: argument ? NSBoldFontMask : NSUnboldFontMask]; + convertFont: font + toHaveTrait: argument ? NSBoldFontMask : NSUnboldFontMask]; [_currentAttributes setObject: font forKey: NSFontAttributeName]; } else if ([self isEqualToString: @"i"]) { NSFont *font = [_currentAttributes objectForKey: NSFontAttributeName]; font = [[NSFontManager sharedFontManager] - convertFont: font - toHaveTrait: argument ? NSItalicFontMask : NSUnitalicFontMask]; + convertFont: font + toHaveTrait: argument ? NSItalicFontMask : NSUnitalicFontMask]; [_currentAttributes setObject: font forKey: NSFontAttributeName]; } else if ([self isEqualToString: @"par"]) { if ([self currentDestination] == DESTINATION_STRING) { @@ -429,7 +432,7 @@ static inline void flushPreviousString(NSRichTextReader *self) { forKey: NSBackgroundColorAttributeName]; } else { [_currentAttributes - removeObjectForKey: NSBackgroundColorAttributeName]; + removeObjectForKey: NSBackgroundColorAttributeName]; } } else if ([self isEqualToString: @"fonttbl"]) { _currentFontInfo = [NSMutableDictionary new]; @@ -455,7 +458,7 @@ static inline void flushPreviousString(NSRichTextReader *self) { // that we only ask for fonts we have... Of course this is a general // problem... so the full fix is elsewhere... NSArray *availableFonts = - [[NSFontManager sharedFontManager] availableFonts]; + [[NSFontManager sharedFontManager] availableFonts]; if ([availableFonts containsObject: fontname]) { font = [NSFont fontWithName: fontname size: 12]; } @@ -473,9 +476,9 @@ static inline void flushPreviousString(NSRichTextReader *self) { else if ([family isEqualToString: @"symbol"]) font = [NSFont fontWithName: @"Symbol" size: 12]; else if ([family isEqualToString: @"nil"]) { - font = - [NSFont fontWithName: [info objectForKey: @"fontname"] - size: 12]; + font = [NSFont + fontWithName: [info objectForKey: @"fontname"] + size: 12]; } } if (font == nil) { @@ -483,13 +486,13 @@ static inline void flushPreviousString(NSRichTextReader *self) { } if (font) { NSFont *currentFont = - [_currentAttributes objectForKey: NSFontAttributeName]; + [_currentAttributes objectForKey: NSFontAttributeName]; if (currentFont) { // We'll try to keep the traits, size of the current font // and just change the family name font = [[NSFontManager sharedFontManager] - convertFont: currentFont - toFamily: [font familyName]]; + convertFont: currentFont + toFamily: [font familyName]]; } [_currentAttributes setObject: font forKey: NSFontAttributeName]; @@ -539,9 +542,9 @@ static inline void flushPreviousString(NSRichTextReader *self) { } _range.length--; { NSString *path = - [_imageDirectory stringByAppendingPathComponent: self]; + [_imageDirectory stringByAppendingPathComponent: self]; NSTextAttachment *attachment = [[[NSTextAttachment alloc] - initWithContentsOfFile: path] autorelease]; + initWithContentsOfFile: path] autorelease]; unichar attachChar = NSAttachmentCharacter; if (attachment != nil) { @@ -549,11 +552,11 @@ static inline void flushPreviousString(NSRichTextReader *self) { forKey: NSAttachmentAttributeName]; [self appendStringWithCurrentAttributes: - [NSString stringWithCharacters: &attachChar - length: 1]]; + [NSString stringWithCharacters: &attachChar + length: 1]]; [_currentAttributes - removeObjectForKey: NSAttachmentAttributeName]; + removeObjectForKey: NSAttachmentAttributeName]; } } _range.length++; @@ -761,8 +764,8 @@ static inline void flushPreviousString(NSRichTextReader *self) { flushPreviousString(self); if ([self currentDestination] == DESTINATION_STRING) { [self appendStringWithCurrentAttributes: - [NSString stringWithCharacters: &_univalue - length: 1]]; + [NSString stringWithCharacters: &_univalue + length: 1]]; } _state = STATE_SKIPLAST; } diff --git a/AppKit/RTF.subproj/NSRichTextWriter.m b/AppKit/RTF.subproj/NSRichTextWriter.m index 5b33015e..4e654c31 100644 --- a/AppKit/RTF.subproj/NSRichTextWriter.m +++ b/AppKit/RTF.subproj/NSRichTextWriter.m @@ -51,7 +51,8 @@ range: (NSRange) range { NSRichTextWriter *writer = - [[self alloc] initWithAttributedString: attributedString range: range]; + [[self alloc] initWithAttributedString: attributedString + range: range]; NSData *result = [[[writer generateData] retain] autorelease]; [writer release]; @@ -113,27 +114,27 @@ while (location < limit) { NSRange effectiveRange; NSDictionary *attributes = - [_attributedString attributesAtIndex: location - effectiveRange: &effectiveRange]; + [_attributedString attributesAtIndex: location + effectiveRange: &effectiveRange]; NSFont *font = [attributes objectForKey: NSFontAttributeName]; NSColor *fontColor = - [attributes objectForKey: NSForegroundColorAttributeName]; + [attributes objectForKey: NSForegroundColorAttributeName]; NSColor *backgroundColor = - [attributes objectForKey: NSBackgroundColorAttributeName]; + [attributes objectForKey: NSBackgroundColorAttributeName]; NSColor *underlineColor = - [attributes objectForKey: NSUnderlineColorAttributeName]; + [attributes objectForKey: NSUnderlineColorAttributeName]; fontColor = - [fontColor colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + [fontColor colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; backgroundColor = [backgroundColor - colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; underlineColor = [underlineColor - colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; // Put there the font name without the italic/bold.. attributes NSFont *plainFont = - [[NSFontManager sharedFontManager] convertFont: font - toNotHaveTrait: 0xFFFFFF]; + [[NSFontManager sharedFontManager] convertFont: font + toNotHaveTrait: 0xFFFFFF]; NSString *fontName = [plainFont fontName]; if (fontName && [fonts containsObject: fontName] == NO) { [fonts addObject: fontName]; @@ -169,11 +170,11 @@ if (colors.count) { [self appendCString: "{\\colortbl "]; for (NSColor *color in colors) { - NSString *str = - [NSString stringWithFormat: @"\\red%ld\\green%ld\\blue%ld;", - lroundf(color.redComponent * 255), - lroundf(color.greenComponent * 255), - lroundf(color.blueComponent * 255)]; + NSString *str = [NSString + stringWithFormat: @"\\red%ld\\green%ld\\blue%ld;", + lroundf(color.redComponent * 255), + lroundf(color.greenComponent * 255), + lroundf(color.blueComponent * 255)]; [self appendCString: [str UTF8String]]; } [self appendCString: "}"]; @@ -182,8 +183,9 @@ [self appendCString: "{\\fonttbl "]; int i = 0; for (NSString *fontName in fonts) { - NSString *str = [NSString - stringWithFormat: @"\\f%d\\fnil\\fcharset0 %@;", i++, fontName]; + NSString *str = + [NSString stringWithFormat: @"\\f%d\\fnil\\fcharset0 %@;", + i++, fontName]; [self appendCString: [str UTF8String]]; } [self appendCString: "}"]; @@ -202,22 +204,22 @@ while (location < limit) { NSRange effectiveRange; NSDictionary *attributes = - [_attributedString attributesAtIndex: location - effectiveRange: &effectiveRange]; + [_attributedString attributesAtIndex: location + effectiveRange: &effectiveRange]; NSFont *font = [attributes objectForKey: NSFontAttributeName]; NSFont *plainFont = - [[NSFontManager sharedFontManager] convertFont: font - toNotHaveTrait: 0xFFFFFF]; + [[NSFontManager sharedFontManager] convertFont: font + toNotHaveTrait: 0xFFFFFF]; NSFontTraitMask traits = - [[NSFontManager sharedFontManager] traitsOfFont: font]; + [[NSFontManager sharedFontManager] traitsOfFont: font]; NSColor *color = - [attributes objectForKey: NSForegroundColorAttributeName]; + [attributes objectForKey: NSForegroundColorAttributeName]; NSColor *backgroundColor = - [attributes objectForKey: NSBackgroundColorAttributeName]; + [attributes objectForKey: NSBackgroundColorAttributeName]; NSColor *underlineColor = - [attributes objectForKey: NSUnderlineColorAttributeName]; + [attributes objectForKey: NSUnderlineColorAttributeName]; NSInteger underlineStyle = [[attributes - objectForKey: NSUnderlineStyleAttributeName] integerValue]; + objectForKey: NSUnderlineStyleAttributeName] integerValue]; if (effectiveRange.location < location) { effectiveRange.length = NSMaxRange(effectiveRange) - location; @@ -265,18 +267,18 @@ NSUInteger idx = [colors indexOfObject: color]; if (idx != NSNotFound && idx != currentColorIdx) { NSString *colorNum = [NSString - stringWithFormat: @"\\cf%ld ", (unsigned long) idx]; + stringWithFormat: @"\\cf%ld ", (unsigned long) idx]; [self appendCString: [colorNum UTF8String]]; currentColorIdx = idx; } } if (underlineColor) { underlineColor = [underlineColor - colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; NSUInteger idx = [colors indexOfObject: underlineColor]; if (idx != NSNotFound && idx != currentUnderlineColorIdx) { NSString *colorNum = [NSString - stringWithFormat: @"\\ulc%ld ", (unsigned long) idx]; + stringWithFormat: @"\\ulc%ld ", (unsigned long) idx]; [self appendCString: [colorNum UTF8String]]; currentUnderlineColorIdx = idx; } @@ -286,11 +288,11 @@ } if (backgroundColor) { backgroundColor = [backgroundColor - colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; NSUInteger idx = [colors indexOfObject: backgroundColor]; if (idx != NSNotFound && idx != currentBackgroundColorIdx) { NSString *colorNum = [NSString - stringWithFormat: @"\\cb%ld ", (unsigned long) idx]; + stringWithFormat: @"\\cb%ld ", (unsigned long) idx]; [self appendCString: [colorNum UTF8String]]; currentBackgroundColorIdx = idx; } @@ -300,12 +302,13 @@ NSUInteger idx = [fonts indexOfObject: [plainFont fontName]]; if (idx != NSNotFound && idx != currentFontIdx) { NSString *fontNum = [NSString - stringWithFormat: @"\\f%ld ", (unsigned long) idx]; + stringWithFormat: @"\\f%ld ", (unsigned long) idx]; [self appendCString: [fontNum UTF8String]]; currentFontIdx = idx; } - NSString *fontSize = [NSString - stringWithFormat: @"\\fs%d ", (int) ([font pointSize] * 2.)]; + NSString *fontSize = + [NSString stringWithFormat: @"\\fs%d ", + (int) ([font pointSize] * 2.)]; [self appendCString: [fontSize UTF8String]]; } diff --git a/AppKit/Win32.subproj/CGLContext.m b/AppKit/Win32.subproj/CGLContext.m index 638aa1ed..9f918479 100644 --- a/AppKit/Win32.subproj/CGLContext.m +++ b/AppKit/Win32.subproj/CGLContext.m @@ -262,9 +262,9 @@ static int resizeBackingIfNeeded(CGLContextObj context) { GLint h = context->h; adjustFrameInParent( - context, - [CGWindow windowWithWindowNumber: context->parentWindowNumber], &x, - &y, &w, &h); + context, + [CGWindow windowWithWindowNumber: context->parentWindowNumber], + &x, &y, &w, &h); MoveWindow(context->window, x, y, w, h, NO); } else { @@ -417,7 +417,7 @@ static void pfdFromPixelFormat(PIXELFORMATDESCRIPTOR *pfd, static BOOL contextHasPbufferExtension(CGLContextObj context) { const char *extensions = - opengl_wglGetExtensionsStringARB(context->windowDC); + opengl_wglGetExtensionsStringARB(context->windowDC); // NSLog(@"extensions=%s",extensions); @@ -506,7 +506,7 @@ CGL_EXPORT CGLError CGLCreateContext(CGLPixelFormatObj pixelFormat, CGLContextObj *resultp) { CGLContextObj context = - NSZoneCalloc(NULL, 1, sizeof(struct _CGLContextObj)); + NSZoneCalloc(NULL, 1, sizeof(struct _CGLContextObj)); PIXELFORMATDESCRIPTOR pfd; int pfIndex; @@ -524,13 +524,13 @@ CGL_EXPORT CGLError CGLCreateContext(CGLPixelFormatObj pixelFormat, context->forceChildWindow = TRUE; context->parent = - CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE, "CGLWindow", "", - WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, 10, - 10, NULL, NULL, GetModuleHandle(NULL), NULL); + CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE, "CGLWindow", "", + WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, + 10, 10, NULL, NULL, GetModuleHandle(NULL), NULL); context->window = CreateWindowEx( - WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE, "CGLWindow", "", - WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, context->w, - context->h, context->parent, NULL, GetModuleHandle(NULL), NULL); + WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE, "CGLWindow", "", + WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, context->w, + context->h, context->parent, NULL, GetModuleHandle(NULL), NULL); context->windowDC = GetDC(context->window); @@ -559,7 +559,7 @@ CGL_EXPORT CGLError CGLCreateContext(CGLPixelFormatObj pixelFormat, context->opacity = 1; context->overlay = [[CGLPixelSurface alloc] - initWithSize: O2SizeMake(context->w, context->h)]; + initWithSize: O2SizeMake(context->w, context->h)]; [context->overlay setOpaque: YES]; *resultp = context; @@ -589,7 +589,7 @@ CGL_EXPORT void CGLReleaseContext(CGLContextObj context) { if (context->retainCount == 0) { [[CGWindow windowWithWindowNumber: context->parentWindowNumber] - removeCGLContext: context]; + removeCGLContext: context]; if (CGLGetCurrentContext() == context) CGLSetCurrentContext(NULL); @@ -638,7 +638,7 @@ CGL_EXPORT CGLError CGLUnlockContext(CGLContextObj context) { static BOOL usesChildWindow(CGLContextObj context) { Win32Window *parentWindow = - [CGWindow windowWithWindowNumber: context->parentWindowNumber]; + [CGWindow windowWithWindowNumber: context->parentWindowNumber]; if (parentWindow == nil) return NO; @@ -664,8 +664,8 @@ static void reflectChildWindowState(CGLContextObj context, GLint force) { if (!context->inParent || force) { context->inParent = TRUE; - Win32Window *parentWindow = - [CGWindow windowWithWindowNumber: context->parentWindowNumber]; + Win32Window *parentWindow = [CGWindow + windowWithWindowNumber: context->parentWindowNumber]; SetParent(context->window, [parentWindow windowHandle]); SetProp(context->window, "parent", [parentWindow windowHandle]); @@ -703,7 +703,7 @@ CGL_EXPORT CGLError CGLSetParameter(CGLContextObj context, case kCGLCPSurfaceBackingSize:; BOOL sizeChanged = - (context->w != value[0] || context->h != value[1]) ? YES : NO; + (context->w != value[0] || context->h != value[1]) ? YES : NO; if (sizeChanged) { context->w = value[0]; @@ -724,7 +724,7 @@ CGL_EXPORT CGLError CGLSetParameter(CGLContextObj context, case kCGLCPSurfaceBackingOrigin:; BOOL originChanged = - (context->x != value[0] || context->y != value[1]) ? YES : NO; + (context->x != value[0] || context->y != value[1]) ? YES : NO; if (originChanged) { context->x = value[0]; @@ -740,10 +740,10 @@ CGL_EXPORT CGLError CGLSetParameter(CGLContextObj context, if (didChange) { [[CGWindow windowWithWindowNumber: context->parentWindowNumber] - removeCGLContext: context]; + removeCGLContext: context]; context->parentWindowNumber = value[0]; [[CGWindow windowWithWindowNumber: context->parentWindowNumber] - addCGLContext: context]; + addCGLContext: context]; } reflectChildWindowState(context, didChange); } break; @@ -806,7 +806,7 @@ CGL_EXPORT CGLError CGLCopyPixelsFromSurface(O2Surface_DIBSection *srcSurface, { O2Surface_DIBSection *dstSurface = - (O2Surface_DIBSection *) [destination->overlay validSurface]; + (O2Surface_DIBSection *) [destination->overlay validSurface]; BLENDFUNCTION blend; blend.BlendOp = AC_SRC_OVER; @@ -854,9 +854,9 @@ CGL_EXPORT CGLError CGLCopyPixels(CGLContextObj source, CGLPixelSurface *overlay = source->overlay; O2Surface_DIBSection *dstSurface = - (O2Surface_DIBSection *) [destination->overlay validSurface]; + (O2Surface_DIBSection *) [destination->overlay validSurface]; O2Surface_DIBSection *srcSurface = - (O2Surface_DIBSection *) [overlay validSurface]; + (O2Surface_DIBSection *) [overlay validSurface]; if (srcSurface == nil) return kCGLNoError; @@ -887,7 +887,7 @@ CGLError CGLFlushDrawable(CGLContextObj context) { NSLog(@"SwapBuffers failed, error = %d", GetLastError()); } else { Win32Window *parentWindow = - [CGWindow windowWithWindowNumber: context->parentWindowNumber]; + [CGWindow windowWithWindowNumber: context->parentWindowNumber]; [parentWindow flushCGLContext: context]; } @@ -1094,14 +1094,14 @@ CGLError CGLSetPBuffer(CGLContextObj context, CGLPBufferObj pbuffer, } const int attributes[] = { - WGL_TEXTURE_FORMAT_ARB, - WGL_TEXTURE_RGBA_ARB, // p-buffer will have RBA texture format - WGL_TEXTURE_TARGET_ARB, WGL_TEXTURE_2D_ARB, - 0}; // Of texture target will be GL_TEXTURE_2D + WGL_TEXTURE_FORMAT_ARB, + WGL_TEXTURE_RGBA_ARB, // p-buffer will have RBA texture format + WGL_TEXTURE_TARGET_ARB, WGL_TEXTURE_2D_ARB, + 0}; // Of texture target will be GL_TEXTURE_2D - pbuffer->pBuffer = - opengl_wglCreatePbufferARB(CGLGetWindowDC(context), piFormats[0], - pbuffer->width, pbuffer->height, attributes); + pbuffer->pBuffer = opengl_wglCreatePbufferARB(CGLGetWindowDC(context), + piFormats[0], pbuffer->width, + pbuffer->height, attributes); reportGLErrorIfNeeded(__PRETTY_FUNCTION__, __LINE__); pbuffer->dc = opengl_wglGetPbufferDCARB(pbuffer->pBuffer); reportGLErrorIfNeeded(__PRETTY_FUNCTION__, __LINE__); diff --git a/AppKit/Win32.subproj/KTFont_gdi.m b/AppKit/Win32.subproj/KTFont_gdi.m index 3f05dab2..0e384d6d 100644 --- a/AppKit/Win32.subproj/KTFont_gdi.m +++ b/AppKit/Win32.subproj/KTFont_gdi.m @@ -86,7 +86,7 @@ static inline CGGlyphMetrics *glyphInfoForGlyph(KTFont_gdi *self, CGGlyph glyph) if (nameToGlyphRanges == NULL) nameToGlyphRanges = NSCreateMapTable( - NSObjectMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0); + NSObjectMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0); shared = NSMapGet(nameToGlyphRanges, _name); @@ -150,14 +150,14 @@ static inline CGGlyphMetrics *glyphInfoForGlyph(KTFont_gdi *self, CGGlyph glyph) if (_glyphRangeTable->ranges[range] == NULL) _glyphRangeTable->ranges[range] = - NSZoneCalloc(NULL, sizeof(CGGlyphRange), 1); + NSZoneCalloc(NULL, sizeof(CGGlyphRange), 1); _glyphRangeTable->ranges[range]->glyphs[index] = glyph; } } _glyphRangeTable->numberOfGlyphs++; - _glyphRangeTable->characters = - NSZoneCalloc(NULL, sizeof(unichar), _glyphRangeTable->numberOfGlyphs); + _glyphRangeTable->characters = NSZoneCalloc( + NULL, sizeof(unichar), _glyphRangeTable->numberOfGlyphs); for (i = 0; i < range.length; i++) { unsigned short glyph = glyphs[i]; @@ -213,17 +213,17 @@ static inline CGGlyphMetrics *glyphInfoForGlyph(KTFont_gdi *self, CGGlyph glyph) if (index == 0) info->kerningOffsets = - NSZoneMalloc([self zone], sizeof(CGKerningOffset)); + NSZoneMalloc([self zone], sizeof(CGKerningOffset)); else - info->kerningOffsets = - NSZoneRealloc([self zone], info -> kerningOffsets, - sizeof(CGKerningOffset) * (index + 1)); + info->kerningOffsets = NSZoneRealloc( + [self zone], info -> kerningOffsets, + sizeof(CGKerningOffset) * (index + 1)); info->kerningOffsets[index].previous = previous; info->kerningOffsets[index].xoffset = xoffset * scale; if (_useMacMetrics == NO) { info->kerningOffsets[index].xoffset = - roundf(info->kerningOffsets[index].xoffset); + roundf(info->kerningOffsets[index].xoffset); } info->numberOfKerningOffsets++; } @@ -403,9 +403,9 @@ static inline CGGlyphMetrics *fetchGlyphAdvancementIfNeeded(KTFont_gdi *self, _metrics.boundingRect.origin.x = ttMetrics->otmrcFontBox.left; _metrics.boundingRect.origin.y = ttMetrics->otmrcFontBox.bottom; _metrics.boundingRect.size.width = - ttMetrics->otmrcFontBox.right - ttMetrics->otmrcFontBox.left; + ttMetrics->otmrcFontBox.right - ttMetrics->otmrcFontBox.left; _metrics.boundingRect.size.height = - ttMetrics->otmrcFontBox.top - ttMetrics->otmrcFontBox.bottom; + ttMetrics->otmrcFontBox.top - ttMetrics->otmrcFontBox.bottom; if (_useMacMetrics) { _metrics.ascender = ttMetrics->otmMacAscent; @@ -645,8 +645,8 @@ static inline CGGlyphMetrics *fetchGlyphAdvancementIfNeeded(KTFont_gdi *self, } - (void) getGlyphs: (CGGlyph *) glyphs - forCharacters: (const unichar *) characters - length: (unsigned) length + forCharacters: (const unichar *) characters + length: (unsigned) length { int i; @@ -752,8 +752,8 @@ static CGFloat FIXEDToFloat(FIXED f) { ****************************************************************************/ static UINT MakeBezierFromQBSpline(CGPoint *pPts, POINTFX *pSpline) { CGPoint P0, // Quadratic on curve start point - P1, // Quadratic control point - P2; // Quadratic on curve end point + P1, // Quadratic control point + P2; // Quadratic on curve end point UINT cTotal = 0; // Convert the Quadratic points to integer @@ -1027,7 +1027,7 @@ static void ConvertTTPolygonToPath(LPTTPOLYGONHEADER lpHeader, DWORD size, } - (NSString *) description { - return - [NSString stringWithFormat: @"%@ name: %@", [super description], _name]; + return [NSString + stringWithFormat: @"%@ name: %@", [super description], _name]; } @end diff --git a/AppKit/Win32.subproj/NSGraphicsStyle_uxtheme.m b/AppKit/Win32.subproj/NSGraphicsStyle_uxtheme.m index 01c46c29..88bdf432 100644 --- a/AppKit/Win32.subproj/NSGraphicsStyle_uxtheme.m +++ b/AppKit/Win32.subproj/NSGraphicsStyle_uxtheme.m @@ -56,7 +56,7 @@ static BOOL isThemeActive() { HANDLE openThemeData(HWND window, LPCWSTR classList) { WINAPI HANDLE (*function)(HWND, LPCWSTR) = - functionWithName("OpenThemeData"); + functionWithName("OpenThemeData"); if (function == NULL) return NULL; @@ -95,7 +95,7 @@ static BOOL getThemeInt(HTHEME theme, int partId, int stateId, int propId, int *val) { WINAPI HRESULT (*function)(HTHEME, int, int, int, int *) = - functionWithName("GetThemeInt"); + functionWithName("GetThemeInt"); NSLog(@"getThemeInt = %p", function); if (function == NULL) @@ -113,7 +113,7 @@ static BOOL getThemeMargins(HTHEME theme, HDC dc, int partId, int stateId, int propId, LPCRECT prc, MARGINS *margins) { WINAPI HRESULT (*function)(HTHEME, HDC, int, int, int, LPCRECT, MARGINS *) = - functionWithName("GetThemeMargins"); + functionWithName("GetThemeMargins"); if (function == NULL) return NO; @@ -131,7 +131,7 @@ static BOOL drawThemeBackground(HTHEME theme, HDC dc, int partId, int stateId, { WINAPI HRESULT (*function)(HTHEME, HDC, int, int, const RECT *, const RECT *) = - functionWithName("DrawThemeBackground"); + functionWithName("DrawThemeBackground"); if (function == NULL) return NO; @@ -177,15 +177,15 @@ static NSDictionary *sDimmedMenuTextAttributes = nil; if (sNormalMenuTextAttributes == nil) { NSFont *menuFont = [NSFont menuFontOfSize: 0]; sNormalMenuTextAttributes = [[NSDictionary - dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, - [NSColor menuItemTextColor], - NSForegroundColorAttributeName, nil] - retain]; + dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, + [NSColor menuItemTextColor], + NSForegroundColorAttributeName, + nil] retain]; sDimmedMenuTextAttributes = [[NSDictionary - dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, - [NSColor grayColor], - NSForegroundColorAttributeName, nil] - retain]; + dictionaryWithObjectsAndKeys: menuFont, NSFontAttributeName, + [NSColor grayColor], + NSForegroundColorAttributeName, + nil] retain]; } } @@ -219,7 +219,7 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { RECT result; NSPoint point1 = O2PointApplyAffineTransform(rect.origin, matrix); NSPoint point2 = O2PointApplyAffineTransform( - NSMakePoint(NSMaxX(rect), NSMaxY(rect)), matrix); + NSMakePoint(NSMaxX(rect), NSMaxY(rect)), matrix); if (point2.y < point1.y) { CGFloat temp = point2.y; @@ -250,7 +250,7 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { if ([context respondsToSelector: @selector(deviceContext)]) { O2DeviceContext_gdi *result = - [context performSelector: @selector(deviceContext)]; + [context performSelector: @selector(deviceContext)]; if ([result isKindOfClass: [O2DeviceContext_gdi class]]) return result; @@ -607,17 +607,17 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { - (void) drawMenuSeparatorInRect: (NSRect) rect { if (![self drawPartId: /*MENU_POPUPSEPARATOR*/ 15 - stateId: MS_NORMAL - uxthClassId: uxthMENU - inRect: rect]) + stateId: MS_NORMAL + uxthClassId: uxthMENU + inRect: rect]) [super drawMenuSeparatorInRect: rect]; } - (void) drawMenuGutterInRect: (NSRect) rect { if (![self drawPartId: /*MENU_POPUPGUTTER*/ 13 - stateId: 1 - uxthClassId: uxthMENU - inRect: rect]) + stateId: 1 + uxthClassId: uxthMENU + inRect: rect]) [super drawMenuGutterInRect: rect]; } @@ -634,9 +634,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { state = selected ? /*MBI_DISABLEDHOT*/ 5 : /*MBI_DISABLED*/ 4; if (![self drawPartId: /*MENU_POPUPCHECKBACKGROUND*/ 12 - stateId: state - uxthClassId: uxthMENU - inRect: rect]) + stateId: state + uxthClassId: uxthMENU + inRect: rect]) [super drawMenuCheckmarkInRect: rect enabled: enabled selected: selected]; @@ -647,9 +647,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { themeRect.size.width -= (margins.left + margins.right); themeRect.size.height -= (margins.top + margins.bottom); if (![self drawPartId: /*MENU_POPUPCHECK*/ 11 - stateId: state - uxthClassId: uxthMENU - inRect: themeRect]) + stateId: state + uxthClassId: uxthMENU + inRect: themeRect]) [super drawMenuCheckmarkInRect: rect enabled: enabled selected: selected]; @@ -677,10 +677,10 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { rect.size.width -= (margins.left + margins.right); rect.size.height -= (margins.top + margins.bottom); - rect.origin.y += - (rect.size.height - - [string sizeWithAttributes: sNormalMenuTextAttributes].height) / - 2; + rect.origin.y += (rect.size.height - + [string sizeWithAttributes: sNormalMenuTextAttributes] + .height) / + 2; if (enabled) { [string drawInRect: rect withAttributes: sNormalMenuTextAttributes]; @@ -709,9 +709,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { themeRect.size.height -= (margins.top + margins.bottom); if (![self drawPartId: /*MENU_POPUPSUBMENU*/ 16 - stateId: state - uxthClassId: uxthMENU - inRect: themeRect]) + stateId: state + uxthClassId: uxthMENU + inRect: themeRect]) [super drawMenuBranchArrowInRect: rect enabled: enabled selected: selected]; @@ -722,23 +722,23 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { SetBkColor([deviceContext dc], RGB(251, 245, 55)); if (![self drawPartId: /*MENU_POPUPITEM*/ 14 - stateId: enabled ? /*MPI_HOT*/ 2 : /*MPI_DISABLEDHOT*/ 4 - uxthClassId: uxthMENU - inRect: rect]) + stateId: enabled ? /*MPI_HOT*/ 2 : /*MPI_DISABLEDHOT*/ 4 + uxthClassId: uxthMENU + inRect: rect]) [super drawMenuSelectionInRect: rect enabled: enabled]; } - (void) drawMenuWindowBackgroundInRect: (NSRect) rect { if (![self drawPartId: /*MENU_POPUPBACKGROUND*/ 9 - stateId: 0 - uxthClassId: uxthMENU - inRect: rect]) + stateId: 0 + uxthClassId: uxthMENU + inRect: rect]) [super drawMenuWindowBackgroundInRect: rect]; else [self drawPartId: /*MENU_POPUPBORDERS*/ 10 - stateId: 0 - uxthClassId: uxthMENU - inRect: rect]; + stateId: 0 + uxthClassId: uxthMENU + inRect: rect]; } - (void) drawMenuBarItemBorderInRect: (NSRect) rect @@ -750,9 +750,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { state = selected ? /*MBI_PUSHED*/ 3 : /*MBI_HOT*/ 2; if (![self drawPartId: /*MENU_BARITEM*/ 8 - stateId: state - uxthClassId: uxthMENU - inRect: rect]) + stateId: state + uxthClassId: uxthMENU + inRect: rect]) [super drawMenuBarItemBorderInRect: rect hover: hovering selected: selected]; @@ -760,9 +760,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { - (void) drawMenuBarBackgroundInRect: (NSRect) rect { if (![self drawPartId: /*MENU_BARBACKGROUND*/ 7 - stateId: 1 - uxthClassId: uxthMENU - inRect: rect]) + stateId: 1 + uxthClassId: uxthMENU + inRect: rect]) [super drawMenuBarBackgroundInRect: rect]; } @@ -785,10 +785,10 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { } - (BOOL) getPartId: (int *) partId - stateId: (int *) stateId - forButtonImage: (NSImage *) image - enabled: (BOOL) enabled - mixed: (BOOL) mixed + stateId: (int *) stateId + forButtonImage: (NSImage *) image + enabled: (BOOL) enabled + mixed: (BOOL) mixed { BOOL valid = NO; @@ -820,16 +820,16 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { int partId, stateId; if ([self getPartId: &partId - stateId: &stateId - forButtonImage: image - enabled: enabled - mixed: mixed]) { + stateId: &stateId + forButtonImage: image + enabled: enabled + mixed: mixed]) { NSSize result; if ([self sizeOfPartId: partId - stateId: stateId - uxthClassId: uxthBUTTON - size: &result]) + stateId: stateId + uxthClassId: uxthBUTTON + size: &result]) return result; } @@ -844,10 +844,10 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { int partId, stateId; if ([self getPartId: &partId - stateId: &stateId - forButtonImage: image - enabled: enabled - mixed: mixed]) + stateId: &stateId + forButtonImage: image + enabled: enabled + mixed: mixed]) if ([self drawButtonPartId: partId stateId: stateId inRect: rect]) return; @@ -876,9 +876,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { - (void) drawOutlineViewBranchInRect: (NSRect) rect expanded: (BOOL) expanded { if (![self drawPartId: TVP_GLYPH - stateId: expanded ? GLPS_OPENED : GLPS_CLOSED - uxthClassId: uxthTREEVIEW - inRect: rect]) + stateId: expanded ? GLPS_OPENED : GLPS_CLOSED + uxthClassId: uxthTREEVIEW + inRect: rect]) [super drawOutlineViewBranchInRect: rect expanded: expanded]; } @@ -888,9 +888,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { { if (bezeled) { if ([self drawPartId: PP_BAR - stateId: 0 - uxthClassId: uxthPROGRESS - inRect: rect]) + stateId: 0 + uxthClassId: uxthPROGRESS + inRect: rect]) return NSInsetRect(rect, 3, 3); } @@ -905,9 +905,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { - (void) drawProgressIndicatorChunk: (NSRect) rect { [self drawPartId: PP_CHUNK - stateId: 0 - uxthClassId: uxthPROGRESS - inRect: rect]; + stateId: 0 + uxthClassId: uxthPROGRESS + inRect: rect]; } @end @@ -939,9 +939,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { } if (![self drawPartId: SBP_ARROWBTN - stateId: stateId - uxthClassId: uxthSCROLLBAR - inRect: rect]) + stateId: stateId + uxthClassId: uxthSCROLLBAR + inRect: rect]) [super drawScrollerButtonInRect: rect enabled: enabled pressed: pressed @@ -954,17 +954,17 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { highlight: (BOOL) highlight { if (![self drawPartId: vertical ? SBP_THUMBBTNVERT : SBP_THUMBBTNHORZ - stateId: highlight ? SCRBS_PRESSED : SCRBS_NORMAL - uxthClassId: uxthSCROLLBAR - inRect: rect]) + stateId: highlight ? SCRBS_PRESSED : SCRBS_NORMAL + uxthClassId: uxthSCROLLBAR + inRect: rect]) [super drawScrollerKnobInRect: rect vertical: vertical highlight: highlight]; [self drawPartId: vertical ? SBP_GRIPPERVERT : SBP_GRIPPERHORZ - stateId: 0 - uxthClassId: uxthSCROLLBAR - inRect: rect]; + stateId: 0 + uxthClassId: uxthSCROLLBAR + inRect: rect]; } - (void) drawScrollerTrackInRect: (NSRect) rect @@ -972,13 +972,13 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { upOrLeft: (BOOL) upOrLeft { int partId = vertical - ? (upOrLeft ? SBP_UPPERTRACKVERT : SBP_LOWERTRACKVERT) - : (upOrLeft ? SBP_UPPERTRACKHORZ : SBP_LOWERTRACKHORZ); + ? (upOrLeft ? SBP_UPPERTRACKVERT : SBP_LOWERTRACKVERT) + : (upOrLeft ? SBP_UPPERTRACKHORZ : SBP_LOWERTRACKHORZ); if (![self drawPartId: partId - stateId: SCRBS_NORMAL - uxthClassId: uxthSCROLLBAR - inRect: rect]) + stateId: SCRBS_NORMAL + uxthClassId: uxthSCROLLBAR + inRect: rect]) [super drawScrollerTrackInRect: rect vertical: vertical upOrLeft: upOrLeft]; @@ -994,9 +994,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { rect.origin.y -= 1.0; rect.size.height += 1.0; if (![self drawPartId: HP_HEADERITEM - stateId: highlighted ? HIS_PRESSED : HIS_NORMAL - uxthClassId: uxthHEADER - inRect: rect]) + stateId: highlighted ? HIS_PRESSED : HIS_NORMAL + uxthClassId: uxthHEADER + inRect: rect]) [super drawTableViewHeaderInRect: rect highlighted: highlighted]; } @@ -1004,9 +1004,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { rect.origin.y -= 1.0; rect.size.height += 1.0; if (![self drawPartId: HP_HEADERITEM - stateId: HIS_NORMAL - uxthClassId: uxthHEADER - inRect: rect]) + stateId: HIS_NORMAL + uxthClassId: uxthHEADER + inRect: rect]) [super drawTableViewCornerInRect: rect]; } @@ -1020,10 +1020,10 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { pressed: (BOOL) pressed { if (![self drawPartId: CP_DROPDOWNBUTTON - stateId: enabled ? (pressed ? CBXS_PRESSED : CBXS_NORMAL) - : CBXS_DISABLED - uxthClassId: uxthCOMBOBOX - inRect: rect]) + stateId: enabled ? (pressed ? CBXS_PRESSED : CBXS_NORMAL) + : CBXS_DISABLED + uxthClassId: uxthCOMBOBOX + inRect: rect]) [super drawComboBoxButtonInRect: rect enabled: (BOOL) enabled bordered: bordered @@ -1059,9 +1059,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { } if (![self drawPartId: partId - stateId: highlighted ? TUS_PRESSED : TUS_NORMAL - uxthClassId: uxthTRACKBAR - inRect: rect]) + stateId: highlighted ? TUS_PRESSED : TUS_NORMAL + uxthClassId: uxthTRACKBAR + inRect: rect]) [super drawSliderKnobInRect: rect vertical: vertical highlighted: highlighted @@ -1086,9 +1086,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { } if (![self drawPartId: vertical ? TKP_TRACKVERT : TKP_TRACK - stateId: TRS_NORMAL - uxthClassId: uxthTRACKBAR - inRect: thin]) + stateId: TRS_NORMAL + uxthClassId: uxthTRACKBAR + inRect: thin]) [super drawSliderTrackInRect: rect vertical: vertical hasTickMarks: hasTickMarks]; @@ -1105,9 +1105,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { upNotDown: (BOOL) upNotDown { if (![self drawPartId: upNotDown ? SPNP_UP : SPNP_DOWN - stateId: enabled ? DNS_NORMAL : DNS_DISABLED - uxthClassId: uxthSPIN - inRect: rect]) + stateId: enabled ? DNS_NORMAL : DNS_DISABLED + uxthClassId: uxthSPIN + inRect: rect]) [super drawStepperButtonInRect: rect clipRect: (NSRect) clipRect enabled: enabled @@ -1130,9 +1130,9 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { rect.origin.y -= 2; if (![self drawPartId: TABP_TABITEM - stateId: selected ? TIS_SELECTED : TIS_NORMAL - uxthClassId: uxthTAB - inRect: rect]) + stateId: selected ? TIS_SELECTED : TIS_NORMAL + uxthClassId: uxthTAB + inRect: rect]) [super drawTabInRect: rect clipRect: clipRect color: color @@ -1141,17 +1141,17 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { - (void) drawTabPaneInRect: (NSRect) rect { if (![self drawPartId: TABP_PANE - stateId: TIS_NORMAL - uxthClassId: uxthTAB - inRect: rect]) + stateId: TIS_NORMAL + uxthClassId: uxthTAB + inRect: rect]) [super drawTabPaneInRect: rect]; } - (void) drawTabViewBackgroundInRect: (NSRect) rect { if (![self drawPartId: TABP_BODY - stateId: TIS_NORMAL - uxthClassId: uxthTAB - inRect: rect]) + stateId: TIS_NORMAL + uxthClassId: uxthTAB + inRect: rect]) [super drawTabPaneInRect: rect]; } @@ -1163,25 +1163,25 @@ static inline RECT transformToRECT(O2AffineTransform matrix, NSRect rect) { bezeledNotLine: (BOOL) bezeledNotLine { if (![self drawPartId: EP_EDITTEXT - stateId: ETS_NORMAL - uxthClassId: uxthEDIT - inRect: rect]) + stateId: ETS_NORMAL + uxthClassId: uxthEDIT + inRect: rect]) [super drawTextFieldBorderInRect: rect bezeledNotLine: bezeledNotLine]; } - (void) drawBoxWithBezelInRect: (NSRect) rect clipRect: (NSRect) clipRect { if (![self drawPartId: BP_GROUPBOX - stateId: GBS_NORMAL - uxthClassId: uxthBUTTON - inRect: rect]) + stateId: GBS_NORMAL + uxthClassId: uxthBUTTON + inRect: rect]) [super drawBoxWithBezelInRect: rect clipRect: clipRect]; } - (void) drawBoxWithGrooveInRect: (NSRect) rect clipRect: (NSRect) clipRect { if (![self drawPartId: BP_GROUPBOX - stateId: GBS_NORMAL - uxthClassId: uxthBUTTON - inRect: rect]) + stateId: GBS_NORMAL + uxthClassId: uxthBUTTON + inRect: rect]) [super drawBoxWithGrooveInRect: rect clipRect: clipRect]; } diff --git a/AppKit/Win32.subproj/NSOpenPanel-Win32.m b/AppKit/Win32.subproj/NSOpenPanel-Win32.m index 636b3bd9..50e7e14c 100644 --- a/AppKit/Win32.subproj/NSOpenPanel-Win32.m +++ b/AppKit/Win32.subproj/NSOpenPanel-Win32.m @@ -58,12 +58,12 @@ static int CALLBACK browseFolderHook(HWND hdlg, UINT uMsg, LPARAM lParam, unichar displayName[MAX_PATH + 1]; @synchronized(self) { - browseInfo.hwndOwner = - [(Win32Window *) [[NSApp keyWindow] platformWindow] windowHandle]; + browseInfo.hwndOwner = [(Win32Window *) [[NSApp keyWindow] + platformWindow] windowHandle]; browseInfo.pidlRoot = NULL; browseInfo.pszDisplayName = displayName; browseInfo.lpszTitle = (const unichar *) [_dialogTitle - cStringUsingEncoding: NSUnicodeStringEncoding]; + cStringUsingEncoding: NSUnicodeStringEncoding]; browseInfo.ulFlags = BIF_NEWDIALOGSTYLE; if ([initialPath length]) { browseInfo.lpfn = browseFolderHook; @@ -94,10 +94,10 @@ static int CALLBACK browseFolderHook(HWND hdlg, UINT uMsg, LPARAM lParam, @synchronized(self) { [_filenames release]; _filenames = [[NSArray - arrayWithObject: [NSString - stringWithCharacters: displayName - length: wcslen(displayName)]] - retain]; + arrayWithObject: + [NSString stringWithCharacters: displayName + length: wcslen(displayName)]] + retain]; if ([_filenames count] > 0) { [_filename release]; @@ -161,33 +161,34 @@ static unsigned *openFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, unichar *fileTypes, *p, *q; int i, j, fileTypesLength, check; NSArray *allTypes = - [[NSDocumentController sharedDocumentController] _allFileTypes]; + [[NSDocumentController sharedDocumentController] _allFileTypes]; NSDictionary *typeDict; NSArray *typeExtensions; if (types) { types = [types - sortedArrayUsingSelector: @selector(caseInsensitiveCompare:)]; + sortedArrayUsingSelector: @selector(caseInsensitiveCompare:)]; fileTypesLength = strlen("Supported ("); for (j = 0; j < [types count]; j++) // 2 x length of *. + semicolon fileTypesLength += - 2 * (2 + [[types objectAtIndex: j] cStringLength] + 1); + 2 * (2 + [[types objectAtIndex: j] cStringLength] + 1); fileTypesLength += 1; // space for one \0 for (i = 0; i < [allTypes count]; i++) { typeDict = [allTypes objectAtIndex: i]; // length of the full name of the document type + blank + opening // bracket - fileTypesLength += - [[typeDict objectForKey: @"CFBundleTypeName"] cStringLength] + - 2; + fileTypesLength += [[typeDict objectForKey: @"CFBundleTypeName"] + cStringLength] + + 2; typeExtensions = [typeDict objectForKey: @"CFBundleTypeExtensions"]; for (j = 0; j < [typeExtensions count]; j++) // 2 x length of *. + semicolon fileTypesLength += - 2 * - (2 + [[typeExtensions objectAtIndex: j] cStringLength] + 1); + 2 * + (2 + [[typeExtensions objectAtIndex: j] cStringLength] + + 1); fileTypesLength += 1; // space for one \0 } fileTypesLength++; // the final \0 @@ -240,8 +241,8 @@ static unsigned *openFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, @synchronized(self) { openFileName.lStructSize = sizeof(OPENFILENAME); - openFileName.hwndOwner = - [(Win32Window *) [[NSApp keyWindow] platformWindow] windowHandle]; + openFileName.hwndOwner = [(Win32Window *) [[NSApp keyWindow] + platformWindow] windowHandle]; openFileName.hInstance = NULL; openFileName.lpstrFilter = fileTypes; openFileName.lpstrCustomFilter = NULL; @@ -254,11 +255,11 @@ static unsigned *openFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, openFileName.nMaxFileTitle = 0; openFileName.lpstrInitialDir = [_directory fileSystemRepresentationW]; openFileName.lpstrTitle = (const unichar *) [_dialogTitle - cStringUsingEncoding: NSUnicodeStringEncoding]; + cStringUsingEncoding: NSUnicodeStringEncoding]; openFileName.Flags = - (_allowsMultipleSelection ? OFN_ALLOWMULTISELECT : 0) | - OFN_NOTESTFILECREATE | OFN_EXPLORER | OFN_HIDEREADONLY | - OFN_ENABLEHOOK | OFN_ENABLESIZING; + (_allowsMultipleSelection ? OFN_ALLOWMULTISELECT : 0) | + OFN_NOTESTFILECREATE | OFN_EXPLORER | OFN_HIDEREADONLY | + OFN_ENABLEHOOK | OFN_ENABLESIZING; openFileName.nFileOffset = 0; openFileName.nFileExtension = 0; openFileName.lpstrDefExt = NULL; @@ -279,9 +280,9 @@ static unsigned *openFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, @synchronized(self) { [_filenames release]; { - NSString *firstFile = - [NSString stringWithCharacters: openFileName.lpstrFile - length: wcslen(openFileName.lpstrFile)]; + NSString *firstFile = [NSString + stringWithCharacters: openFileName.lpstrFile + length: wcslen(openFileName.lpstrFile)]; int offset = openFileName.nFileOffset; if (offset < [firstFile length]) @@ -291,15 +292,17 @@ static unsigned *openFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, while (YES) { NSString *next = [NSString - stringWithCharacters: openFileName.lpstrFile + offset - length: wcslen(openFileName.lpstrFile + - offset)]; + stringWithCharacters: openFileName.lpstrFile + + offset + length: wcslen(openFileName + .lpstrFile + + offset)]; if ([next length] == 0) break; - [list addObject: [firstFile - stringByAppendingPathComponent: next]]; + [list addObject: [firstFile stringByAppendingPathComponent: + next]]; offset += [next length] + 1; } _filenames = [list retain]; diff --git a/AppKit/Win32.subproj/NSSavePanel-Win32.m b/AppKit/Win32.subproj/NSSavePanel-Win32.m index 28d274dd..8a604201 100644 --- a/AppKit/Win32.subproj/NSSavePanel-Win32.m +++ b/AppKit/Win32.subproj/NSSavePanel-Win32.m @@ -54,10 +54,10 @@ static unsigned *saveFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, if ([type length] > 0 && [type isEqualToString: extension]) { - int result = NSRunAlertPanel( - nil, - @"%@ already exists. Do you want to replace it?", - @"Yes", @"No", nil, file); + int result = NSRunAlertPanel(nil, + @"%@ already exists. Do " + @"you want to replace it?", + @"Yes", @"No", nil, file); if (result == NSAlertDefaultReturn) { notify->lpOFN->lCustData = 0xFFFFFFFF; @@ -82,17 +82,17 @@ static unsigned *saveFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, @synchronized(self) { unichar filename[1025] = L""; NSString *ext = (_requiredFileType && [_requiredFileType length] > 0) - ? _requiredFileType - : (NSString *) @"*"; + ? _requiredFileType + : (NSString *) @"*"; NSString *first = [[[NSString alloc] - initWithFormat: @"Document (*.%@)", ext] autorelease]; + initWithFormat: @"Document (*.%@)", ext] autorelease]; NSString *second = - [[[NSString alloc] initWithFormat: @"*.%@", ext] autorelease]; + [[[NSString alloc] initWithFormat: @"*.%@", ext] autorelease]; size_t firstLength = [first cStringLength]; size_t secondLength = [second cStringLength]; size_t fileTypesLength = (firstLength + secondLength + 3); unichar *fileTypes = - (unichar *) alloca(sizeof(unichar) * fileTypesLength); + (unichar *) alloca(sizeof(unichar) * fileTypesLength); fileTypes[firstLength] = 0; fileTypes[fileTypesLength - 2] = 0; @@ -101,8 +101,8 @@ static unsigned *saveFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, wcscpy(fileTypes + firstLength + 1, [second fileSystemRepresentationW]); openFileName.lStructSize = sizeof(OPENFILENAMEW); - openFileName.hwndOwner = - [(Win32Window *) [[NSApp keyWindow] platformWindow] windowHandle]; + openFileName.hwndOwner = [(Win32Window *) [[NSApp keyWindow] + platformWindow] windowHandle]; openFileName.hInstance = NULL; openFileName.lpstrFilter = fileTypes; openFileName.lpstrCustomFilter = NULL; @@ -115,7 +115,7 @@ static unsigned *saveFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, openFileName.nMaxFileTitle = 0; openFileName.lpstrInitialDir = [_directory fileSystemRepresentationW]; openFileName.lpstrTitle = (const unichar *) [_dialogTitle - cStringUsingEncoding: NSUnicodeStringEncoding]; + cStringUsingEncoding: NSUnicodeStringEncoding]; openFileName.Flags = OFN_CREATEPROMPT | OFN_NOTESTFILECREATE | OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_ENABLEHOOK | @@ -124,7 +124,7 @@ static unsigned *saveFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, openFileName.nFileExtension = 0; if ([_requiredFileType length] > 0) { openFileName.lpstrDefExt = (const unichar *) [_requiredFileType - cStringUsingEncoding: NSUnicodeStringEncoding]; + cStringUsingEncoding: NSUnicodeStringEncoding]; } else { openFileName.lpstrDefExt = NULL; } @@ -144,12 +144,12 @@ static unsigned *saveFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, [_filename release]; _filename = [[NSString - stringWithCharacters: openFileName.lpstrFile - length: wcslen(openFileName.lpstrFile)] copy]; + stringWithCharacters: openFileName.lpstrFile + length: wcslen(openFileName.lpstrFile)] copy]; if (![[_filename pathExtension] isEqualToString: _requiredFileType]) { [_filename autorelease]; _filename = [[_filename - stringByAppendingPathExtension: _requiredFileType] copy]; + stringByAppendingPathExtension: _requiredFileType] copy]; } } diff --git a/AppKit/Win32.subproj/NSSound_DirectShow.m b/AppKit/Win32.subproj/NSSound_DirectShow.m index 5abde20b..53ecec53 100644 --- a/AppKit/Win32.subproj/NSSound_DirectShow.m +++ b/AppKit/Win32.subproj/NSSound_DirectShow.m @@ -21,8 +21,9 @@ static GUID IID_IGraphBuilder = {0x56a868a9, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, CLSCTX_INPROC_SERVER, &IID_IGraphBuilder, (void **) &_graphBuilder))) { if (_graphBuilder != NULL) { - _graphBuilder->lpVtbl->QueryInterface( - _graphBuilder, &IID_IMediaControl, (void **) &_mediaControl); + _graphBuilder->lpVtbl->QueryInterface(_graphBuilder, + &IID_IMediaControl, + (void **) &_mediaControl); const unichar *soundPathW = [_path fileSystemRepresentationW]; diff --git a/AppKit/Win32.subproj/NSSound_win32.m b/AppKit/Win32.subproj/NSSound_win32.m index 1756df3b..52b02be8 100644 --- a/AppKit/Win32.subproj/NSSound_win32.m +++ b/AppKit/Win32.subproj/NSSound_win32.m @@ -47,12 +47,12 @@ static unsigned int uniquenum = 1; // FIXME: Instead of returned this predetermined set (XPSP2) we should // query it something *like* GetProfileString("mci extensions",....); - return - [NSArray arrayWithObjects: @"wav", @"aif", @"aifc", @"aiff", @"asf", - @"asx", @"au", @"m1v", @"m3u", @"mp2", - @"mp2v", @"mp3", @"mpa", @"mpe", @"mpeg", - @"mpg", @"mpv2", @"snd", @"wax", @"wm", - @"wma", @"wmv", @"wmx", @"wpl", @"wvx", nil]; + return [NSArray arrayWithObjects: @"wav", @"aif", @"aifc", @"aiff", @"asf", + @"asx", @"au", @"m1v", @"m3u", @"mp2", + @"mp2v", @"mp3", @"mpa", @"mpe", @"mpeg", + @"mpg", @"mpv2", @"snd", @"wax", @"wm", + @"wma", @"wmv", @"wmx", @"wpl", @"wvx", + nil]; } @end @@ -86,12 +86,12 @@ static unsigned int uniquenum = 1; } NSString *loadStr = [NSString - stringWithFormat: @"open \"%@\" type %@ alias %i", _soundFilePath, - [[_soundFilePath pathExtension] - isEqualToString: @"wav"] - ? @"waveaudio" - : @"MPEGVideo", - _handle]; + stringWithFormat: @"open \"%@\" type %@ alias %i", _soundFilePath, + [[_soundFilePath pathExtension] + isEqualToString: @"wav"] + ? @"waveaudio" + : @"MPEGVideo", + _handle]; if (mciSendString([loadStr UTF8String], NULL, 0, 0)) return NO; @@ -108,7 +108,7 @@ static unsigned int uniquenum = 1; else { if (_handle != 0) { NSString *pauseStr = - [NSString stringWithFormat: @"pause %i", _handle]; + [NSString stringWithFormat: @"pause %i", _handle]; mciSendString([pauseStr UTF8String], NULL, 0, 0); } _paused = YES; @@ -122,7 +122,7 @@ static unsigned int uniquenum = 1; else { if (_handle != 0) { NSString *pauseStr = - [NSString stringWithFormat: @"resume %i", _handle]; + [NSString stringWithFormat: @"resume %i", _handle]; mciSendString([pauseStr UTF8String], NULL, 0, 0); } _paused = NO; diff --git a/AppKit/Win32.subproj/O2Context_gdi+AppKit.h b/AppKit/Win32.subproj/O2Context_gdi+AppKit.h index aa6fe890..45dc25a4 100644 --- a/AppKit/Win32.subproj/O2Context_gdi+AppKit.h +++ b/AppKit/Win32.subproj/O2Context_gdi+AppKit.h @@ -4,7 +4,7 @@ - initWithHWND: (HWND) handle; - initWithPrinterDC: (HDC) printer - auxiliaryInfo: (NSDictionary *) auxiliaryInfo; + auxiliaryInfo: (NSDictionary *) auxiliaryInfo; - (HWND) windowHandle; @end diff --git a/AppKit/Win32.subproj/O2Context_gdi+AppKit.m b/AppKit/Win32.subproj/O2Context_gdi+AppKit.m index c14551e9..e82e4b33 100644 --- a/AppKit/Win32.subproj/O2Context_gdi+AppKit.m +++ b/AppKit/Win32.subproj/O2Context_gdi+AppKit.m @@ -10,27 +10,27 @@ - initWithHWND: (HWND) handle { O2DeviceContext_gdi *deviceContext = [[[Win32DeviceContextWindow alloc] - initWithWindowHandle: handle] autorelease]; + initWithWindowHandle: handle] autorelease]; NSSize size = [deviceContext pixelSize]; O2GState *gState = [[[O2GState alloc] - initFlippedWithDeviceHeight: size.height] autorelease]; + initFlippedWithDeviceHeight: size.height] autorelease]; return [self initWithGraphicsState: gState deviceContext: deviceContext]; } - initWithPrinterDC: (HDC) printer - auxiliaryInfo: (NSDictionary *) auxiliaryInfo + auxiliaryInfo: (NSDictionary *) auxiliaryInfo { - O2DeviceContext_gdi *deviceContext = - [[[Win32DeviceContextPrinter alloc] initWithDC: printer] autorelease]; + O2DeviceContext_gdi *deviceContext = [[[Win32DeviceContextPrinter alloc] + initWithDC: printer] autorelease]; NSSize pointSize = [deviceContext pointSize]; NSSize pixelsPerInch = [deviceContext pixelsPerInch]; O2AffineTransform scale = O2AffineTransformMakeScale( - pixelsPerInch.width / 72.0, pixelsPerInch.height / 72.0); + pixelsPerInch.width / 72.0, pixelsPerInch.height / 72.0); O2GState *gState = - [[[O2GState alloc] initFlippedWithDeviceHeight: pointSize.height - concat: scale] autorelease]; + [[[O2GState alloc] initFlippedWithDeviceHeight: pointSize.height + concat: scale] autorelease]; if ([self initWithGraphicsState: gState deviceContext: deviceContext] == nil) @@ -48,27 +48,27 @@ - (BOOL) isBitmapContext { return [[self deviceContext] - isKindOfClass: [Win32DeviceContextPrinter class]] == NO; + isKindOfClass: [Win32DeviceContextPrinter class]] == NO; } - initWithSize: (NSSize) size window: (CGWindow *) window { O2GState *gState = [[[O2GState alloc] - initFlippedWithDeviceHeight: size.height] autorelease]; + initFlippedWithDeviceHeight: size.height] autorelease]; HWND handle = [(Win32Window *) window windowHandle]; O2DeviceContext_gdi *deviceContext = [[[Win32DeviceContextWindow alloc] - initWithWindowHandle: handle] autorelease]; + initWithWindowHandle: handle] autorelease]; return [self initWithGraphicsState: gState deviceContext: deviceContext]; } - initWithSize: (NSSize) size context: (O2Context *) otherX { O2GState *gState = [[[O2GState alloc] - initFlippedWithDeviceHeight: size.height] autorelease]; + initFlippedWithDeviceHeight: size.height] autorelease]; O2Context_gdi *other = (O2Context_gdi *) otherX; O2Surface_DIBSection *surface = - [[O2Surface_DIBSection alloc] initWithWidth: size.width - height: size.height - compatibleWithDeviceContext: [other deviceContext]]; + [[O2Surface_DIBSection alloc] initWithWidth: size.width + height: size.height + compatibleWithDeviceContext: [other deviceContext]]; self = [self initWithGraphicsState: gState deviceContext: [surface deviceContext]]; diff --git a/AppKit/Win32.subproj/Win32Display.m b/AppKit/Win32.subproj/Win32Display.m index 7c87ea00..6ba6ad24 100644 --- a/AppKit/Win32.subproj/Win32Display.m +++ b/AppKit/Win32.subproj/Win32Display.m @@ -133,20 +133,20 @@ static DWORD WINAPI runWaitCursor(LPVOID arg) { // bundled application fonts - returns nil if the path is not specified so // the original code path is followed NSString *fontsDir = [[NSBundle mainBundle] - objectForInfoDictionaryKey: @"ATSApplicationFontsPath"]; + objectForInfoDictionaryKey: @"ATSApplicationFontsPath"]; NSArray *ttfPaths = - [[NSBundle mainBundle] pathsForResourcesOfType: @"ttf" - inDirectory: fontsDir]; + [[NSBundle mainBundle] pathsForResourcesOfType: @"ttf" + inDirectory: fontsDir]; NSArray *TTFPaths = - [[NSBundle mainBundle] pathsForResourcesOfType: @"TTF" - inDirectory: fontsDir]; + [[NSBundle mainBundle] pathsForResourcesOfType: @"TTF" + inDirectory: fontsDir]; NSArray *otfPaths = - [[NSBundle mainBundle] pathsForResourcesOfType: @"otf" - inDirectory: fontsDir]; + [[NSBundle mainBundle] pathsForResourcesOfType: @"otf" + inDirectory: fontsDir]; NSArray *OTFPaths = - [[NSBundle mainBundle] pathsForResourcesOfType: @"OTF" - inDirectory: fontsDir]; + [[NSBundle mainBundle] pathsForResourcesOfType: @"OTF" + inDirectory: fontsDir]; NSMutableArray *allPaths = [NSMutableArray arrayWithCapacity: 100]; [allPaths addObjectsFromArray: ttfPaths]; @@ -211,8 +211,8 @@ static BOOL CALLBACK monitorEnumerator(HMONITOR hMonitor, HDC hdcMonitor, visibleFrame.origin.y = NSHeight(frame) - NSHeight(visibleFrame); NSScreen *screen = - [[[NSScreen alloc] initWithFrame: frame - visibleFrame: visibleFrame] autorelease]; + [[[NSScreen alloc] initWithFrame: frame + visibleFrame: visibleFrame] autorelease]; if (info.dwFlags & MONITORINFOF_PRIMARY) [array insertObject: screen atIndex: 0]; @@ -237,10 +237,10 @@ static BOOL CALLBACK monitorEnumerator(HMONITOR hMonitor, HDC hdcMonitor, NSRect frame = NSMakeRect(0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); - return - [NSArray arrayWithObject: [[[NSScreen alloc] initWithFrame: frame - visibleFrame: frame] - autorelease]]; + return [NSArray + arrayWithObject: [[[NSScreen alloc] initWithFrame: frame + visibleFrame: frame] + autorelease]]; } } @@ -297,45 +297,45 @@ static BOOL CALLBACK monitorEnumerator(HMONITOR hMonitor, HDC hdcMonitor, NSString *name; int value; } table[] = { - {@"controlBackgroundColor", COLOR_WINDOW}, - {@"controlColor", COLOR_3DFACE}, - {@"controlDarkShadowColor", COLOR_3DDKSHADOW}, - {@"controlHighlightColor", COLOR_3DLIGHT}, - {@"controlLightHighlightColor", COLOR_3DHILIGHT}, - {@"controlShadowColor", COLOR_3DSHADOW}, - {@"controlTextColor", COLOR_BTNTEXT}, - // { @"disabledControlTextColor", COLOR_3DSHADOW }, - {@"disabledControlTextColor", COLOR_GRAYTEXT}, - {@"highlightColor", COLOR_3DHILIGHT}, - {@"knobColor", COLOR_3DFACE}, - {@"scrollBarColor", COLOR_SCROLLBAR}, - {@"selectedControlColor", COLOR_HIGHLIGHT}, - {@"selectedControlTextColor", COLOR_HIGHLIGHTTEXT}, - {@"selectedKnobColor", COLOR_HIGHLIGHT}, - {@"selectedTextBackgroundColor", COLOR_HIGHLIGHT}, - {@"selectedTextColor", COLOR_HIGHLIGHTTEXT}, - {@"shadowColor", COLOR_3DDKSHADOW}, - {@"textBackgroundColor", COLOR_WINDOW}, - {@"textColor", COLOR_WINDOWTEXT}, - {@"gridColor", COLOR_INACTIVEBORDER}, // what should this be? - {@"headerColor", COLOR_3DFACE}, // these do not appear in the user-space - // System color list, - {@"headerTextColor", - COLOR_BTNTEXT}, // probably because Apple builds that off System.clr - {@"alternateSelectedControlColor", COLOR_WINDOW}, // FIXME: - {@"alternateSelectedControlTextColor", COLOR_WINDOWTEXT}, // FIXME: - {@"secondarySelectedControlColor", COLOR_HIGHLIGHT}, // FIXME: - {@"keyboardFocusIndicatorColor", COLOR_ACTIVEBORDER}, // FIXME: - {@"windowFrameColor", COLOR_WINDOWFRAME}, // FIXME: - {@"selectedMenuItemColor", 29 /* COLOR_MENUHILIGHT */}, // FIXME: - {@"selectedMenuItemTextColor", COLOR_HIGHLIGHTTEXT}, // FIXME: - // extensions - {@"menuBackgroundColor", COLOR_MENU}, - {@"mainMenuBarColor", 30}, - {@"menuItemTextColor", COLOR_MENUTEXT}, - {@"_sourceListBackgroundColor", COLOR_WINDOW}, + {@"controlBackgroundColor", COLOR_WINDOW}, + {@"controlColor", COLOR_3DFACE}, + {@"controlDarkShadowColor", COLOR_3DDKSHADOW}, + {@"controlHighlightColor", COLOR_3DLIGHT}, + {@"controlLightHighlightColor", COLOR_3DHILIGHT}, + {@"controlShadowColor", COLOR_3DSHADOW}, + {@"controlTextColor", COLOR_BTNTEXT}, + // { @"disabledControlTextColor", COLOR_3DSHADOW }, + {@"disabledControlTextColor", COLOR_GRAYTEXT}, + {@"highlightColor", COLOR_3DHILIGHT}, + {@"knobColor", COLOR_3DFACE}, + {@"scrollBarColor", COLOR_SCROLLBAR}, + {@"selectedControlColor", COLOR_HIGHLIGHT}, + {@"selectedControlTextColor", COLOR_HIGHLIGHTTEXT}, + {@"selectedKnobColor", COLOR_HIGHLIGHT}, + {@"selectedTextBackgroundColor", COLOR_HIGHLIGHT}, + {@"selectedTextColor", COLOR_HIGHLIGHTTEXT}, + {@"shadowColor", COLOR_3DDKSHADOW}, + {@"textBackgroundColor", COLOR_WINDOW}, + {@"textColor", COLOR_WINDOWTEXT}, + {@"gridColor", COLOR_INACTIVEBORDER}, // what should this be? + {@"headerColor", COLOR_3DFACE}, // these do not appear in the + // user-space System color list, + {@"headerTextColor", COLOR_BTNTEXT}, // probably because Apple + // builds that off System.clr + {@"alternateSelectedControlColor", COLOR_WINDOW}, // FIXME: + {@"alternateSelectedControlTextColor", COLOR_WINDOWTEXT}, // FIXME: + {@"secondarySelectedControlColor", COLOR_HIGHLIGHT}, // FIXME: + {@"keyboardFocusIndicatorColor", COLOR_ACTIVEBORDER}, // FIXME: + {@"windowFrameColor", COLOR_WINDOWFRAME}, // FIXME: + {@"selectedMenuItemColor", 29 /* COLOR_MENUHILIGHT */}, // FIXME: + {@"selectedMenuItemTextColor", COLOR_HIGHLIGHTTEXT}, // FIXME: + // extensions + {@"menuBackgroundColor", COLOR_MENU}, + {@"mainMenuBarColor", 30}, + {@"menuItemTextColor", COLOR_MENUTEXT}, + {@"_sourceListBackgroundColor", COLOR_WINDOW}, - {nil, 0}}; + {nil, 0}}; int i; CGColorSpaceRef colorSpace = [[O2ColorSpace alloc] initWithPlatformRGB]; @@ -450,15 +450,15 @@ static BOOL CALLBACK monitorEnumerator(HMONITOR hMonitor, HDC hdcMonitor, [self stopWaitCursor]; do { - result = - [super nextEventMatchingMask: mask | NSPlatformSpecificDisplayMask - untilDate: untilDate - inMode: mode - dequeue: dequeue]; + result = [super + nextEventMatchingMask: mask | NSPlatformSpecificDisplayMask + untilDate: untilDate + inMode: mode + dequeue: dequeue]; if ([result type] == NSPlatformSpecificDisplayEvent) { Win32Event *win32Event = (Win32Event *) [( - NSEvent_CoreGraphics *) result coreGraphicsEvent]; + NSEvent_CoreGraphics *) result coreGraphicsEvent]; MSG msg = [win32Event msg]; DispatchMessageW(&msg); @@ -888,8 +888,8 @@ perhaps passing the windows values through. bufferSize = 1; } else { BOOL isCtrlAlt = - (modifierFlags & (NSCommandKeyMask | NSAlternateKeyMask)) == - (NSCommandKeyMask | NSAlternateKeyMask); + (modifierFlags & (NSCommandKeyMask | NSAlternateKeyMask)) == + (NSCommandKeyMask | NSAlternateKeyMask); BOOL isCtrl = (modifierFlags & NSCommandKeyMask) == NSCommandKeyMask; if (isCtrl == NO || isCtrlAlt == YES) { // Not a shortcut - use the normal char composing path @@ -920,8 +920,8 @@ perhaps passing the windows values through. } if (ignoringBufferSize > 0) { NSString *str = [[[NSString alloc] - initWithCharacters: ignoringBuffer - length: ignoringBufferSize] autorelease]; + initWithCharacters: ignoringBuffer + length: ignoringBufferSize] autorelease]; [_ignoringModifiersString appendString: str]; } @@ -936,7 +936,7 @@ perhaps passing the windows values through. // Let's save the current keyCode _keyCode = - appleKeyCodeForWindowsKeyCode(msg.wParam, msg.lParam, &_isKeypad); + appleKeyCodeForWindowsKeyCode(msg.wParam, msg.lParam, &_isKeypad); if (bufferSize == 0) { // clang-format off @@ -1040,10 +1040,10 @@ perhaps passing the windows values through. NSEvent *event; BOOL isKeypad; - NSString *characters = (bufferSize > 0) - ? [NSString stringWithCharacters: buffer - length: bufferSize] - : @""; + NSString *characters = + (bufferSize > 0) ? [NSString stringWithCharacters: buffer + length: bufferSize] + : @""; NSString *charactersIgnoringModifiers = _ignoringModifiersString; // Only send the event if we have something to send if (characters.length > 0 || charactersIgnoringModifiers.length > 0) { @@ -1053,18 +1053,17 @@ perhaps passing the windows values through. if (_isKeypad) { modifierFlags |= NSNumericPadKeyMask; } - event = [NSEvent - keyEventWithType: type - location: location - modifierFlags: modifierFlags - timestamp: [NSDate - timeIntervalSinceReferenceDate] - windowNumber: [window windowNumber] - context: nil - characters: characters - charactersIgnoringModifiers: charactersIgnoringModifiers - isARepeat: isARepeat - keyCode: _keyCode]; + event = [NSEvent keyEventWithType: type + location: location + modifierFlags: modifierFlags + timestamp: + [NSDate timeIntervalSinceReferenceDate] + windowNumber: [window windowNumber] + context: nil + characters: characters + charactersIgnoringModifiers: charactersIgnoringModifiers + isARepeat: isARepeat + keyCode: _keyCode]; [self postEvent: event atStart: NO]; [_ignoringModifiersString release]; @@ -1209,8 +1208,9 @@ NSArray *CGSOrderedWindowNumbers() { Win32Window *platformWindow = GetProp(check, "Win32Window"); if (platformWindow != nil) - [result addObject: [NSNumber numberWithInteger: [platformWindow - windowNumber]]]; + [result addObject: [NSNumber + numberWithInteger: + [platformWindow windowNumber]]]; check = GetNextWindow(check, GW_HWNDNEXT); } @@ -1366,8 +1366,8 @@ static HWND findWindowForScrollWheel(POINT point) { case WM_NCMBUTTONDBLCLK: { Win32Event *cgEvent = [Win32Event eventWithMSG: msg]; NSEvent *event = [[[NSEvent_CoreGraphics alloc] - initWithCoreGraphicsEvent: cgEvent - window: window] autorelease]; + initWithCoreGraphicsEvent: cgEvent + window: window] autorelease]; [self postEvent: event atStart: NO]; } return YES; @@ -1465,8 +1465,8 @@ static int CALLBACK buildFamily(const const EXTLOGFONTW *logFont, NSMutableSet *set = (NSMutableSet *) lParam; // NSString *name=[NSString stringWithCString:logFont->elfFullName]; if (logFont && logFont->elfLogFont.lfFaceName) { - NSString *name = - [NSString stringWithFormat: @"%S", logFont->elfLogFont.lfFaceName]; + NSString *name = [NSString + stringWithFormat: @"%S", logFont->elfLogFont.lfFaceName]; // Font name starting with "@" are rotated versions of the font, for // vertical rendering We don't want them - the are polluting our font // list + they have the same PS name as the normal ones, leading to @@ -1496,8 +1496,8 @@ static NSFontMetric * fontMetricWithLogicalAndMetric(const ENUMLOGFONTEX *logFont, const NEWTEXTMETRICEX *textMetric) { - NSSize size = - NSMakeSize(logFont->elfLogFont.lfWidth, logFont->elfLogFont.lfHeight); + NSSize size = NSMakeSize(logFont->elfLogFont.lfWidth, + logFont->elfLogFont.lfHeight); CGFloat ascender = textMetric->ntmTm.tmAscent; CGFloat descender = -((CGFloat) textMetric->ntmTm.tmDescent); @@ -1514,9 +1514,9 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old, LPENUMLOGFONTEX logFont = (LPENUMLOGFONTEX) lofFont_old; NEWTEXTMETRICEX *textMetric = (NEWTEXTMETRICEX *) textMetric_old; NSString *name = - [NSString stringWithCString: (char *) (logFont->elfFullName)]; + [NSString stringWithCString: (char *) (logFont->elfFullName)]; NSString *traitName = - [NSString stringWithCString: (char *) logFont->elfStyle]; + [NSString stringWithCString: (char *) logFont->elfStyle]; // NSString *encoding=[NSString stringWithCString:logFont->elfScript]; NSFontTypeface *typeface = [result objectForKey: name]; @@ -1574,7 +1574,7 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old, setup.lStructSize = sizeof(PAGESETUPDLG); setup.hwndOwner = - [(Win32Window *) [[NSApp mainWindow] platformWindow] windowHandle]; + [(Win32Window *) [[NSApp mainWindow] platformWindow] windowHandle]; setup.hDevMode = NULL; setup.hDevNames = NULL; setup.Flags = PSD_INTHOUSANDTHSOFINCHES; @@ -1615,7 +1615,7 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old, } - (int) runModalPrintPanelWithPrintInfoDictionary: - (NSMutableDictionary *) attributes + (NSMutableDictionary *) attributes { NSView *view = [attributes objectForKey: @"_NSView"]; PRINTDLG printProperties; @@ -1647,22 +1647,22 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old, printProperties.lStructSize = sizeof(PRINTDLG); printProperties.hwndOwner = - [(Win32Window *) [[view window] platformWindow] windowHandle]; + [(Win32Window *) [[view window] platformWindow] windowHandle]; printProperties.hDevMode = devMode; printProperties.hDevNames = NULL; printProperties.hDC = NULL; printProperties.Flags = PD_RETURNDC | PD_COLLATE; printProperties.nFromPage = - [[attributes objectForKey: NSPrintFirstPage] intValue]; + [[attributes objectForKey: NSPrintFirstPage] intValue]; printProperties.nToPage = - [[attributes objectForKey: NSPrintLastPage] intValue]; + [[attributes objectForKey: NSPrintLastPage] intValue]; printProperties.nMinPage = - [[attributes objectForKey: NSPrintFirstPage] intValue]; + [[attributes objectForKey: NSPrintFirstPage] intValue]; printProperties.nMaxPage = - [[attributes objectForKey: NSPrintLastPage] intValue]; + [[attributes objectForKey: NSPrintLastPage] intValue]; printProperties.nCopies = - [[attributes objectForKey: NSPrintCopies] intValue]; + [[attributes objectForKey: NSPrintCopies] intValue]; printProperties.hInstance = NULL; printProperties.lCustData = 0; printProperties.lpfnPrintHook = NULL; @@ -1682,11 +1682,11 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old, return NSCancelButton; else { NSDictionary *auxiliaryInfo = [NSDictionary - dictionaryWithObject: [attributes objectForKey: @"_title"] - forKey: (id) kCGPDFContextTitle]; + dictionaryWithObject: [attributes objectForKey: @"_title"] + forKey: (id) kCGPDFContextTitle]; O2Context_gdi *context = [[[O2Context_gdi alloc] - initWithPrinterDC: printProperties.hDC - auxiliaryInfo: auxiliaryInfo] autorelease]; + initWithPrinterDC: printProperties.hDC + auxiliaryInfo: auxiliaryInfo] autorelease]; NSRect imageable; if ([context getImageableRect: &imageable]) @@ -1698,8 +1698,8 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old, [attributes setObject: [NSValue valueWithSize: [context pointSize]] forKey: NSPrintPaperSize]; [attributes - setObject: [NSNumber numberWithInt: printProperties.nFromPage] - forKey: NSPrintFirstPage]; + setObject: [NSNumber numberWithInt: printProperties.nFromPage] + forKey: NSPrintFirstPage]; [attributes setObject: [NSNumber numberWithInt: printProperties.nToPage] forKey: NSPrintLastPage]; @@ -1707,7 +1707,7 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old, // paper area, like Cocoa does - so translate the context to make // Cocotron happy O2AffineTransform translation = O2AffineTransformMakeTranslation( - -imageable.origin.x, -imageable.origin.y); + -imageable.origin.x, -imageable.origin.y); O2ContextConcatCTM(context, translation); } @@ -1715,16 +1715,16 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old, } - (int) savePanel: (NSSavePanel *) savePanel - runModalForDirectory: (NSString *) directory - file: (NSString *) file + runModalForDirectory: (NSString *) directory + file: (NSString *) file { return [savePanel _GetOpenFileName]; } - (int) openPanel: (NSOpenPanel *) openPanel - runModalForDirectory: (NSString *) directory - file: (NSString *) file - types: (NSArray *) types + runModalForDirectory: (NSString *) directory + file: (NSString *) file + types: (NSArray *) types { if ([openPanel canChooseDirectories]) return [openPanel _SHBrowseForFolder: directory]; diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DragSession.h b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DragSession.h index 4366d2f0..9faf8dd9 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DragSession.h +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DragSession.h @@ -34,7 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithWindow: (Win32Window *) window - pasteboard: (NSPasteboard *) pasteboard; + pasteboard: (NSPasteboard *) pasteboard; - (void) setSourceOperationMask: (unsigned) mask; - (void) setScreenLocation: (NSPoint) point; diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DragSession.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DragSession.m index 36a43a2a..1a593ee1 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DragSession.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DragSession.m @@ -27,7 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation Win32DragSession - initWithWindow: (Win32Window *) window - pasteboard: (NSPasteboard *) pasteboard + pasteboard: (NSPasteboard *) pasteboard { _window = [window retain]; _pasteboard = [pasteboard retain]; @@ -59,9 +59,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (BOOL) pasteboardTypesIntersectTypes: (NSArray *) check { return ([[[self draggingPasteboard] types] - firstObjectCommonWithArray: check] != nil) - ? YES - : NO; + firstObjectCommonWithArray: check] != nil) + ? YES + : NO; } - (NSWindow *) draggingDestinationWindow { @@ -73,8 +73,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSPoint) draggingLocation { - return - [[self draggingDestinationWindow] convertScreenToBase: _screenLocation]; + return [[self draggingDestinationWindow] + convertScreenToBase: _screenLocation]; } - (NSPoint) draggedImageLocation { diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DraggingManager.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DraggingManager.m index f4d22ccd..b2d40051 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DraggingManager.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DraggingManager.m @@ -39,7 +39,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) registerWindow: (NSWindow *) window dragTypes: (NSArray *) dragTypes { Win32IDropTargetServer *target = [[[Win32IDropTargetServer alloc] - initWithWindow: (Win32Window *) [window platformWindow]] autorelease]; + initWithWindow: (Win32Window *) [window platformWindow]] + autorelease]; if (target == nil) // RegisterDragDrop fails sometimes, unresolved. return; @@ -82,9 +83,9 @@ static unsigned sourceOperationForSource(id source, BOOL isLocal) { slideBack: (BOOL) slideBack { Win32IDataObjectServer *dataServer = [[Win32IDataObjectServer alloc] - initWithPasteboard: (Win32Pasteboard *) pasteboard]; + initWithPasteboard: (Win32Pasteboard *) pasteboard]; Win32IDropSourceServer *dropSource = - [[Win32IDropSourceServer alloc] initAsIDropSource]; + [[Win32IDropSourceServer alloc] initAsIDropSource]; unsigned sourceOperation = sourceOperationForSource(source, NO); unsigned targetOperation; DWORD sourceEffect = Win32DropEffectFromDragOperation(sourceOperation); diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DropPasteboard.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DropPasteboard.m index d2af649c..b7884eb0 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DropPasteboard.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32DropPasteboard.m @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithIDataObject: (IDataObject *) dataObject { _dataClient = - [[Win32IDataObjectClient alloc] initWithIDataObject: dataObject]; + [[Win32IDataObjectClient alloc] initWithIDataObject: dataObject]; return self; } @@ -41,9 +41,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([type isEqualToString: NSFilenamesPboardType]) { NSString *error = nil; NSData *result = [NSPropertyListSerialization - dataFromPropertyList: [_dataClient filenames] - format: NSPropertyListXMLFormat_v1_0 - errorDescription: &error]; + dataFromPropertyList: [_dataClient filenames] + format: NSPropertyListXMLFormat_v1_0 + errorDescription: &error]; if (error) { NSLog(@"Error: %@", error); [error release]; diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32GeneralPasteboard.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32GeneralPasteboard.m index f28bcb00..7b71a4ff 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32GeneralPasteboard.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32GeneralPasteboard.m @@ -26,8 +26,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (int) declareTypes: (NSArray *) types owner: (id) owner { int result = [super declareTypes: types owner: owner]; - Win32IDataObjectServer *dataServer = - [[[Win32IDataObjectServer alloc] initWithPasteboard: self] autorelease]; + Win32IDataObjectServer *dataServer = [[[Win32IDataObjectServer alloc] + initWithPasteboard: self] autorelease]; if (![dataServer setOnClipboard]) { NSLog(@"unable to set on clipboard"); @@ -39,8 +39,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (int) addTypes: (NSArray *) types owner: (id) owner { int result = [super addTypes: types owner: owner]; - Win32IDataObjectServer *dataServer = - [[[Win32IDataObjectServer alloc] initWithPasteboard: self] autorelease]; + Win32IDataObjectServer *dataServer = [[[Win32IDataObjectServer alloc] + initWithPasteboard: self] autorelease]; if (![dataServer setOnClipboard]) { NSLog(@"unable to set on clipboard"); @@ -52,8 +52,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSArray *) types { if ([self isClient]) { - Win32IDataObjectClient *dataClient = - [[[Win32IDataObjectClient alloc] initWithClipboard] autorelease]; + Win32IDataObjectClient *dataClient = [[[Win32IDataObjectClient alloc] + initWithClipboard] autorelease]; return [dataClient availableTypes]; } else @@ -70,8 +70,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSData *) dataForType: (NSString *) type { if ([self isClient]) { - Win32IDataObjectClient *dataClient = - [[[Win32IDataObjectClient alloc] initWithClipboard] autorelease]; + Win32IDataObjectClient *dataClient = [[[Win32IDataObjectClient alloc] + initWithClipboard] autorelease]; return [dataClient dataForType: type]; } else { @@ -83,8 +83,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([self isClient]) { if ([type isEqualToString: NSFilenamesPboardType]) { Win32IDataObjectClient *dataClient = - [[[Win32IDataObjectClient alloc] initWithClipboard] - autorelease]; + [[[Win32IDataObjectClient alloc] initWithClipboard] + autorelease]; return [dataClient filenames]; } else diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDataObjectClient.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDataObjectClient.m index 5209d9fb..5f103c14 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDataObjectClient.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDataObjectClient.m @@ -285,7 +285,7 @@ static WORD PaletteSize(VOID FAR *pv) { // happening somewhere. formatEtc.cfFormat = RegisterClipboardFormat([type cString]); hresult = - _dataObject->lpVtbl->QueryGetData(_dataObject, &formatEtc); + _dataObject->lpVtbl->QueryGetData(_dataObject, &formatEtc); } } @@ -326,8 +326,9 @@ static WORD PaletteSize(VOID FAR *pv) { // the DIB into a CGImage and return a TIFF representation of it CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); CGContextRef ctx = CGBitmapContextCreate( - NULL, w, h, 8, 4 * w, colorspace, - kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); + NULL, w, h, 8, 4 * w, colorspace, + kCGBitmapByteOrder32Little | + kCGImageAlphaPremultipliedFirst); CGColorSpaceRelease(colorspace); // Contexts created on the Win32 platform are supposed to have a // "dc" method @@ -346,7 +347,7 @@ static WORD PaletteSize(VOID FAR *pv) { CGImageRef image = CGBitmapContextCreateImage(ctx); if (image) { imageRep = [[[NSBitmapImageRep alloc] - initWithCGImage: image] autorelease]; + initWithCGImage: image] autorelease]; CGImageRelease(image); } } @@ -381,19 +382,19 @@ static WORD PaletteSize(VOID FAR *pv) { if (bytes[0] == 0xFE && bytes[1] == 0xFF) { copyData = NO; bytes = (uint8_t *) NSUnicodeFromBytesUTF16BigEndian( - bytes + 2, byteLength - 2, &byteLength); + bytes + 2, byteLength - 2, &byteLength); byteLength *= 2; } else if (bytes[0] == 0xFF && bytes[1] == 0xFE) { copyData = NO; bytes = (uint8_t *) NSUnicodeFromBytesUTF16LittleEndian( - bytes + 2, byteLength - 2, &byteLength); + bytes + 2, byteLength - 2, &byteLength); byteLength *= 2; } } if (copyData) { copyData = NO; bytes = (uint8_t *) NSUnicodeFromBytesUTF16BigEndian( - bytes, byteLength, &byteLength); + bytes, byteLength, &byteLength); byteLength *= 2; } } @@ -413,8 +414,8 @@ static WORD PaletteSize(VOID FAR *pv) { case TYMED_ISTREAM: { // pstm Win32IStreamClient *stream = - [[Win32IStreamClient alloc] initWithIStream: storageMedium.pstm - release: NO]; + [[Win32IStreamClient alloc] initWithIStream: storageMedium.pstm + release: NO]; result = [stream readDataToEndOfFile]; diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDataObjectServer.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDataObjectServer.m index b0c06a44..365fe8f9 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDataObjectServer.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDataObjectServer.m @@ -106,7 +106,7 @@ static void flipRowsAndSwapColors(long width, long height, long bytesPerRow, [result addObject: [Win32FORMATETC formatEtcWithFORMATETC: format]]; } else if ([type isEqualToString: NSPDFPboardType]) { format.cfFormat = - RegisterClipboardFormat("Portable Document Format"); + RegisterClipboardFormat("Portable Document Format"); [result addObject: [Win32FORMATETC formatEtcWithFORMATETC: format]]; } else if ([type isEqualToString: NSFilenamesPboardType]) { format.cfFormat = CF_HDROP; @@ -161,7 +161,7 @@ static void flipRowsAndSwapColors(long width, long height, long bytesPerRow, char *buffer; storageMediump->hGlobal = GlobalAlloc( - GMEM_FIXED, ([string cStringLength] + 1) * sizeof(char)); + GMEM_FIXED, ([string cStringLength] + 1) * sizeof(char)); buffer = GlobalLock(storageMediump->hGlobal); [string getCString: buffer]; @@ -171,8 +171,8 @@ static void flipRowsAndSwapColors(long width, long height, long bytesPerRow, NSString *string = [_pasteboard stringForType: NSStringPboardType]; unichar *buffer; - storageMediump->hGlobal = - GlobalAlloc(GMEM_FIXED, ([string length] + 1) * sizeof(unichar)); + storageMediump->hGlobal = GlobalAlloc( + GMEM_FIXED, ([string length] + 1) * sizeof(unichar)); buffer = GlobalLock(storageMediump->hGlobal); [string getCharacters: buffer]; @@ -181,7 +181,7 @@ static void flipRowsAndSwapColors(long width, long height, long bytesPerRow, GlobalUnlock(storageMediump->hGlobal); } else if (format->cfFormat == CF_HDROP) { NSArray *files = - [_pasteboard propertyListForType: NSFilenamesPboardType]; + [_pasteboard propertyListForType: NSFilenamesPboardType]; int filesSize = sizeof(DROPFILES), i, count = [files count]; DROPFILES *dropFiles; unichar *buffer; @@ -256,8 +256,8 @@ static void flipRowsAndSwapColors(long width, long height, long bytesPerRow, uint8_t *buf; HBITMAP bitmap = CreateDIBSection( - NULL, (BITMAPINFO *) &bi, DIB_RGB_COLORS, - (void **) &buf, NULL, 0); + NULL, (BITMAPINFO *) &bi, DIB_RGB_COLORS, + (void **) &buf, NULL, 0); // Flip the image - in a perfect world, we could just // set the bV5Height to a negative value, but it seems a @@ -268,8 +268,8 @@ static void flipRowsAndSwapColors(long width, long height, long bytesPerRow, bits, buf); storageMediump->tymed = TYMED_GDI; - storageMediump->hBitmap = - (HBITMAP) OleDuplicateData(bitmap, CF_BITMAP, 0); + storageMediump->hBitmap = (HBITMAP) OleDuplicateData( + bitmap, CF_BITMAP, 0); ; DeleteObject(bitmap); } else { @@ -316,7 +316,7 @@ static void flipRowsAndSwapColors(long width, long height, long bytesPerRow, void *buffer; storageMediump->hGlobal = - GlobalAlloc(GMEM_MOVEABLE, [data length]); + GlobalAlloc(GMEM_MOVEABLE, [data length]); buffer = GlobalLock(storageMediump->hGlobal); [data getBytes: buffer]; @@ -358,7 +358,7 @@ static void flipRowsAndSwapColors(long width, long height, long bytesPerRow, dwDirection: (IEnumFORMATETC **) ppenumFormatEtc { Win32IEnumFORMATETCServer *server = - [[Win32IEnumFORMATETCServer alloc] initAsIEnumFORMATETC]; + [[Win32IEnumFORMATETCServer alloc] initAsIEnumFORMATETC]; [server setFormatEtcs: [self formatEtcs]]; diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDropSourceServer.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDropSourceServer.m index 4e699f8d..3e706611 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDropSourceServer.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDropSourceServer.m @@ -48,10 +48,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSView *view = [[[NSDragView alloc] initWithImage: image] autorelease]; _window = [[NSPanel alloc] - initWithContentRect: NSMakeRect(0, 0, size.width, size.height) - styleMask: NSBorderlessWindowMask - backing: NSBackingStoreBuffered - defer: NO]; + initWithContentRect: NSMakeRect(0, 0, size.width, size.height) + styleMask: NSBorderlessWindowMask + backing: NSBackingStoreBuffered + defer: NO]; [_window setHasShadow: NO]; [_window setOpaque: NO]; [_window setBackgroundColor: [NSColor clearColor]]; @@ -96,7 +96,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #endif NSPoint point = [(Win32Window *) [_window platformWindow] - mouseLocationOutsideOfEventStream]; + mouseLocationOutsideOfEventStream]; point.x -= _offset.width; point.y -= _offset.height; @@ -113,7 +113,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (HRESULT) GiveFeedback: (DWORD) dwEffect { NSPoint point = [(Win32Window *) [_window platformWindow] - mouseLocationOutsideOfEventStream]; + mouseLocationOutsideOfEventStream]; point.x -= _offset.width; point.y -= _offset.height; diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDropTargetServer.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDropTargetServer.m index 6a331031..c4d9fe47 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDropTargetServer.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IDropTargetServer.m @@ -61,34 +61,34 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ :(DWORD *) dropEffect { NSPasteboard *pasteboard = [[[Win32DropPasteboard alloc] - initWithIDataObject: dataObject] autorelease]; + initWithIDataObject: dataObject] autorelease]; [_session release]; _session = [[Win32DragSession alloc] initWithWindow: _window pasteboard: pasteboard]; - [_session - setSourceOperationMask: Win32DragOperationFromDropEffect(*dropEffect)]; + [_session setSourceOperationMask: Win32DragOperationFromDropEffect( + *dropEffect)]; [_session setScreenLocation: [_window convertPOINTLToBase: pt]]; [_window dragEnter: _session]; *dropEffect = Win32DropEffectFromDragOperation( - [_session draggingSourceOperationMask]); + [_session draggingSourceOperationMask]); return S_OK; } - (HRESULT) DragOver: (DWORD) grfKeyState: (POINTL) pt:(DWORD *) dropEffect { - [_session - setSourceOperationMask: Win32DragOperationFromDropEffect(*dropEffect)]; + [_session setSourceOperationMask: Win32DragOperationFromDropEffect( + *dropEffect)]; [_session setScreenLocation: [_window convertPOINTLToBase: pt]]; [_window dragOver: _session]; *dropEffect = Win32DropEffectFromDragOperation( - [_session draggingSourceOperationMask]); + [_session draggingSourceOperationMask]); return S_OK; } @@ -103,19 +103,19 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (HRESULT) Drop: (IDataObject *) - dataObject: (DWORD) grfKeyState - :(POINTL) pt - :(DWORD *) dropEffect + dataObject: (DWORD) grfKeyState + :(POINTL) pt + :(DWORD *) dropEffect { - [_session - setSourceOperationMask: Win32DragOperationFromDropEffect(*dropEffect)]; + [_session setSourceOperationMask: Win32DragOperationFromDropEffect( + *dropEffect)]; [_session setScreenLocation: [_window convertPOINTLToBase: pt]]; [_window drop: _session]; *dropEffect = Win32DropEffectFromDragOperation( - [_session draggingSourceOperationMask]); + [_session draggingSourceOperationMask]); [_session release]; _session = nil; diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IEnumFORMATETCServer.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IEnumFORMATETCServer.m index 60541523..e33c9b41 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IEnumFORMATETCServer.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IEnumFORMATETCServer.m @@ -70,7 +70,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (HRESULT) Clone: (IEnumFORMATETC **) ppenum { Win32IEnumFORMATETCServer *server = - [[Win32IEnumFORMATETCServer alloc] initAsIEnumFORMATETC]; + [[Win32IEnumFORMATETCServer alloc] initAsIEnumFORMATETC]; [server setFormatEtcs: _formatEtcs]; [server setIndex: _index]; diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IUnknownServer.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IUnknownServer.m index 15af437c..1c0d2b71 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IUnknownServer.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32IUnknownServer.m @@ -32,8 +32,9 @@ static id COMObjectToSelf(void *This) { return comObject->object; } -static HRESULT STDMETHODCALLTYPE __RPC_FAR QueryInterface( - IUnknown __RPC_FAR *This, REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject) +static HRESULT STDMETHODCALLTYPE __RPC_FAR +QueryInterface(IUnknown __RPC_FAR *This, REFIID riid, + void __RPC_FAR *__RPC_FAR *ppvObject) { return [COMObjectToSelf(This) QueryInterface: riid: ppvObject]; } @@ -77,17 +78,17 @@ Drop(IDropTarget __RPC_FAR *This, IDataObject __RPC_FAR *dataObject, } static IDropTargetVtbl IDropTargetVTable = { - (void *) QueryInterface, - (void *) AddRef, - (void *) Release, - DragEnter, - DragOver, - DragLeave, - Drop, + (void *) QueryInterface, + (void *) AddRef, + (void *) Release, + DragEnter, + DragOver, + DragLeave, + Drop, }; static HRESULT STDMETHODCALLTYPE __RPC_FAR QueryContinueDrag( - IDropSource __RPC_FAR *This, int fEscapePressed, DWORD grfKeyState) + IDropSource __RPC_FAR *This, int fEscapePressed, DWORD grfKeyState) { return [COMObjectToSelf(This) QueryContinueDrag: fEscapePressed: grfKeyState]; @@ -100,8 +101,8 @@ GiveFeedback(IDropSource __RPC_FAR *This, DWORD dwEffect) } static IDropSourceVtbl IDropSourceVTable = { - (void *) QueryInterface, (void *) AddRef, (void *) Release, - (void *) QueryContinueDrag, (void *) GiveFeedback, + (void *) QueryInterface, (void *) AddRef, (void *) Release, + (void *) QueryContinueDrag, (void *) GiveFeedback, }; static HRESULT STDMETHODCALLTYPE __RPC_FAR @@ -125,8 +126,8 @@ QueryGetData(IDataObject __RPC_FAR *This, FORMATETC __RPC_FAR *pformatetc) } static HRESULT STDMETHODCALLTYPE __RPC_FAR GetCanonicalFormatEtc( - IDataObject __RPC_FAR *This, FORMATETC __RPC_FAR *pformatectIn, - FORMATETC __RPC_FAR *pformatetcOut) + IDataObject __RPC_FAR *This, FORMATETC __RPC_FAR *pformatectIn, + FORMATETC __RPC_FAR *pformatetcOut) { return [COMObjectToSelf(This) GetCanonicalFormatEtc: pformatectIn: pformatetcOut]; @@ -146,9 +147,10 @@ EnumFormatEtc(IDataObject __RPC_FAR *This, DWORD dwDirection, return [COMObjectToSelf(This) EnumFormatEtc: dwDirection: ppenumFormatEtc]; } -static HRESULT STDMETHODCALLTYPE __RPC_FAR DAdvise( - IDataObject __RPC_FAR *This, FORMATETC __RPC_FAR *pformatetc, DWORD advf, - IAdviseSink __RPC_FAR *pAdvSink, DWORD __RPC_FAR *pdwConnection) +static HRESULT STDMETHODCALLTYPE __RPC_FAR +DAdvise(IDataObject __RPC_FAR *This, FORMATETC __RPC_FAR *pformatetc, + DWORD advf, IAdviseSink __RPC_FAR *pAdvSink, + DWORD __RPC_FAR *pdwConnection) { return [COMObjectToSelf(This) DAdvise: pformatetc: advf:pAdvSink:pdwConnection]; @@ -197,8 +199,9 @@ HRESULT STDMETHODCALLTYPE __RPC_FAR Reset(IEnumFORMATETC __RPC_FAR *This) { return [COMObjectToSelf(This) Reset]; } -HRESULT STDMETHODCALLTYPE __RPC_FAR Clone( - IEnumFORMATETC __RPC_FAR *This, IEnumFORMATETC __RPC_FAR *__RPC_FAR *ppenum) +HRESULT STDMETHODCALLTYPE __RPC_FAR +Clone(IEnumFORMATETC __RPC_FAR *This, + IEnumFORMATETC __RPC_FAR *__RPC_FAR *ppenum) { return [COMObjectToSelf(This) Clone: ppenum]; } @@ -232,27 +235,27 @@ static IEnumFORMATETCVtbl IEnumFORMATETCVTable = {(void *) QueryInterface, } - initAsIDropTarget { - return [self - initWithVtable: &IDropTargetVTable - interfaceIdentifier: OLESTR("{00000122-0000-0000-C000-000000000046}")]; + return [self initWithVtable: &IDropTargetVTable + interfaceIdentifier: + OLESTR("{00000122-0000-0000-C000-000000000046}")]; } - initAsIDropSource { - return [self - initWithVtable: &IDropSourceVTable - interfaceIdentifier: OLESTR("{00000121-0000-0000-C000-000000000046}")]; + return [self initWithVtable: &IDropSourceVTable + interfaceIdentifier: + OLESTR("{00000121-0000-0000-C000-000000000046}")]; } - initAsIDataObject { - return [self - initWithVtable: &IDataObjectVTable - interfaceIdentifier: OLESTR("{0000010E-0000-0000-C000-000000000046}")]; + return [self initWithVtable: &IDataObjectVTable + interfaceIdentifier: + OLESTR("{0000010E-0000-0000-C000-000000000046}")]; } - initAsIEnumFORMATETC { - return [self - initWithVtable: &IEnumFORMATETCVTable - interfaceIdentifier: OLESTR("{00000103-0000-0000-C000-000000000046}")]; + return [self initWithVtable: &IEnumFORMATETCVTable + interfaceIdentifier: + OLESTR("{00000103-0000-0000-C000-000000000046}")]; } - (void *) iUknown { diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32Pasteboard.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32Pasteboard.m index 1e7b4403..659e15bd 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32Pasteboard.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32Pasteboard.m @@ -68,7 +68,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (int) declareTypes: (NSArray *) types owner: (id) owner { Win32TypesAndOwner *typesAndOwner = - [Win32TypesAndOwner typesAndOwnerWithTypes: types owner: owner]; + [Win32TypesAndOwner typesAndOwnerWithTypes: types owner: owner]; [self incrementChangeCount]; [_typesAndOwners removeAllObjects]; @@ -80,7 +80,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (int) addTypes: (NSArray *) types owner: (id) owner { Win32TypesAndOwner *typesAndOwner = - [Win32TypesAndOwner typesAndOwnerWithTypes: types owner: owner]; + [Win32TypesAndOwner typesAndOwnerWithTypes: types owner: owner]; [self incrementChangeCount]; // Add the new types to the pasteboard and remove existing data for it @@ -95,8 +95,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ int i, count = [_typesAndOwners count]; for (i = 0; i < count; i++) - [result - addObjectsFromArray: [[_typesAndOwners objectAtIndex: i] types]]; + [result addObjectsFromArray: [[_typesAndOwners objectAtIndex: i] + types]]; return result; } diff --git a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32Window-Drag.m b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32Window-Drag.m index bc632fe2..4075c09e 100644 --- a/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32Window-Drag.m +++ b/AppKit/Win32.subproj/Win32DraggingManager.subproj/Win32Window-Drag.m @@ -37,10 +37,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [sessionReceiver isKindOfClass: [NSView class]]) { if ([receiver isDescendantOf: sessionReceiver] && - [session pasteboardTypesIntersectTypes: [sessionReceiver - _draggedTypes]] && - ![sessionReceiver - pasteboardTypesIntersectTypes: [receiver _draggedTypes]]) { + [session pasteboardTypesIntersectTypes: + [sessionReceiver _draggedTypes]] && + ![sessionReceiver pasteboardTypesIntersectTypes: + [receiver _draggedTypes]]) { receiver = [session receiver]; } diff --git a/AppKit/Win32.subproj/Win32EventInputSource.m b/AppKit/Win32.subproj/Win32EventInputSource.m index bd4aa985..85db535e 100644 --- a/AppKit/Win32.subproj/Win32EventInputSource.m +++ b/AppKit/Win32.subproj/Win32EventInputSource.m @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ */ - (BOOL) processInputImmediately { BOOL hadPeriodic = - [[Win32Display currentDisplay] containsAndRemovePeriodicEvents]; + [[Win32Display currentDisplay] containsAndRemovePeriodicEvents]; MSG msg; if (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) { @@ -44,11 +44,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ keyboardState = keyState; if (![(Win32Display *) [Win32Display currentDisplay] - postMSG: msg - keyboardState: keyboardState]) { + postMSG: msg + keyboardState: keyboardState]) { Win32Event *cgEvent = [Win32Event eventWithMSG: msg]; NSEvent *event = [[[NSEvent_CoreGraphics alloc] - initWithDisplayEvent: cgEvent] autorelease]; + initWithDisplayEvent: cgEvent] autorelease]; [[Win32Display currentDisplay] postEvent: event atStart: NO]; } @@ -59,10 +59,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (hadPeriodic) { NSEvent *event = - [[[NSEvent_periodic alloc] initWithType: NSPeriodic - location: NSMakePoint(0, 0) - modifierFlags: 0 - window: nil] autorelease]; + [[[NSEvent_periodic alloc] initWithType: NSPeriodic + location: NSMakePoint(0, 0) + modifierFlags: 0 + window: nil] autorelease]; [[Win32Display currentDisplay] postEvent: event atStart: NO]; } diff --git a/AppKit/Win32.subproj/Win32RunningCopyPipe.m b/AppKit/Win32.subproj/Win32RunningCopyPipe.m index 68efcb5d..1a15672b 100644 --- a/AppKit/Win32.subproj/Win32RunningCopyPipe.m +++ b/AppKit/Win32.subproj/Win32RunningCopyPipe.m @@ -84,7 +84,7 @@ static Win32RunningCopyPipe *_runningCopyPipe = nil; _event = CreateEvent(NULL, FALSE, FALSE, NULL); _eventMonitor = - [[NSHandleMonitor_win32 handleMonitorWithHandle: _event] retain]; + [[NSHandleMonitor_win32 handleMonitorWithHandle: _event] retain]; [_eventMonitor setDelegate: self]; [_eventMonitor setCurrentActivity: Win32HandleSignaled]; [[NSRunLoop currentRunLoop] addInputSource: _eventMonitor @@ -108,24 +108,24 @@ static Win32RunningCopyPipe *_runningCopyPipe = nil; } + (NSString *) pipeName { - return - [NSString stringWithFormat: @"\\\\.\\pipe\\%@~V1~", - [[NSProcessInfo processInfo] processName]]; + return [NSString + stringWithFormat: @"\\\\.\\pipe\\%@~V1~", + [[NSProcessInfo processInfo] processName]]; } + (BOOL) createRunningCopyPipe { if (_runningCopyPipe == nil) { HANDLE pipe = CreateNamedPipe( - [[self pipeName] cString], - PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, - PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, 1, 8192, - 8192, 0, NULL); + [[self pipeName] cString], + PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, + PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, 1, 8192, + 8192, 0, NULL); if (pipe == INVALID_HANDLE_VALUE) return NO; _runningCopyPipe = - [[Win32RunningCopyPipe alloc] initWithPipeHandle: pipe]; + [[Win32RunningCopyPipe alloc] initWithPipeHandle: pipe]; return YES; } @@ -137,15 +137,15 @@ static Win32RunningCopyPipe *_runningCopyPipe = nil; NSArray *paths; if ([[NSUserDefaults standardUserDefaults] - stringForKey: @"NSUseRunningCopy"] != nil && + stringForKey: @"NSUseRunningCopy"] != nil && ![[NSUserDefaults standardUserDefaults] - boolForKey: @"NSUseRunningCopy"]) { + boolForKey: @"NSUseRunningCopy"]) { return; } id nsOpen = - [[NSUserDefaults standardUserDefaults] objectForKey: @"NSOpen"]; + [[NSUserDefaults standardUserDefaults] objectForKey: @"NSOpen"]; if ([nsOpen isKindOfClass: [NSString class]] && [nsOpen length]) { paths = [NSArray arrayWithObject: nsOpen]; @@ -156,8 +156,8 @@ static Win32RunningCopyPipe *_runningCopyPipe = nil; } HANDLE pipe = - CreateFile([[self pipeName] cString], GENERIC_WRITE, - FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); + CreateFile([[self pipeName] cString], GENERIC_WRITE, + FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (pipe == INVALID_HANDLE_VALUE) { return; diff --git a/AppKit/Win32.subproj/Win32Window.h b/AppKit/Win32.subproj/Win32Window.h index 9c865d1b..3310028e 100644 --- a/AppKit/Win32.subproj/Win32Window.h +++ b/AppKit/Win32.subproj/Win32Window.h @@ -77,9 +77,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithFrame: (CGRect) frame - styleMask: (unsigned) styleMask - isPanel: (BOOL) isPanel - backingType: (CGSBackingStoreType) backingType; + styleMask: (unsigned) styleMask + isPanel: (BOOL) isPanel + backingType: (CGSBackingStoreType) backingType; - (void) setDelegate: delegate; - delegate; diff --git a/AppKit/Win32.subproj/Win32Window.m b/AppKit/Win32.subproj/Win32Window.m index a0cfa610..f596a4d4 100644 --- a/AppKit/Win32.subproj/Win32Window.m +++ b/AppKit/Win32.subproj/Win32Window.m @@ -50,14 +50,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static CGRect convertFrameToWin32ScreenCoordinates(CGRect rect) { rect.origin.y = - GetSystemMetrics(SM_CYSCREEN) - (rect.origin.y + rect.size.height); + GetSystemMetrics(SM_CYSCREEN) - (rect.origin.y + rect.size.height); return rect; } static CGRect convertFrameFromWin32ScreenCoordinates(CGRect rect) { rect.origin.y = - GetSystemMetrics(SM_CYSCREEN) - (rect.origin.y + rect.size.height); + GetSystemMetrics(SM_CYSCREEN) - (rect.origin.y + rect.size.height); return rect; } @@ -100,7 +100,7 @@ static DWORD Win32ExtendedStyleForStyleMask(unsigned styleMask, BOOL isPanel, if (styleMask & NSUtilityWindowMask) { result |= - WS_EX_TOPMOST; // Make it floating as a utility window should be + WS_EX_TOPMOST; // Make it floating as a utility window should be } return result /*|0x80000*/; @@ -135,8 +135,8 @@ static DWORD Win32StyleForStyleMask(unsigned styleMask, BOOL isPanel, result |= WS_THICKFRAME; if (isPanel) { - result |= - WS_CAPTION; // without CAPTION it puts space for a menu (???) + result |= WS_CAPTION; // without CAPTION it puts space for a menu + // (???) } result |= WS_SYSMENU; // Is there a way to get a closebutton without @@ -150,9 +150,9 @@ static DWORD Win32StyleForStyleMask(unsigned styleMask, BOOL isPanel, SetWindowLong(_handle, GWL_EXSTYLE, Win32ExtendedStyleForStyleMask(_styleMask, _isPanel, [self isLayeredWindow])); - SetWindowLong( - _handle, GWL_STYLE, - Win32StyleForStyleMask(_styleMask, _isPanel, [self isLayeredWindow])); + SetWindowLong(_handle, GWL_STYLE, + Win32StyleForStyleMask(_styleMask, _isPanel, + [self isLayeredWindow])); } void CGNativeBorderFrameWidthsForStyle(unsigned styleMask, CGFloat *top, @@ -213,12 +213,12 @@ static const unichar *Win32ClassNameForStyleMask(unsigned styleMask, - (void) createWindowHandle { CGRect win32Frame = convertFrameToWin32ScreenCoordinates(_frame); - DWORD style = - Win32StyleForStyleMask(_styleMask, _isPanel, [self isLayeredWindow]); + DWORD style = Win32StyleForStyleMask(_styleMask, _isPanel, + [self isLayeredWindow]); DWORD extendStyle = Win32ExtendedStyleForStyleMask(_styleMask, _isPanel, [self isLayeredWindow]); const unichar *className = - Win32ClassNameForStyleMask(_styleMask, _hasShadow); + Win32ClassNameForStyleMask(_styleMask, _hasShadow); _handle = CreateWindowExW(extendStyle, className, L"", style, win32Frame.origin.x, win32Frame.origin.y, @@ -228,7 +228,7 @@ static const unichar *Win32ClassNameForStyleMask(unsigned styleMask, if (_title != nil) SetWindowTextW(_handle, (const unichar *) [_title - cStringUsingEncoding: NSUnicodeStringEncoding]); + cStringUsingEncoding: NSUnicodeStringEncoding]); SetProp(_handle, "Win32Window", self); @@ -238,8 +238,8 @@ static const unichar *Win32ClassNameForStyleMask(unsigned styleMask, if ((systemMenu = GetSystemMenu(_handle, FALSE)) != NULL) { UINT dwExtra = (_styleMask & NSClosableWindowMask) - ? MF_ENABLED - : (MF_DISABLED | MF_GRAYED); + ? MF_ENABLED + : (MF_DISABLED | MF_GRAYED); EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND | dwExtra); } @@ -255,9 +255,9 @@ static const unichar *Win32ClassNameForStyleMask(unsigned styleMask, } - initWithFrame: (CGRect) frame - styleMask: (unsigned) styleMask - isPanel: (BOOL) isPanel - backingType: (CGSBackingStoreType) backingType + styleMask: (unsigned) styleMask + isPanel: (BOOL) isPanel + backingType: (CGSBackingStoreType) backingType { InitializeCriticalSection(&_lock); _frame = frame; @@ -269,8 +269,8 @@ static const unichar *Win32ClassNameForStyleMask(unsigned styleMask, _styleMask = styleMask; _isPanel = isPanel; - _ignoreMinMaxMessage = - YES; // creating a window can cause bogus GETMINMAX messages to be sent + _ignoreMinMaxMessage = YES; // creating a window can cause bogus GETMINMAX + // messages to be sent [self createWindowHandle]; @@ -279,7 +279,7 @@ static const unichar *Win32ClassNameForStyleMask(unsigned styleMask, _backingType = backingType; if ([[NSUserDefaults standardUserDefaults] - boolForKey: @"NSAllWindowsRetained"]) + boolForKey: @"NSAllWindowsRetained"]) _backingType = CGSBackingStoreRetained; _backingContext = nil; @@ -292,7 +292,7 @@ static const unichar *Win32ClassNameForStyleMask(unsigned styleMask, _deviceDictionary = [NSMutableDictionary new]; NSString *check = [[NSUserDefaults standardUserDefaults] - stringForKey: @"CGBackingRasterizer"]; + stringForKey: @"CGBackingRasterizer"]; if ([check isEqual: @"Onyx"] || [check isEqual: @"GDI"]) [_deviceDictionary setObject: check forKey: @"CGContext"]; @@ -349,8 +349,8 @@ static const unichar *Win32ClassNameForStyleMask(unsigned styleMask, - (O2Context *) createCGContextIfNeeded { if (_cgContext == nil) _cgContext = - (O2Context_gdi *) [O2Context createContextWithSize: _frame.size - window: self]; + (O2Context_gdi *) [O2Context createContextWithSize: _frame.size + window: self]; return _cgContext; } @@ -358,9 +358,9 @@ static const unichar *Win32ClassNameForStyleMask(unsigned styleMask, - (O2Context *) createBackingCGContextIfNeeded { if (_backingContext == nil) { _backingContext = [O2Context - createBackingContextWithSize: _frame.size - context: [self createCGContextIfNeeded] - deviceDictionary: _deviceDictionary]; + createBackingContextWithSize: _frame.size + context: [self createCGContextIfNeeded] + deviceDictionary: _deviceDictionary]; CGNativeBorderFrameWidthsForStyle([self styleMask], &_borderTop, &_borderLeft, &_borderBottom, &_borderRight); @@ -423,8 +423,9 @@ static const unichar *Win32ClassNameForStyleMask(unsigned styleMask, title = [title copy]; [_title release]; _title = title; - SetWindowTextW(_handle, (const unichar *) [_title - cStringUsingEncoding: NSUnicodeStringEncoding]); + SetWindowTextW(_handle, + (const unichar *) [_title + cStringUsingEncoding: NSUnicodeStringEncoding]); } - (void) setFrame: (CGRect) frame { @@ -617,7 +618,7 @@ CGL_EXPORT CGLError CGLCopyPixels(CGLContextObj source, - (O2Surface_DIBSection *) resultSurface { O2Surface_DIBSection *backingSurface = - (O2Surface_DIBSection *) [_backingContext surface]; + (O2Surface_DIBSection *) [_backingContext surface]; if (_surfaceCount == 0) return backingSurface; @@ -630,9 +631,9 @@ CGL_EXPORT CGLError CGLCopyPixels(CGLContextObj source, O2ImageGetHeight(_overlayResult) != resultHeight) { [_overlayResult release]; _overlayResult = - [[O2Surface_DIBSection alloc] initWithWidth: resultWidth - height: resultHeight - compatibleWithDeviceContext: nil]; + [[O2Surface_DIBSection alloc] initWithWidth: resultWidth + height: resultHeight + compatibleWithDeviceContext: nil]; } BLENDFUNCTION blend; @@ -663,7 +664,7 @@ CGL_EXPORT CGLError CGLCopyPixels(CGLContextObj source, CGLGetParameter(_surfaces[i], kCGLCPSurfaceOpacity, &sourceOpacity); O2Surface_DIBSection *srcSurface = - (O2Surface_DIBSection *) [overlay validSurface]; + (O2Surface_DIBSection *) [overlay validSurface]; if (srcSurface == nil) return kCGLNoError; @@ -695,7 +696,7 @@ CGL_EXPORT CGLError CGLCopyPixels(CGLContextObj source, CGLPixelFormatAttribute attributes[] = { - 0}; + 0}; CGLChoosePixelFormat(attributes, &pf, &novs); @@ -896,41 +897,46 @@ static int reportGLErrorIfNeeded(const char *function, int line) { - (void) checkExtensionsInString: (const char *) extensions { _hasRenderTexture = - (extensions == NULL) - ? NO - : ((strstr(extensions, "WGL_ARB_render_texture") == NULL) ? NO - : YES); + (extensions == NULL) + ? NO + : ((strstr(extensions, "WGL_ARB_render_texture") == NULL) + ? NO + : YES); if (!_hasRenderTexture) _hasRenderTexture = - (extensions == NULL) - ? NO - : ((strstr(extensions, "WGL_EXT_render_texture") == NULL) - ? NO - : YES); + (extensions == NULL) + ? NO + : ((strstr(extensions, "WGL_EXT_render_texture") == + NULL) + ? NO + : YES); _hasMakeCurrentRead = - (extensions == NULL) - ? NO - : ((strstr(extensions, "WGL_ARB_make_current_read") == NULL) ? NO - : YES); + (extensions == NULL) + ? NO + : ((strstr(extensions, "WGL_ARB_make_current_read") == NULL) + ? NO + : YES); if (!_hasMakeCurrentRead) _hasMakeCurrentRead = - (extensions == NULL) - ? NO - : ((strstr(extensions, "WGL_EXT_make_current_read") == NULL) - ? NO - : YES); + (extensions == NULL) + ? NO + : ((strstr(extensions, "WGL_EXT_make_current_read") == + NULL) + ? NO + : YES); _hasSwapHintRect = - (extensions == NULL) - ? NO - : ((strstr(extensions, "GL_WIN_swap_hint") == NULL) ? NO : YES); + (extensions == NULL) + ? NO + : ((strstr(extensions, "GL_WIN_swap_hint") == NULL) ? NO + : YES); } - (void) openGLFlushBufferOnlyContext: (CGLContextObj) onlyContext { CGLError error; O2Surface_DIBSection *surface = - (O2Surface_DIBSection *) [_backingContext surface]; + (O2Surface_DIBSection *) [_backingContext surface]; if (surface == nil) { NSLog(@"no surface on %@", _backingContext); @@ -1010,7 +1016,7 @@ static int reportGLErrorIfNeeded(const char *function, int line) { if (_textureIdCount < _surfaceCount) { _textureIds = - NSZoneRealloc(NULL, _textureIds, sizeof(GLint) * _surfaceCount); + NSZoneRealloc(NULL, _textureIds, sizeof(GLint) * _surfaceCount); glGenTextures((_surfaceCount - _textureIdCount), _textureIds + _textureIdCount); @@ -1244,11 +1250,11 @@ static int reportGLErrorIfNeeded(const char *function, int line) { - (void) dirtyRect: (CGRect) rect { if (_dirtyRectCap == _dirtyRectCnt) { void *tmp = (_dirtyRectCnt == 0) - ? malloc((_dirtyRectCap = DIRTY_RECT_BLOCK_COUNT) * - sizeof(CGRect)) - : realloc(_dirtyRectSet, - (_dirtyRectCap += DIRTY_RECT_BLOCK_COUNT) * - sizeof(CGRect)); + ? malloc((_dirtyRectCap = DIRTY_RECT_BLOCK_COUNT) * + sizeof(CGRect)) + : realloc(_dirtyRectSet, (_dirtyRectCap += + DIRTY_RECT_BLOCK_COUNT) * + sizeof(CGRect)); if (tmp) _dirtyRectSet = tmp; @@ -1314,7 +1320,7 @@ static int reportGLErrorIfNeeded(const char *function, int line) { #if BENCHBLIT NSTimeInterval currentTime = - [NSDate timeIntervalSinceReferenceDate]; + [NSDate timeIntervalSinceReferenceDate]; if (currentTime - lastTime > 2.) { NSLog(@"%f fps", (double) cptr / (currentTime - lastTime)); cptr = 0; @@ -1666,9 +1672,9 @@ static int reportGLErrorIfNeeded(const char *function, int line) { #if WM_SIZING_DEBUGGING NSString *wmParamValues[] = { - @"None", @"WMSZ_LEFT", @"WMSZ_RIGHT", - @"WMSZ_TOP", @"WMSZ_TOPLEFT", @"WMSZ_TOPRIGHT", - @"WMSZ_BOTTOM", @"WMSZ_BOTTOMLEFT", @"WMSZ_BOTTOMRIGHT"}; + @"None", @"WMSZ_LEFT", @"WMSZ_RIGHT", + @"WMSZ_TOP", @"WMSZ_TOPLEFT", @"WMSZ_TOPRIGHT", + @"WMSZ_BOTTOM", @"WMSZ_BOTTOMLEFT", @"WMSZ_BOTTOMRIGHT"}; if (wParam > 0 && wParam <= WMSZ_BOTTOMRIGHT) { NSLog(@" wParam: %@", wmParamValues[wParam]); @@ -1912,10 +1918,11 @@ const int kWindowMaxDim = 10000; case WM_COMMAND: [[NSNotificationCenter defaultCenter] - postNotificationName: @"WIN32_WM_COMMAND" - object: [NSValue - valueWithPoint: CGPointMake(lParam, - wParam)]]; + postNotificationName: @"WIN32_WM_COMMAND" + object: [NSValue + valueWithPoint: CGPointMake( + lParam, + wParam)]]; return 1; break; @@ -1982,17 +1989,17 @@ static void initializeWindowClass(WNDCLASSW *class) { + (void) initialize { if (self == [Win32Window class]) { NSString *name = [[NSBundle mainBundle] - objectForInfoDictionaryKey: @"CFBundleIconFile"]; + objectForInfoDictionaryKey: @"CFBundleIconFile"]; NSString *path = [[NSBundle mainBundle] pathForResource: name ofType: @"ico"]; - HICON icon = - (path == nil) - ? NULL - : LoadImage(NULL, [path fileSystemRepresentation], IMAGE_ICON, - 16, 16, LR_DEFAULTCOLOR | LR_LOADFROMFILE); + HICON icon = (path == nil) + ? NULL + : LoadImage(NULL, [path fileSystemRepresentation], + IMAGE_ICON, 16, 16, + LR_DEFAULTCOLOR | LR_LOADFROMFILE); static WNDCLASSW _standardWindowClass, _borderlessWindowClass, - _borderlessWindowClassWithShadow; + _borderlessWindowClassWithShadow; if (icon == NULL) icon = LoadImage(NULL, IDI_APPLICATION, IMAGE_ICON, 0, 0, @@ -2008,7 +2015,7 @@ static void initializeWindowClass(WNDCLASSW *class) { _borderlessWindowClass.lpszClassName = L"Win32BorderlessWindow"; _borderlessWindowClassWithShadow.lpszClassName = - L"Win32BorderlessWindowWithShadow"; + L"Win32BorderlessWindowWithShadow"; if (NSPlatformGreaterThanOrEqualToWindowsXP()) _borderlessWindowClassWithShadow.style |= CS_DROPSHADOW; diff --git a/AppKit/Win32.subproj/Win32Workspace.m b/AppKit/Win32.subproj/Win32Workspace.m index 3e2aac8c..1c300828 100644 --- a/AppKit/Win32.subproj/Win32Workspace.m +++ b/AppKit/Win32.subproj/Win32Workspace.m @@ -32,7 +32,7 @@ static NSString *DriveLetterInPath(NSString *path) { NSArray *components = [path componentsSeparatedByString: @":"]; if ([components count] > 0) { NSString *driveLetter = [NSString - stringWithFormat: @"%@:\\", [components objectAtIndex: 0]]; + stringWithFormat: @"%@:\\", [components objectAtIndex: 0]]; return driveLetter; } return nil; @@ -72,7 +72,8 @@ static NSString *DriveLetterInPath(NSString *path) { *isRemovable = NO; *isUnmountable = NO; *type = NSLocalizedStringFromTableInBundle( - @"WinFS", nil, [NSBundle bundleForClass: [Win32Workspace class]], @""); + @"WinFS", nil, [NSBundle bundleForClass: [Win32Workspace class]], + @""); NSString *driveLetter = DriveLetterInPath(path); @@ -80,49 +81,49 @@ static NSString *DriveLetterInPath(NSString *path) { switch (driveType) { case DRIVE_UNKNOWN: *description = NSLocalizedStringFromTableInBundle( - @"Unrecognized drive", nil, - [NSBundle bundleForClass: [Win32Workspace class]], - @"Error description for a disk drive"); + @"Unrecognized drive", nil, + [NSBundle bundleForClass: [Win32Workspace class]], + @"Error description for a disk drive"); break; case DRIVE_NO_ROOT_DIR: *description = NSLocalizedStringFromTableInBundle( - @"Corrupted drive", nil, - [NSBundle bundleForClass: [Win32Workspace class]], - @"Error description for a disk drive"); + @"Corrupted drive", nil, + [NSBundle bundleForClass: [Win32Workspace class]], + @"Error description for a disk drive"); break; case DRIVE_REMOVABLE: *description = NSLocalizedStringFromTableInBundle( - @"Removable drive", nil, - [NSBundle bundleForClass: [Win32Workspace class]], - @"Describes a removable disk drive"); + @"Removable drive", nil, + [NSBundle bundleForClass: [Win32Workspace class]], + @"Describes a removable disk drive"); *isRemovable = YES; break; case DRIVE_FIXED: *description = NSLocalizedStringFromTableInBundle( - @"Fixed drive", nil, - [NSBundle bundleForClass: [Win32Workspace class]], - @"Describes a standard hard disk drive"); + @"Fixed drive", nil, + [NSBundle bundleForClass: [Win32Workspace class]], + @"Describes a standard hard disk drive"); break; case DRIVE_REMOTE: *description = NSLocalizedStringFromTableInBundle( - @"Network drive", nil, - [NSBundle bundleForClass: [Win32Workspace class]], - @"Describes a disk drive accessable over a network"); + @"Network drive", nil, + [NSBundle bundleForClass: [Win32Workspace class]], + @"Describes a disk drive accessable over a network"); *isUnmountable = YES; break; case DRIVE_CDROM: *description = NSLocalizedStringFromTableInBundle( - @"CD-ROM drive", nil, - [NSBundle bundleForClass: [Win32Workspace class]], - @"Describes a CD-ROM drive"); + @"CD-ROM drive", nil, + [NSBundle bundleForClass: [Win32Workspace class]], + @"Describes a CD-ROM drive"); *isUnmountable = YES; *isRemovable = YES; break; case DRIVE_RAMDISK: *description = NSLocalizedStringFromTableInBundle( - @"RAM drive", nil, - [NSBundle bundleForClass: [Win32Workspace class]], - @"Describes a RAM drive"); + @"RAM drive", nil, + [NSBundle bundleForClass: [Win32Workspace class]], + @"Describes a RAM drive"); *isUnmountable = YES; break; } @@ -131,12 +132,12 @@ static NSString *DriveLetterInPath(NSString *path) { - (BOOL) openURL: (NSURL *) url { return ((int) ShellExecuteW( - GetDesktopWindow(), L"open", - (const unichar *) [[url absoluteString] - cStringUsingEncoding: NSUnicodeStringEncoding], - NULL, NULL, SW_SHOWNORMAL) <= 32) - ? NO - : YES; + GetDesktopWindow(), L"open", + (const unichar *) [[url absoluteString] + cStringUsingEncoding: NSUnicodeStringEncoding], + NULL, NULL, SW_SHOWNORMAL) <= 32) + ? NO + : YES; } - (BOOL) openFile: (NSString *) path { @@ -144,7 +145,7 @@ static NSString *DriveLetterInPath(NSString *path) { if ([extension isEqualToString: @"app"]) { NSString *name = - [[path lastPathComponent] stringByDeletingPathExtension]; + [[path lastPathComponent] stringByDeletingPathExtension]; path = [path stringByAppendingPathComponent: @"Contents"]; path = [path stringByAppendingPathComponent: @"Windows"]; @@ -155,8 +156,8 @@ static NSString *DriveLetterInPath(NSString *path) { return ((int) ShellExecuteW(GetDesktopWindow(), L"open", [path fileSystemRepresentationW], NULL, NULL, SW_SHOWNORMAL) <= 32) - ? NO - : YES; + ? NO + : YES; } static BOOL openFileWithHelpViewer(const char *helpFilePath) { @@ -173,12 +174,12 @@ static BOOL openFileWithHelpViewer(const char *helpFilePath) { NSBundle *bundle = [NSBundle bundleForClass: [self class]]; NSString *bundlePath = [bundle bundlePath]; NSString *app = [[[[[[[bundlePath stringByDeletingLastPathComponent] - stringByDeletingLastPathComponent] - stringByAppendingPathComponent: @"Applications"] - stringByAppendingPathComponent: appName] - stringByAppendingPathExtension: @"app"] - stringByAppendingPathComponent: appName] - stringByAppendingPathExtension: @"exe"]; + stringByDeletingLastPathComponent] + stringByAppendingPathComponent: @"Applications"] + stringByAppendingPathComponent: appName] + stringByAppendingPathExtension: @"app"] + stringByAppendingPathComponent: appName] + stringByAppendingPathExtension: @"exe"]; NSMutableData *args = [NSMutableData data]; [args appendData: NSTaskArgumentDataFromStringW(@"-NSOpen")]; @@ -189,15 +190,15 @@ static BOOL openFileWithHelpViewer(const char *helpFilePath) { return ((int) ShellExecuteW(GetDesktopWindow(), L"open", [app fileSystemRepresentationW], [args bytes], NULL, SW_SHOWNORMAL) <= 32) - ? NO - : YES; + ? NO + : YES; } #else return ((int) ShellExecuteW(GetDesktopWindow(), L"open", [path fileSystemRepresentationW], NULL, NULL, SW_SHOWNORMAL) <= 32) - ? NO - : YES; + ? NO + : YES; #endif } @@ -205,19 +206,19 @@ static BOOL openFileWithHelpViewer(const char *helpFilePath) { return ((int) ShellExecuteW(GetDesktopWindow(), L"open", [path fileSystemRepresentationW], NULL, NULL, SW_SHOWNORMAL) <= 32) - ? NO - : YES; + ? NO + : YES; } - (BOOL) selectFile: (NSString *) path - inFileViewerRootedAtPath: (NSString *) rootFullpath + inFileViewerRootedAtPath: (NSString *) rootFullpath { BOOL isDir = NO; if ([[NSFileManager defaultManager] fileExistsAtPath: path isDirectory: &isDir]) { - NSString *win32Path = - NSStringFromNullTerminatedUnicode([path fileSystemRepresentationW]); + NSString *win32Path = NSStringFromNullTerminatedUnicode( + [path fileSystemRepresentationW]); NSMutableData *args = [NSMutableData data]; [args appendBytes: L"/select," length: 16]; @@ -226,8 +227,8 @@ static BOOL openFileWithHelpViewer(const char *helpFilePath) { return ((int) ShellExecuteW(GetDesktopWindow(), L"open", L"explorer", [args bytes], NULL, SW_SHOWNORMAL) <= 32) - ? NO - : YES; + ? NO + : YES; } return NO; } @@ -260,8 +261,9 @@ static NSImageRep *imageRepForIcon(HICON icon) { if (w > 0 && h > 0) { CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); CGContextRef ctx = CGBitmapContextCreate( - NULL, w, h, 8, 4 * w, colorspace, - kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); + NULL, w, h, 8, 4 * w, colorspace, + kCGBitmapByteOrder32Little | + kCGImageAlphaPremultipliedFirst); CGColorSpaceRelease(colorspace); // Contexts created on the Win32 platform are supposed to have an // "dc" method @@ -271,7 +273,7 @@ static NSImageRep *imageRepForIcon(HICON icon) { CGImageRef image = CGBitmapContextCreateImage(ctx); if (image) { imageRep = [[[NSBitmapImageRep alloc] - initWithCGImage: image] autorelease]; + initWithCGImage: image] autorelease]; CGImageRelease(image); } } @@ -291,8 +293,9 @@ static NSImageRep *imageRepForImageListAndIndex(HIMAGELIST imageListH, if (ImageList_GetIconSize(imageListH, &w, &h)) { CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); CGContextRef ctx = CGBitmapContextCreate( - NULL, w, h, 8, 4 * w, colorspace, - kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); + NULL, w, h, 8, 4 * w, colorspace, + kCGBitmapByteOrder32Little | + kCGImageAlphaPremultipliedFirst); CGColorSpaceRelease(colorspace); // Contexts created on the Win32 platform are supposed to have an // "dc" method @@ -302,7 +305,7 @@ static NSImageRep *imageRepForImageListAndIndex(HIMAGELIST imageListH, CGImageRef image = CGBitmapContextCreateImage(ctx); if (image) { imageRep = [[[NSBitmapImageRep alloc] - initWithCGImage: image] autorelease]; + initWithCGImage: image] autorelease]; CGImageRelease(image); } } @@ -326,7 +329,7 @@ static NSImageRep *imageRepForImageListAndIndex(HIMAGELIST imageListH, if (FileIconInitPtr == NULL) { HANDLE library = LoadLibrary("SHELL32"); FileIconInitPtr = (void *) GetProcAddress( - library, (char *) 660); // 660 is the magic number for it + library, (char *) 660); // 660 is the magic number for it if (FileIconInitPtr) { // Call the init function the first time we get called - MS says it // should be done before using SHGetImageList @@ -334,10 +337,10 @@ static NSImageRep *imageRepForImageListAndIndex(HIMAGELIST imageListH, } if (SHGetImageListPtr == NULL) { SHGetImageListPtr = - (void *) GetProcAddress(library, "SHGetImageList"); + (void *) GetProcAddress(library, "SHGetImageList"); if (SHGetImageListPtr == NULL) { SHGetImageListPtr = - (void *) GetProcAddress(library, (char *) 727); + (void *) GetProcAddress(library, (char *) 727); } } } @@ -372,15 +375,15 @@ static NSImageRep *imageRepForImageListAndIndex(HIMAGELIST imageListH, int imageIndex = fileInfo.iIcon; static const IID IID_IImageList = { - 0x46EB5926L, - 0x582E, - 0x4017, - {0x9F, 0xDF, 0xE8, 0x99, 0x8D, 0xAA, 0x09, 0x50}}; + 0x46EB5926L, + 0x582E, + 0x4017, + {0x9F, 0xDF, 0xE8, 0x99, 0x8D, 0xAA, 0x09, 0x50}}; if (isRunningVistaOrBetter) { if (SHGetImageListPtr(SHIL_JUMBO, &IID_IImageList, &imageList) == S_OK) { NSImageRep *rep = - imageRepForImageListAndIndex(imageList, imageIndex); + imageRepForImageListAndIndex(imageList, imageIndex); if (rep) { [icon addRepresentation: rep]; } @@ -389,7 +392,7 @@ static NSImageRep *imageRepForImageListAndIndex(HIMAGELIST imageListH, if (SHGetImageListPtr(SHIL_EXTRALARGE, &IID_IImageList, &imageList) == S_OK) { NSImageRep *rep = - imageRepForImageListAndIndex(imageList, imageIndex); + imageRepForImageListAndIndex(imageList, imageIndex); if (rep) { [icon addRepresentation: rep]; } @@ -397,7 +400,7 @@ static NSImageRep *imageRepForImageListAndIndex(HIMAGELIST imageListH, if (SHGetImageListPtr(SHIL_LARGE, &IID_IImageList, &imageList) == S_OK) { NSImageRep *rep = - imageRepForImageListAndIndex(imageList, imageIndex); + imageRepForImageListAndIndex(imageList, imageIndex); if (rep) { [icon addRepresentation: rep]; } @@ -405,7 +408,7 @@ static NSImageRep *imageRepForImageListAndIndex(HIMAGELIST imageListH, if (SHGetImageListPtr(SHIL_SMALL, &IID_IImageList, &imageList) == S_OK) { NSImageRep *rep = - imageRepForImageListAndIndex(imageList, imageIndex); + imageRepForImageListAndIndex(imageList, imageIndex); if (rep) { [icon addRepresentation: rep]; } diff --git a/AppKit/Win32.subproj/glweak.m b/AppKit/Win32.subproj/glweak.m index 049c6c6e..368cfbd5 100644 --- a/AppKit/Win32.subproj/glweak.m +++ b/AppKit/Win32.subproj/glweak.m @@ -9,7 +9,7 @@ void CGLBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) { PFNGLBUFFERDATAPROC function = - (PFNGLBUFFERDATAPROC) wglGetProcAddress("glBufferData"); + (PFNGLBUFFERDATAPROC) wglGetProcAddress("glBufferData"); if (function == NULL) { if (NSDebugEnabled) @@ -22,7 +22,7 @@ void CGLBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, void CGLGenBuffers(GLsizei n, GLuint *buffers) { PFNGLGENBUFFERSPROC function = - (PFNGLGENBUFFERSPROC) wglGetProcAddress("glGenBuffers"); + (PFNGLGENBUFFERSPROC) wglGetProcAddress("glGenBuffers"); if (function == NULL) { if (NSDebugEnabled) @@ -34,7 +34,7 @@ void CGLGenBuffers(GLsizei n, GLuint *buffers) { void CGLDeleteBuffers(GLsizei n, const GLuint *buffers) { PFNGLDELETEBUFFERSPROC function = - (PFNGLDELETEBUFFERSPROC) wglGetProcAddress("glDeleteBuffers"); + (PFNGLDELETEBUFFERSPROC) wglGetProcAddress("glDeleteBuffers"); if (function == NULL) { if (NSDebugEnabled) @@ -46,7 +46,7 @@ void CGLDeleteBuffers(GLsizei n, const GLuint *buffers) { void CGLBindBuffer(GLenum target, GLuint buffer) { PFNGLBINDBUFFERPROC function = - (PFNGLBINDBUFFERPROC) wglGetProcAddress("glBindBuffer"); + (PFNGLBINDBUFFERPROC) wglGetProcAddress("glBindBuffer"); if (function == NULL) { if (NSDebugEnabled) @@ -59,7 +59,7 @@ void CGLBindBuffer(GLenum target, GLuint buffer) { void *CGLMapBuffer(GLenum target, GLenum access) { PFNGLMAPBUFFERPROC function = - (PFNGLMAPBUFFERPROC) wglGetProcAddress("glMapBuffer"); + (PFNGLMAPBUFFERPROC) wglGetProcAddress("glMapBuffer"); if (function == NULL) { if (NSDebugEnabled) @@ -72,7 +72,7 @@ void *CGLMapBuffer(GLenum target, GLenum access) { CGL_EXPORT GLboolean CGLUnmapBuffer(GLenum target) { PFNGLUNMAPBUFFERPROC function = - (PFNGLUNMAPBUFFERPROC) wglGetProcAddress("glUnmapBuffer"); + (PFNGLUNMAPBUFFERPROC) wglGetProcAddress("glUnmapBuffer"); if (function == NULL) { if (NSDebugEnabled) @@ -87,7 +87,7 @@ void CGLBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) { PFNGLBUFFERSUBDATAPROC function = - (PFNGLBUFFERSUBDATAPROC) wglGetProcAddress("glBufferSubData"); + (PFNGLBUFFERSUBDATAPROC) wglGetProcAddress("glBufferSubData"); if (function == NULL) { if (NSDebugEnabled) diff --git a/AppKit/Win32.subproj/opengl_dll.m b/AppKit/Win32.subproj/opengl_dll.m index c8397b2b..d78c87ec 100644 --- a/AppKit/Win32.subproj/opengl_dll.m +++ b/AppKit/Win32.subproj/opengl_dll.m @@ -76,13 +76,13 @@ bool opengl_hasPixelBufferObject() { void opengl_glGenBuffers(GLsizei n, GLuint *buffers) { PFNGLGENBUFFERSARBPROC function = - (PFNGLGENBUFFERSARBPROC) wglGetProcAddress("glGenBuffersARB"); + (PFNGLGENBUFFERSARBPROC) wglGetProcAddress("glGenBuffersARB"); function(n, buffers); } void opengl_glBindBuffer(GLenum target, GLuint buffer) { PFNGLBINDBUFFERARBPROC function = - (PFNGLBINDBUFFERARBPROC) wglGetProcAddress("glBindBufferARB"); + (PFNGLBINDBUFFERARBPROC) wglGetProcAddress("glBindBufferARB"); function(target, buffer); } @@ -90,7 +90,7 @@ void opengl_glBufferData(GLenum target, GLsizeiptr size, const GLvoid *bytes, GLenum usage) { PFNGLBUFFERDATAARBPROC function = - (PFNGLBUFFERDATAARBPROC) wglGetProcAddress("glBufferDataARB"); + (PFNGLBUFFERDATAARBPROC) wglGetProcAddress("glBufferDataARB"); function(target, size, bytes, usage); } @@ -98,38 +98,38 @@ void opengl_glBufferSubData(GLenum target, GLsizeiptr offset, GLsizeiptr size, const GLvoid *bytes) { PFNGLBUFFERSUBDATAARBPROC function = - (PFNGLBUFFERSUBDATAARBPROC) wglGetProcAddress("glBufferSubDataARB"); + (PFNGLBUFFERSUBDATAARBPROC) wglGetProcAddress("glBufferSubDataARB"); function(target, offset, size, bytes); } void opengl_glDeleteBuffers(GLsizei n, const GLuint *buffers) { PFNGLDELETEBUFFERSARBPROC function = - (PFNGLDELETEBUFFERSARBPROC) wglGetProcAddress("glDeleteBuffersARB"); + (PFNGLDELETEBUFFERSARBPROC) wglGetProcAddress("glDeleteBuffersARB"); function(n, buffers); } void opengl_glGetBufferParameteriv(GLenum target, GLenum value, GLint *data) { PFNGLGETBUFFERPARAMETERIVARBPROC function = - (PFNGLGETBUFFERPARAMETERIVARBPROC) wglGetProcAddress( - "glGetBufferParameterivARB"); + (PFNGLGETBUFFERPARAMETERIVARBPROC) wglGetProcAddress( + "glGetBufferParameterivARB"); function(target, value, data); } GLvoid *opengl_glMapBuffer(GLenum target, GLenum access) { PFNGLMAPBUFFERARBPROC function = - (PFNGLMAPBUFFERARBPROC) wglGetProcAddress("glMapBufferARB"); + (PFNGLMAPBUFFERARBPROC) wglGetProcAddress("glMapBufferARB"); return function(target, access); } GLboolean opengl_glUnmapBuffer(GLenum target) { PFNGLUNMAPBUFFERARBPROC function = - (PFNGLUNMAPBUFFERARBPROC) wglGetProcAddress("glUnmapBufferARB"); + (PFNGLUNMAPBUFFERARBPROC) wglGetProcAddress("glUnmapBufferARB"); return function(target); } const char *opengl_wglGetExtensionsStringARB(HDC hdc) { APIENTRY typeof(opengl_wglGetExtensionsStringARB) *function = - (typeof(function)) wglGetProcAddress("wglGetExtensionsStringARB"); + (typeof(function)) wglGetProcAddress("wglGetExtensionsStringARB"); if (function == NULL) { if (NSDebugEnabled) @@ -142,7 +142,7 @@ const char *opengl_wglGetExtensionsStringARB(HDC hdc) { const char *opengl_wglGetExtensionsStringEXT(HDC hdc) { APIENTRY typeof(opengl_wglGetExtensionsStringEXT) *function = - (typeof(function)) wglGetProcAddress("wglGetExtensionsStringEXT"); + (typeof(function)) wglGetProcAddress("wglGetExtensionsStringEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -157,7 +157,7 @@ HPBUFFERARB opengl_wglCreatePbufferARB(HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList) { APIENTRY typeof(opengl_wglCreatePbufferARB) *function = - (typeof(function)) wglGetProcAddress("wglCreatePbufferARB"); + (typeof(function)) wglGetProcAddress("wglCreatePbufferARB"); if (function == NULL) { if (NSDebugEnabled) @@ -170,7 +170,7 @@ HPBUFFERARB opengl_wglCreatePbufferARB(HDC hDC, int iPixelFormat, int iWidth, HDC opengl_wglGetPbufferDCARB(HPBUFFERARB hPbuffer) { APIENTRY typeof(opengl_wglGetPbufferDCARB) *function = - (typeof(function)) wglGetProcAddress("wglGetPbufferDCARB"); + (typeof(function)) wglGetProcAddress("wglGetPbufferDCARB"); if (function == NULL) { if (NSDebugEnabled) @@ -183,7 +183,7 @@ HDC opengl_wglGetPbufferDCARB(HPBUFFERARB hPbuffer) { int opengl_wglReleasePbufferDCARB(HPBUFFERARB hPbuffer, HDC hDC) { APIENTRY typeof(opengl_wglReleasePbufferDCARB) *function = - (typeof(function)) wglGetProcAddress("wglReleasePbufferDCARB"); + (typeof(function)) wglGetProcAddress("wglReleasePbufferDCARB"); if (function == NULL) { if (NSDebugEnabled) @@ -196,7 +196,7 @@ int opengl_wglReleasePbufferDCARB(HPBUFFERARB hPbuffer, HDC hDC) { BOOL opengl_wglDestroyPbufferARB(HPBUFFERARB hPbuffer) { APIENTRY typeof(opengl_wglDestroyPbufferARB) *function = - (typeof(function)) wglGetProcAddress("wglDestroyPbufferARB"); + (typeof(function)) wglGetProcAddress("wglDestroyPbufferARB"); if (function == NULL) { if (NSDebugEnabled) @@ -211,7 +211,7 @@ BOOL opengl_wglQueryPbufferARB(HPBUFFERARB hPbuffer, int iAttribute, int *piValue) { APIENTRY typeof(opengl_wglQueryPbufferARB) *function = - (typeof(function)) wglGetProcAddress("wglQueryPbufferARB"); + (typeof(function)) wglGetProcAddress("wglQueryPbufferARB"); if (function == NULL) { if (NSDebugEnabled) @@ -226,8 +226,8 @@ BOOL opengl_wglGetPixelFormatAttribivARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues) { - APIENTRY typeof(opengl_wglGetPixelFormatAttribivARB) *function = - (typeof(function)) wglGetProcAddress("wglGetPixelFormatAttribivARB"); + APIENTRY typeof(opengl_wglGetPixelFormatAttribivARB) *function = (typeof( + function)) wglGetProcAddress("wglGetPixelFormatAttribivARB"); if (function == NULL) { if (NSDebugEnabled) @@ -244,8 +244,8 @@ BOOL opengl_wglGetPixelFormatAttribfvARB(HDC hdc, int iPixelFormat, const int *piAttributes, FLOAT *pfValues) { - APIENTRY typeof(opengl_wglGetPixelFormatAttribfvARB) *function = - (typeof(function)) wglGetProcAddress("wglGetPixelFormatAttribfvARB"); + APIENTRY typeof(opengl_wglGetPixelFormatAttribfvARB) *function = (typeof( + function)) wglGetProcAddress("wglGetPixelFormatAttribfvARB"); if (function == NULL) { if (NSDebugEnabled) @@ -263,7 +263,7 @@ BOOL opengl_wglChoosePixelFormatARB(HDC hdc, const int *piAttribIList, UINT *nNumFormats) { APIENTRY typeof(opengl_wglChoosePixelFormatARB) *function = - (typeof(function)) wglGetProcAddress("wglChoosePixelFormatARB"); + (typeof(function)) wglGetProcAddress("wglChoosePixelFormatARB"); if (function == NULL) { if (NSDebugEnabled) @@ -277,7 +277,7 @@ BOOL opengl_wglChoosePixelFormatARB(HDC hdc, const int *piAttribIList, void opengl_glGenFramebuffersEXT(GLsizei count, GLuint *results) { APIENTRY typeof(opengl_glGenFramebuffersEXT) *function = - (typeof(function)) wglGetProcAddress("glGenFramebuffersEXT"); + (typeof(function)) wglGetProcAddress("glGenFramebuffersEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -290,7 +290,7 @@ void opengl_glGenFramebuffersEXT(GLsizei count, GLuint *results) { void opengl_glDeleteFramebuffersEXT(GLsizei count, const GLuint *idents) { APIENTRY typeof(opengl_glDeleteFramebuffersEXT) *function = - (typeof(function)) wglGetProcAddress("glDeleteFramebuffersEXT"); + (typeof(function)) wglGetProcAddress("glDeleteFramebuffersEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -303,7 +303,7 @@ void opengl_glDeleteFramebuffersEXT(GLsizei count, const GLuint *idents) { void opengl_glBindFramebufferEXT(GLenum target, GLuint ident) { APIENTRY typeof(opengl_glBindFramebufferEXT) *function = - (typeof(function)) wglGetProcAddress("glBindFramebufferEXT"); + (typeof(function)) wglGetProcAddress("glBindFramebufferEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -316,7 +316,7 @@ void opengl_glBindFramebufferEXT(GLenum target, GLuint ident) { void opengl_glGenRenderbuffersEXT(GLsizei count, GLuint *results) { APIENTRY typeof(opengl_glGenRenderbuffersEXT) *function = - (typeof(function)) wglGetProcAddress("glGenRenderbuffersEXT"); + (typeof(function)) wglGetProcAddress("glGenRenderbuffersEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -329,7 +329,7 @@ void opengl_glGenRenderbuffersEXT(GLsizei count, GLuint *results) { void opengl_glDeleteRenderbuffersEXT(GLsizei count, const GLuint *idents) { APIENTRY typeof(opengl_glDeleteRenderbuffersEXT) *function = - (typeof(function)) wglGetProcAddress("glDeleteRenderbuffersEXT"); + (typeof(function)) wglGetProcAddress("glDeleteRenderbuffersEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -344,7 +344,7 @@ void opengl_glRenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height) { APIENTRY typeof(opengl_glRenderbufferStorageEXT) *function = - (typeof(function)) wglGetProcAddress("glRenderbufferStorageEXT"); + (typeof(function)) wglGetProcAddress("glRenderbufferStorageEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -357,7 +357,7 @@ void opengl_glRenderbufferStorageEXT(GLenum target, GLenum internalFormat, void opengl_glBindRenderbufferEXT(GLenum target, GLuint ident) { APIENTRY typeof(opengl_glBindRenderbufferEXT) *function = - (typeof(function)) wglGetProcAddress("glBindRenderbufferEXT"); + (typeof(function)) wglGetProcAddress("glBindRenderbufferEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -372,8 +372,8 @@ void opengl_glFramebufferRenderbufferEXT(GLenum target, GLenum attachmentPoint, GLenum renderbufferTarget, GLuint renderbufferId) { - APIENTRY typeof(opengl_glFramebufferRenderbufferEXT) *function = - (typeof(function)) wglGetProcAddress("glFramebufferRenderbufferEXT"); + APIENTRY typeof(opengl_glFramebufferRenderbufferEXT) *function = (typeof( + function)) wglGetProcAddress("glFramebufferRenderbufferEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -386,7 +386,7 @@ void opengl_glFramebufferRenderbufferEXT(GLenum target, GLenum attachmentPoint, GLenum opengl_glCheckFramebufferStatusEXT(GLenum target) { APIENTRY typeof(opengl_glCheckFramebufferStatusEXT) *function = - (typeof(function)) wglGetProcAddress("glCheckFramebufferStatusEXT"); + (typeof(function)) wglGetProcAddress("glCheckFramebufferStatusEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -402,7 +402,7 @@ void opengl_glFramebufferTexture2DEXT(GLenum target, GLenum attachmentPoint, GLint level) { APIENTRY typeof(opengl_glFramebufferTexture2DEXT) *function = - (typeof(function)) wglGetProcAddress("glFramebufferTexture2DEXT"); + (typeof(function)) wglGetProcAddress("glFramebufferTexture2DEXT"); if (function == NULL) { if (NSDebugEnabled) @@ -417,7 +417,7 @@ HGLRC opengl_wglCreateContextAttribsARB(HDC hDC, HGLRC hshareContext, const int *attribList) { APIENTRY typeof(opengl_wglCreateContextAttribsARB) *function = - (typeof(function)) wglGetProcAddress("wglCreateContextAttribsARB"); + (typeof(function)) wglGetProcAddress("wglCreateContextAttribsARB"); if (function == NULL) { // if(NSDebugEnabled) @@ -430,7 +430,7 @@ HGLRC opengl_wglCreateContextAttribsARB(HDC hDC, HGLRC hshareContext, BOOL opengl_wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGLRC hglrc) { APIENTRY typeof(opengl_wglMakeContextCurrentARB) *function = - (typeof(function)) wglGetProcAddress("wglMakeContextCurrentARB"); + (typeof(function)) wglGetProcAddress("wglMakeContextCurrentARB"); if (function == NULL) { // if(NSDebugEnabled) @@ -443,7 +443,7 @@ BOOL opengl_wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGLRC hglrc) { BOOL opengl_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuffer) { APIENTRY typeof(opengl_wglBindTexImageARB) *function = - (typeof(function)) wglGetProcAddress("wglBindTexImageARB"); + (typeof(function)) wglGetProcAddress("wglBindTexImageARB"); if (function == NULL) { // if(NSDebugEnabled) @@ -456,7 +456,7 @@ BOOL opengl_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuffer) { BOOL opengl_wglReleaseTexImageARB(HPBUFFERARB hPbuffer, int iBuffer) { APIENTRY typeof(opengl_wglReleaseTexImageARB) *function = - (typeof(function)) wglGetProcAddress("wglReleaseTexImageARB"); + (typeof(function)) wglGetProcAddress("wglReleaseTexImageARB"); if (function == NULL) { // if(NSDebugEnabled) @@ -471,7 +471,7 @@ BOOL opengl_wglSetPbufferAttribARB(HPBUFFERARB hPbuffer, const int *piAttribList) { APIENTRY typeof(opengl_wglSetPbufferAttribARB) *function = - (typeof(function)) wglGetProcAddress("wglSetPbufferAttribARB"); + (typeof(function)) wglGetProcAddress("wglSetPbufferAttribARB"); if (function == NULL) { // if(NSDebugEnabled) @@ -484,7 +484,7 @@ BOOL opengl_wglSetPbufferAttribARB(HPBUFFERARB hPbuffer, BOOL opengl_wglSwapIntervalEXT(int interval) { APIENTRY typeof(opengl_wglSwapIntervalEXT) *function = - (typeof(function)) wglGetProcAddress("wglSwapIntervalEXT"); + (typeof(function)) wglGetProcAddress("wglSwapIntervalEXT"); if (function == NULL) { NSLog(@"wglGetProcAddress(wglSwapIntervalEXT) failed"); @@ -498,7 +498,7 @@ void opengl_glAddSwapHintRectWIN(GLint x, GLint y, GLsizei width, GLsizei height) { WINAPI typeof(opengl_glAddSwapHintRectWIN) *function = - (typeof(function)) wglGetProcAddress("glAddSwapHintRectWIN"); + (typeof(function)) wglGetProcAddress("glAddSwapHintRectWIN"); if (function == NULL) { NSLog(@"wglGetProcAddress(glAddSwapHintRectWIN) failed"); diff --git a/AppKit/X11.backend/X11Cursor.m b/AppKit/X11.backend/X11Cursor.m index 845bf45a..bdc97bdf 100644 --- a/AppKit/X11.backend/X11Cursor.m +++ b/AppKit/X11.backend/X11Cursor.m @@ -44,14 +44,14 @@ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef context = CGBitmapContextCreate( - NULL, width, height, 8, 0, colorSpace, - kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); + NULL, width, height, 8, 0, colorSpace, + kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); CGColorSpaceRelease(colorSpace); @autoreleasepool { NSGraphicsContext *graphicsContext = - [NSGraphicsContext graphicsContextWithGraphicsPort: context - flipped: NO]; + [NSGraphicsContext graphicsContextWithGraphicsPort: context + flipped: NO]; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext: graphicsContext]; @@ -91,11 +91,11 @@ Pixmap blank; XColor dummy; - blank = - XCreateBitmapFromData(display, DefaultRootWindow(display), data, 1, 1); + blank = XCreateBitmapFromData(display, DefaultRootWindow(display), data, 1, + 1); if (blank != None) { - _cursor = - XCreatePixmapCursor(display, blank, blank, &dummy, &dummy, 0, 0); + _cursor = XCreatePixmapCursor(display, blank, blank, &dummy, &dummy, 0, + 0); XFreePixmap(display, blank); } else _cursor = None; diff --git a/AppKit/X11.backend/X11Display.m b/AppKit/X11.backend/X11Display.m index 45ca415a..66f8f4fb 100644 --- a/AppKit/X11.backend/X11Display.m +++ b/AppKit/X11.backend/X11Display.m @@ -92,8 +92,9 @@ static void socketCallback(CFSocketRef s, CFSocketCallBackType type, _fileDescriptor = ConnectionNumber(_display); #ifndef DARLING _inputSource = [[NSSelectInputSource - socketInputSourceWithSocket: - [NSSocket_bsd socketWithDescriptor: _fileDescriptor]] retain]; + socketInputSourceWithSocket: + [NSSocket_bsd socketWithDescriptor: _fileDescriptor]] + retain]; [_inputSource setDelegate: self]; [_inputSource setSelectEventMask: NSSelectReadEvent]; #else @@ -106,10 +107,10 @@ static void socketCallback(CFSocketRef s, CFSocketCallBackType type, .release = NULL, .copyDescription = NULL}; _cfSocket = CFSocketCreateWithNative( - kCFAllocatorDefault, _fileDescriptor, kCFSocketReadCallBack, - socketCallback, &context); + kCFAllocatorDefault, _fileDescriptor, kCFSocketReadCallBack, + socketCallback, &context); _source = - CFSocketCreateRunLoopSource(kCFAllocatorDefault, _cfSocket, 0); + CFSocketCreateRunLoopSource(kCFAllocatorDefault, _cfSocket, 0); CFRunLoopAddSource(CFRunLoopGetMain(), _source, kCFRunLoopCommonModes); CGLRegisterNativeDisplay(_display); @@ -158,24 +159,24 @@ static void socketCallback(CFSocketRef s, CFSocketCallBackType type, screen = XRRGetScreenResources(_display, DefaultRootWindow(_display)); NSMutableArray *retval = - [NSMutableArray arrayWithCapacity: screen->noutput]; + [NSMutableArray arrayWithCapacity: screen->noutput]; Atom edidAtom = XInternAtom(_display, "EDID", FALSE); for (int i = 0; i < screen->noutput; i++) { XRROutputInfo *oinfo = - XRRGetOutputInfo(_display, screen, screen->outputs[i]); + XRRGetOutputInfo(_display, screen, screen->outputs[i]); NSScreen *nsscreen; if (oinfo->crtc) { XRRCrtcInfo *crtc = - XRRGetCrtcInfo(_display, screen, oinfo->crtc); + XRRGetCrtcInfo(_display, screen, oinfo->crtc); NSRect frame = - NSMakeRect(crtc->x, crtc->y, crtc->width, crtc->height); + NSMakeRect(crtc->x, crtc->y, crtc->width, crtc->height); nsscreen = - [[[NSScreen alloc] initWithFrame: frame - visibleFrame: frame] autorelease]; + [[[NSScreen alloc] initWithFrame: frame + visibleFrame: frame] autorelease]; Atom actualType; unsigned long nitems, bytesAfter; @@ -193,9 +194,9 @@ static void socketCallback(CFSocketRef s, CFSocketCallBackType type, XRRFreeCrtcInfo(crtc); } else { - nsscreen = - [[[NSScreen alloc] initWithFrame: NSZeroRect - visibleFrame: NSZeroRect] autorelease]; + nsscreen = [[[NSScreen alloc] initWithFrame: NSZeroRect + visibleFrame: NSZeroRect] + autorelease]; } [nsscreen setCgDirectDisplayID: (i + 1)]; @@ -208,13 +209,13 @@ static void socketCallback(CFSocketRef s, CFSocketCallBackType type, return [NSArray arrayWithArray: retval]; } else { - NSRect frame = - NSMakeRect(0, 0, DisplayWidth(_display, DefaultScreen(_display)), - DisplayHeight(_display, DefaultScreen(_display))); - return - [NSArray arrayWithObject: [[[NSScreen alloc] initWithFrame: frame - visibleFrame: frame] - autorelease]]; + NSRect frame = NSMakeRect( + 0, 0, DisplayWidth(_display, DefaultScreen(_display)), + DisplayHeight(_display, DefaultScreen(_display))); + return [NSArray + arrayWithObject: [[[NSScreen alloc] initWithFrame: frame + visibleFrame: frame] + autorelease]]; } } @@ -222,8 +223,8 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { double rate = 0; if (mi->hTotal && mi->vTotal) - rate = - (double) mi->dotClock / ((double) mi->hTotal * (double) mi->vTotal); + rate = (double) mi->dotClock / + ((double) mi->hTotal * (double) mi->vTotal); return @{ @"Width" : @(mi->width), @@ -236,7 +237,7 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { - (NSArray *) modesForScreen: (int) screenIndex { int eventBase, errorBase; const int defaultDepth = - XDefaultDepthOfScreen(XDefaultScreenOfDisplay(_display)); + XDefaultDepthOfScreen(XDefaultScreenOfDisplay(_display)); if (!XRRQueryExtension(_display, &eventBase, &errorBase)) { Screen *defaultScreen = XDefaultScreenOfDisplay(_display); @@ -247,18 +248,18 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { } ]; } else { XRRScreenResources *screen = - XRRGetScreenResources(_display, DefaultRootWindow(_display)); + XRRGetScreenResources(_display, DefaultRootWindow(_display)); if (screenIndex < 0 || screenIndex >= screen->noutput) { XRRFreeScreenResources(screen); return nil; } - XRROutputInfo *oinfo = - XRRGetOutputInfo(_display, screen, screen->outputs[screenIndex]); + XRROutputInfo *oinfo = XRRGetOutputInfo(_display, screen, + screen->outputs[screenIndex]); NSMutableArray *retval = - [NSMutableArray arrayWithCapacity: oinfo->nmode]; + [NSMutableArray arrayWithCapacity: oinfo->nmode]; for (int i = 0; i < oinfo->nmode; i++) { XRRModeInfo *mode = NULL; @@ -298,15 +299,15 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { if (XRRQueryExtension(_display, &eventBase, &errorBase)) { XRRScreenResources *screen = - XRRGetScreenResources(_display, DefaultRootWindow(_display)); + XRRGetScreenResources(_display, DefaultRootWindow(_display)); if (screenIndex < 0 || screenIndex >= screen->noutput) { XRRFreeScreenResources(screen); return dict; } - XRROutputInfo *oinfo = - XRRGetOutputInfo(_display, screen, screen->outputs[screenIndex]); + XRROutputInfo *oinfo = XRRGetOutputInfo(_display, screen, + screen->outputs[screenIndex]); if (oinfo->crtc) { XRRCrtcInfo *crtc = XRRGetCrtcInfo(_display, screen, oinfo->crtc); @@ -314,9 +315,9 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { for (int i = 0; i < screen->nmode; i++) { if (screen->modes[i].id == crtc->mode) { const int defaultDepth = XDefaultDepthOfScreen( - XDefaultScreenOfDisplay(_display)); - dict = - modeInfoToDictionary(&screen->modes[i], defaultDepth); + XDefaultScreenOfDisplay(_display)); + dict = modeInfoToDictionary(&screen->modes[i], + defaultDepth); break; } @@ -365,7 +366,7 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { return; XkbDescPtr desc = - XkbGetKeyboard(_display, XkbAllComponentsMask, XkbUseCoreKbd); + XkbGetKeyboard(_display, XkbAllComponentsMask, XkbUseCoreKbd); if (!desc) return; @@ -427,7 +428,7 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { group = state.group; struct MyLayout *layout = - (struct MyLayout *) malloc(sizeof(struct MyLayout)); + (struct MyLayout *) malloc(sizeof(struct MyLayout)); layout->layout.keyLayoutHeaderFormat = kUCKeyLayoutHeaderFormat; layout->layout.keyLayoutDataVersion = 0; @@ -437,12 +438,12 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { memset(layout->layout.keyboardTypeList, 0, sizeof(UCKeyboardTypeHeader)); layout->layout.keyboardTypeList[0].keyModifiersToTableNumOffset = - offsetof(struct MyLayout, modifierVariants); + offsetof(struct MyLayout, modifierVariants); layout->layout.keyboardTypeList[0].keyToCharTableIndexOffset = - offsetof(struct MyLayout, tableIndex); + offsetof(struct MyLayout, tableIndex); layout->modifierVariants.keyModifiersToTableNumFormat = - kUCKeyModifiersToTableNumFormat; + kUCKeyModifiersToTableNumFormat; layout->modifierVariants.defaultTableNum = 0; layout->modifierVariants.modifiersCount = 3; layout->modifierVariants.tableNum[0] = 0; @@ -453,9 +454,9 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { layout->tableIndex.keyToCharTableSize = 128; layout->tableIndex.keyToCharTableCount = 2; layout->tableIndex.keyToCharTableOffsets[0] = - offsetof(struct MyLayout, table1); + offsetof(struct MyLayout, table1); layout->tableIndex.keyToCharTableOffsets[1] = - offsetof(struct MyLayout, table2); + offsetof(struct MyLayout, table2); for (int shift = 0; shift <= 1; shift++) { UCKeyOutput *outTable = (shift == 0) ? layout->table1 : layout->table2; @@ -645,8 +646,8 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { FcChar8 *family; if (FcPatternGetString(set->fonts[i], FC_FAMILY, 0, &family) == FcResultMatch) { - [ret addObject: [NSString - stringWithUTF8String: (const char *) family]]; + [ret addObject: [NSString stringWithUTF8String: (const char *) + family]]; } } @@ -682,7 +683,7 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { } - (NSArray *) fontTypefacesForFamilyName: - (NSString *) familyName + (NSString *) familyName { familyName = [self substituteFamilyName: familyName]; if (familyName == nil) { @@ -702,10 +703,10 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { FcPattern *p = set->fonts[i]; if (FcPatternGetString(p, FC_STYLE, 0, &typeface) == FcResultMatch) { NSString *traitName = - [NSString stringWithUTF8String: (const char *) typeface]; + [NSString stringWithUTF8String: (const char *) typeface]; FcChar8 *pattern = FcNameUnparse(p); NSString *name = - [NSString stringWithUTF8String: (const char *) pattern]; + [NSString stringWithUTF8String: (const char *) pattern]; FcStrFree(pattern); NSFontTraitMask traits = 0; @@ -735,9 +736,9 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { traits |= NSExpandedFontMask; NSFontTypeface *face = - [[NSFontTypeface alloc] initWithName: name - traitName: traitName - traits: traits]; + [[NSFontTypeface alloc] initWithName: name + traitName: traitName + traits: traits]; [ret addObject: face]; [face release]; } @@ -763,7 +764,7 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { } - (int) runModalPrintPanelWithPrintInfoDictionary: - (NSMutableDictionary *) attributes + (NSMutableDictionary *) attributes { NSUnimplementedMethod(); return 0; @@ -778,17 +779,17 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { } - (int) savePanel: (NSSavePanel *) savePanel - runModalForDirectory: (NSString *) directory - file: (NSString *) file + runModalForDirectory: (NSString *) directory + file: (NSString *) file { NSUnimplementedMethod(); return 0; } - (int) openPanel: (NSOpenPanel *) openPanel - runModalForDirectory: (NSString *) directory - file: (NSString *) file - types: (NSArray *) types + runModalForDirectory: (NSString *) directory + file: (NSString *) file + types: (NSArray *) types { NSUnimplementedMethod(); return 0; @@ -809,12 +810,12 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { - (void) setWindow: (id) window forID: (XID) i { if (window) [_windowsByID - setObject: window - forKey: [NSNumber numberWithUnsignedLong: (unsigned long) i]]; + setObject: window + forKey: [NSNumber + numberWithUnsignedLong: (unsigned long) i]]; else - [_windowsByID - removeObjectForKey: [NSNumber - numberWithUnsignedLong: (unsigned long) i]]; + [_windowsByID removeObjectForKey: [NSNumber numberWithUnsignedLong: + (unsigned long) i]]; } - (id) windowForID: (XID) i { @@ -887,22 +888,22 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { case KeyPress: case KeyRelease:; NSEventModifierFlags modifierFlags = - [self modifierFlagsForState: ev->xkey.state]; + [self modifierFlagsForState: ev->xkey.state]; char buf[4] = {0}; XLookupString((XKeyEvent *) ev, buf, 4, NULL, NULL); id str = [[NSString alloc] initWithCString: buf encoding: NSISOLatin1StringEncoding]; NSPoint pos = - [window transformPoint: NSMakePoint(ev->xkey.x, ev->xkey.y)]; + [window transformPoint: NSMakePoint(ev->xkey.x, ev->xkey.y)]; id strIg = [str lowercaseString]; if (ev->xkey.state) { ev->xkey.state = 0; XLookupString((XKeyEvent *) ev, buf, 4, NULL, NULL); - strIg = - [[NSString alloc] initWithCString: buf - encoding: NSISOLatin1StringEncoding]; + strIg = [[NSString alloc] + initWithCString: buf + encoding: NSISOLatin1StringEncoding]; } // If there's an app that uses constants from HIToolbox/Events.h (e.g. @@ -936,8 +937,8 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { } lastClickTimeStamp = now; - pos = - [window transformPoint: NSMakePoint(ev->xbutton.x, ev->xbutton.y)]; + pos = [window + transformPoint: NSMakePoint(ev->xbutton.x, ev->xbutton.y)]; switch (ev->xbutton.button) { case Button1: @@ -955,20 +956,21 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { } event = [NSEvent - mouseEventWithType: type - location: pos - modifierFlags: [self modifierFlagsForState: ev->xbutton.state] - window: delegate - clickCount: clickCount - deltaX: 0.0 - deltaY: 0.0]; + mouseEventWithType: type + location: pos + modifierFlags: [self modifierFlagsForState: ev->xbutton + .state] + window: delegate + clickCount: clickCount + deltaX: 0.0 + deltaY: 0.0]; [(NSEvent_mouse *) event _setButtonNumber: ev->xbutton.button]; [self postEvent: event atStart: NO]; break; case ButtonRelease: - pos = - [window transformPoint: NSMakePoint(ev->xbutton.x, ev->xbutton.y)]; + pos = [window + transformPoint: NSMakePoint(ev->xbutton.x, ev->xbutton.y)]; CGFloat deltaY = 0.0; @@ -992,13 +994,14 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { } event = [NSEvent - mouseEventWithType: type - location: pos - modifierFlags: [self modifierFlagsForState: ev->xbutton.state] - window: delegate - clickCount: clickCount - deltaX: 0.0 - deltaY: deltaY]; + mouseEventWithType: type + location: pos + modifierFlags: [self modifierFlagsForState: ev->xbutton + .state] + window: delegate + clickCount: clickCount + deltaX: 0.0 + deltaY: deltaY]; [event _setButtonNumber: ev->xbutton.button]; [self postEvent: event atStart: NO]; break; @@ -1010,7 +1013,7 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { CGPoint lastMotionPos = [window mouseLocationOutsideOfEventStream]; pos = [window - transformPoint: NSMakePoint(ev->xmotion.x, ev->xmotion.y)]; + transformPoint: NSMakePoint(ev->xmotion.x, ev->xmotion.y)]; CGFloat deltaX = pos.x - lastMotionPos.x; CGFloat deltaY = pos.y - lastMotionPos.y; @@ -1051,14 +1054,14 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { break; event = [NSEvent - mouseEventWithType: type - location: pos - modifierFlags: [self modifierFlagsForState: ev->xmotion - .state] - window: delegate - clickCount: 1 - deltaX: deltaX - deltaY: deltaY]; + mouseEventWithType: type + location: pos + modifierFlags: + [self modifierFlagsForState: ev->xmotion.state] + window: delegate + clickCount: 1 + deltaX: deltaX + deltaY: deltaY]; [self postEvent: event atStart: NO]; [self discardEventsMatchingMask: NSLeftMouseDraggedMask beforeEvent: event]; @@ -1071,7 +1074,8 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { NSLog(@"EnterNotify"); if (!_cursorGrabbed) [window setLastKnownCursorPosition: - [window transformPoint: NSMakePoint(ev->xcrossing.x, + [window transformPoint: NSMakePoint( + ev->xcrossing.x, ev->xcrossing.y)]]; break; @@ -1110,7 +1114,7 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { ev->xexpose.width, ev->xexpose.height); rect.origin.y = - [window frame].size.height - rect.origin.y - rect.size.height; + [window frame].size.height - rect.origin.y - rect.size.height; // rect=NSInsetRect(rect, -10, -10); // [_backingContext addToDirtyRect:rect]; if (ev->xexpose.count == 0) @@ -1215,7 +1219,7 @@ static NSDictionary *modeInfoToDictionary(const XRRModeInfo *mi, int depth) { case ClientMessage: if (ev->xclient.format == 32 && ev->xclient.data.l[0] == - XInternAtom(_display, "WM_DELETE_WINDOW", False)) + XInternAtom(_display, "WM_DELETE_WINDOW", False)) [delegate platformWindowWillClose: window]; break; @@ -1272,7 +1276,7 @@ void CGNativeBorderFrameWidthsForStyle(NSUInteger styleMask, CGFloat *top, } - (CGRect) insetRect: (CGRect) frame - forNativeWindowBorderWithStyle: (NSUInteger) styleMask + forNativeWindowBorderWithStyle: (NSUInteger) styleMask { CGFloat top, left, bottom, right; @@ -1287,7 +1291,7 @@ void CGNativeBorderFrameWidthsForStyle(NSUInteger styleMask, CGFloat *top, } - (CGRect) outsetRect: (CGRect) frame - forNativeWindowBorderWithStyle: (NSUInteger) styleMask + forNativeWindowBorderWithStyle: (NSUInteger) styleMask { CGFloat top, left, bottom, right; @@ -1330,10 +1334,10 @@ void CGNativeBorderFrameWidthsForStyle(NSUInteger styleMask, CGFloat *top, // frame.origin.x, frame.origin.y, frame.size.width, // frame.size.height); CGPoint ptGlobal = - NSMakePoint(frame.size.width / 2.0 + frame.origin.x, - frame.size.height / 2.0 + frame.origin.y); - CGPoint ptLocal = - NSMakePoint(frame.size.width / 2.0, frame.size.height / 2.0); + NSMakePoint(frame.size.width / 2.0 + frame.origin.x, + frame.size.height / 2.0 + frame.origin.y); + CGPoint ptLocal = NSMakePoint(frame.size.width / 2.0, + frame.size.height / 2.0); // NSLog(@"setting last known pos in window to x=%f, y=%f\n", // ptLocal.x, ptLocal.y); diff --git a/AppKit/X11.backend/X11KeySymToUCS.m b/AppKit/X11.backend/X11KeySymToUCS.m index 4ff9a3de..31defb59 100644 --- a/AppKit/X11.backend/X11KeySymToUCS.m +++ b/AppKit/X11.backend/X11KeySymToUCS.m @@ -4,413 +4,549 @@ // Source: https://github.com/substack/node-keysym/blob/master/data/keysyms.txt static const uint32_t x11KeySymToUCSData[][2] = { - {0x0020, 0x0020}, {0x0021, 0x0021}, {0x0022, 0x0022}, {0x0023, 0x0023}, - {0x0024, 0x0024}, {0x0025, 0x0025}, {0x0026, 0x0026}, {0x0027, 0x0027}, - {0x0027, 0x0027}, {0x0028, 0x0028}, {0x0029, 0x0029}, {0x002a, 0x002a}, - {0x002b, 0x002b}, {0x002c, 0x002c}, {0x002d, 0x002d}, {0x002e, 0x002e}, - {0x002f, 0x002f}, {0x0030, 0x0030}, {0x0031, 0x0031}, {0x0032, 0x0032}, - {0x0033, 0x0033}, {0x0034, 0x0034}, {0x0035, 0x0035}, {0x0036, 0x0036}, - {0x0037, 0x0037}, {0x0038, 0x0038}, {0x0039, 0x0039}, {0x003a, 0x003a}, - {0x003b, 0x003b}, {0x003c, 0x003c}, {0x003d, 0x003d}, {0x003e, 0x003e}, - {0x003f, 0x003f}, {0x0040, 0x0040}, {0x0041, 0x0041}, {0x0042, 0x0042}, - {0x0043, 0x0043}, {0x0044, 0x0044}, {0x0045, 0x0045}, {0x0046, 0x0046}, - {0x0047, 0x0047}, {0x0048, 0x0048}, {0x0049, 0x0049}, {0x004a, 0x004a}, - {0x004b, 0x004b}, {0x004c, 0x004c}, {0x004d, 0x004d}, {0x004e, 0x004e}, - {0x004f, 0x004f}, {0x0050, 0x0050}, {0x0051, 0x0051}, {0x0052, 0x0052}, - {0x0053, 0x0053}, {0x0054, 0x0054}, {0x0055, 0x0055}, {0x0056, 0x0056}, - {0x0057, 0x0057}, {0x0058, 0x0058}, {0x0059, 0x0059}, {0x005a, 0x005a}, - {0x005b, 0x005b}, {0x005c, 0x005c}, {0x005d, 0x005d}, {0x005e, 0x005e}, - {0x005f, 0x005f}, {0x0060, 0x0060}, {0x0060, 0x0060}, {0x0061, 0x0061}, - {0x0062, 0x0062}, {0x0063, 0x0063}, {0x0064, 0x0064}, {0x0065, 0x0065}, - {0x0066, 0x0066}, {0x0067, 0x0067}, {0x0068, 0x0068}, {0x0069, 0x0069}, - {0x006a, 0x006a}, {0x006b, 0x006b}, {0x006c, 0x006c}, {0x006d, 0x006d}, - {0x006e, 0x006e}, {0x006f, 0x006f}, {0x0070, 0x0070}, {0x0071, 0x0071}, - {0x0072, 0x0072}, {0x0073, 0x0073}, {0x0074, 0x0074}, {0x0075, 0x0075}, - {0x0076, 0x0076}, {0x0077, 0x0077}, {0x0078, 0x0078}, {0x0079, 0x0079}, - {0x007a, 0x007a}, {0x007b, 0x007b}, {0x007c, 0x007c}, {0x007d, 0x007d}, - {0x007e, 0x007e}, {0x00a0, 0x00a0}, {0x00a1, 0x00a1}, {0x00a2, 0x00a2}, - {0x00a3, 0x00a3}, {0x00a4, 0x00a4}, {0x00a5, 0x00a5}, {0x00a6, 0x00a6}, - {0x00a7, 0x00a7}, {0x00a8, 0x00a8}, {0x00a9, 0x00a9}, {0x00aa, 0x00aa}, - {0x00ab, 0x00ab}, {0x00ac, 0x00ac}, {0x00ad, 0x00ad}, {0x00ae, 0x00ae}, - {0x00af, 0x00af}, {0x00b0, 0x00b0}, {0x00b1, 0x00b1}, {0x00b2, 0x00b2}, - {0x00b3, 0x00b3}, {0x00b4, 0x00b4}, {0x00b5, 0x00b5}, {0x00b6, 0x00b6}, - {0x00b7, 0x00b7}, {0x00b8, 0x00b8}, {0x00b9, 0x00b9}, {0x00ba, 0x00ba}, - {0x00bb, 0x00bb}, {0x00bc, 0x00bc}, {0x00bd, 0x00bd}, {0x00be, 0x00be}, - {0x00bf, 0x00bf}, {0x00c0, 0x00c0}, {0x00c1, 0x00c1}, {0x00c2, 0x00c2}, - {0x00c3, 0x00c3}, {0x00c4, 0x00c4}, {0x00c5, 0x00c5}, {0x00c6, 0x00c6}, - {0x00c7, 0x00c7}, {0x00c8, 0x00c8}, {0x00c9, 0x00c9}, {0x00ca, 0x00ca}, - {0x00cb, 0x00cb}, {0x00cc, 0x00cc}, {0x00cd, 0x00cd}, {0x00ce, 0x00ce}, - {0x00cf, 0x00cf}, {0x00d0, 0x00d0}, {0x00d0, 0x00d0}, {0x00d1, 0x00d1}, - {0x00d2, 0x00d2}, {0x00d3, 0x00d3}, {0x00d4, 0x00d4}, {0x00d5, 0x00d5}, - {0x00d6, 0x00d6}, {0x00d7, 0x00d7}, {0x00d8, 0x00d8}, {0x00d9, 0x00d9}, - {0x00da, 0x00da}, {0x00db, 0x00db}, {0x00dc, 0x00dc}, {0x00dd, 0x00dd}, - {0x00de, 0x00de}, {0x00de, 0x00de}, {0x00df, 0x00df}, {0x00e0, 0x00e0}, - {0x00e1, 0x00e1}, {0x00e2, 0x00e2}, {0x00e3, 0x00e3}, {0x00e4, 0x00e4}, - {0x00e5, 0x00e5}, {0x00e6, 0x00e6}, {0x00e7, 0x00e7}, {0x00e8, 0x00e8}, - {0x00e9, 0x00e9}, {0x00ea, 0x00ea}, {0x00eb, 0x00eb}, {0x00ec, 0x00ec}, - {0x00ed, 0x00ed}, {0x00ee, 0x00ee}, {0x00ef, 0x00ef}, {0x00f0, 0x00f0}, - {0x00f1, 0x00f1}, {0x00f2, 0x00f2}, {0x00f3, 0x00f3}, {0x00f4, 0x00f4}, - {0x00f5, 0x00f5}, {0x00f6, 0x00f6}, {0x00f7, 0x00f7}, {0x00f8, 0x00f8}, - {0x00f9, 0x00f9}, {0x00fa, 0x00fa}, {0x00fb, 0x00fb}, {0x00fc, 0x00fc}, - {0x00fd, 0x00fd}, {0x00fe, 0x00fe}, {0x00ff, 0x00ff}, {0x01a1, 0x0104}, - {0x01a2, 0x02d8}, {0x01a3, 0x0141}, {0x01a5, 0x013d}, {0x01a6, 0x015a}, - {0x01a9, 0x0160}, {0x01aa, 0x015e}, {0x01ab, 0x0164}, {0x01ac, 0x0179}, - {0x01ae, 0x017d}, {0x01af, 0x017b}, {0x01b1, 0x0105}, {0x01b2, 0x02db}, - {0x01b3, 0x0142}, {0x01b5, 0x013e}, {0x01b6, 0x015b}, {0x01b7, 0x02c7}, - {0x01b9, 0x0161}, {0x01ba, 0x015f}, {0x01bb, 0x0165}, {0x01bc, 0x017a}, - {0x01bd, 0x02dd}, {0x01be, 0x017e}, {0x01bf, 0x017c}, {0x01c0, 0x0154}, - {0x01c3, 0x0102}, {0x01c5, 0x0139}, {0x01c6, 0x0106}, {0x01c8, 0x010c}, - {0x01ca, 0x0118}, {0x01cc, 0x011a}, {0x01cf, 0x010e}, {0x01d0, 0x0110}, - {0x01d1, 0x0143}, {0x01d2, 0x0147}, {0x01d5, 0x0150}, {0x01d8, 0x0158}, - {0x01d9, 0x016e}, {0x01db, 0x0170}, {0x01de, 0x0162}, {0x01e0, 0x0155}, - {0x01e3, 0x0103}, {0x01e5, 0x013a}, {0x01e6, 0x0107}, {0x01e8, 0x010d}, - {0x01ea, 0x0119}, {0x01ec, 0x011b}, {0x01ef, 0x010f}, {0x01f0, 0x0111}, - {0x01f1, 0x0144}, {0x01f2, 0x0148}, {0x01f5, 0x0151}, {0x01f8, 0x0159}, - {0x01f9, 0x016f}, {0x01fb, 0x0171}, {0x01fe, 0x0163}, {0x01ff, 0x02d9}, - {0x02a1, 0x0126}, {0x02a6, 0x0124}, {0x02a9, 0x0130}, {0x02ab, 0x011e}, - {0x02ac, 0x0134}, {0x02b1, 0x0127}, {0x02b6, 0x0125}, {0x02b9, 0x0131}, - {0x02bb, 0x011f}, {0x02bc, 0x0135}, {0x02c5, 0x010a}, {0x02c6, 0x0108}, - {0x02d5, 0x0120}, {0x02d8, 0x011c}, {0x02dd, 0x016c}, {0x02de, 0x015c}, - {0x02e5, 0x010b}, {0x02e6, 0x0109}, {0x02f5, 0x0121}, {0x02f8, 0x011d}, - {0x02fd, 0x016d}, {0x02fe, 0x015d}, {0x03a2, 0x0138}, {0x03a3, 0x0156}, - {0x03a5, 0x0128}, {0x03a6, 0x013b}, {0x03aa, 0x0112}, {0x03ab, 0x0122}, - {0x03ac, 0x0166}, {0x03b3, 0x0157}, {0x03b5, 0x0129}, {0x03b6, 0x013c}, - {0x03ba, 0x0113}, {0x03bb, 0x0123}, {0x03bc, 0x0167}, {0x03bd, 0x014a}, - {0x03bf, 0x014b}, {0x03c0, 0x0100}, {0x03c7, 0x012e}, {0x03cc, 0x0116}, - {0x03cf, 0x012a}, {0x03d1, 0x0145}, {0x03d2, 0x014c}, {0x03d3, 0x0136}, - {0x03d9, 0x0172}, {0x03dd, 0x0168}, {0x03de, 0x016a}, {0x03e0, 0x0101}, - {0x03e7, 0x012f}, {0x03ec, 0x0117}, {0x03ef, 0x012b}, {0x03f1, 0x0146}, - {0x03f2, 0x014d}, {0x03f3, 0x0137}, {0x03f9, 0x0173}, {0x03fd, 0x0169}, - {0x03fe, 0x016b}, {0x047e, 0x203e}, {0x04a1, 0x3002}, {0x04a2, 0x300c}, - {0x04a3, 0x300d}, {0x04a4, 0x3001}, {0x04a5, 0x30fb}, {0x04a6, 0x30f2}, - {0x04a7, 0x30a1}, {0x04a8, 0x30a3}, {0x04a9, 0x30a5}, {0x04aa, 0x30a7}, - {0x04ab, 0x30a9}, {0x04ac, 0x30e3}, {0x04ad, 0x30e5}, {0x04ae, 0x30e7}, - {0x04af, 0x30c3}, {0x04b0, 0x30fc}, {0x04b1, 0x30a2}, {0x04b2, 0x30a4}, - {0x04b3, 0x30a6}, {0x04b4, 0x30a8}, {0x04b5, 0x30aa}, {0x04b6, 0x30ab}, - {0x04b7, 0x30ad}, {0x04b8, 0x30af}, {0x04b9, 0x30b1}, {0x04ba, 0x30b3}, - {0x04bb, 0x30b5}, {0x04bc, 0x30b7}, {0x04bd, 0x30b9}, {0x04be, 0x30bb}, - {0x04bf, 0x30bd}, {0x04c0, 0x30bf}, {0x04c1, 0x30c1}, {0x04c2, 0x30c4}, - {0x04c3, 0x30c6}, {0x04c4, 0x30c8}, {0x04c5, 0x30ca}, {0x04c6, 0x30cb}, - {0x04c7, 0x30cc}, {0x04c8, 0x30cd}, {0x04c9, 0x30ce}, {0x04ca, 0x30cf}, - {0x04cb, 0x30d2}, {0x04cc, 0x30d5}, {0x04cd, 0x30d8}, {0x04ce, 0x30db}, - {0x04cf, 0x30de}, {0x04d0, 0x30df}, {0x04d1, 0x30e0}, {0x04d2, 0x30e1}, - {0x04d3, 0x30e2}, {0x04d4, 0x30e4}, {0x04d5, 0x30e6}, {0x04d6, 0x30e8}, - {0x04d7, 0x30e9}, {0x04d8, 0x30ea}, {0x04d9, 0x30eb}, {0x04da, 0x30ec}, - {0x04db, 0x30ed}, {0x04dc, 0x30ef}, {0x04dd, 0x30f3}, {0x04de, 0x309b}, - {0x04df, 0x309c}, {0x05ac, 0x060c}, {0x05bb, 0x061b}, {0x05bf, 0x061f}, - {0x05c1, 0x0621}, {0x05c2, 0x0622}, {0x05c3, 0x0623}, {0x05c4, 0x0624}, - {0x05c5, 0x0625}, {0x05c6, 0x0626}, {0x05c7, 0x0627}, {0x05c8, 0x0628}, - {0x05c9, 0x0629}, {0x05ca, 0x062a}, {0x05cb, 0x062b}, {0x05cc, 0x062c}, - {0x05cd, 0x062d}, {0x05ce, 0x062e}, {0x05cf, 0x062f}, {0x05d0, 0x0630}, - {0x05d1, 0x0631}, {0x05d2, 0x0632}, {0x05d3, 0x0633}, {0x05d4, 0x0634}, - {0x05d5, 0x0635}, {0x05d6, 0x0636}, {0x05d7, 0x0637}, {0x05d8, 0x0638}, - {0x05d9, 0x0639}, {0x05da, 0x063a}, {0x05e0, 0x0640}, {0x05e1, 0x0641}, - {0x05e2, 0x0642}, {0x05e3, 0x0643}, {0x05e4, 0x0644}, {0x05e5, 0x0645}, - {0x05e6, 0x0646}, {0x05e7, 0x0647}, {0x05e8, 0x0648}, {0x05e9, 0x0649}, - {0x05ea, 0x064a}, {0x05eb, 0x064b}, {0x05ec, 0x064c}, {0x05ed, 0x064d}, - {0x05ee, 0x064e}, {0x05ef, 0x064f}, {0x05f0, 0x0650}, {0x05f1, 0x0651}, - {0x05f2, 0x0652}, {0x06a1, 0x0452}, {0x06a2, 0x0453}, {0x06a3, 0x0451}, - {0x06a4, 0x0454}, {0x06a5, 0x0455}, {0x06a6, 0x0456}, {0x06a7, 0x0457}, - {0x06a8, 0x0458}, {0x06a9, 0x0459}, {0x06aa, 0x045a}, {0x06ab, 0x045b}, - {0x06ac, 0x045c}, {0x06ae, 0x045e}, {0x06af, 0x045f}, {0x06b0, 0x2116}, - {0x06b1, 0x0402}, {0x06b2, 0x0403}, {0x06b3, 0x0401}, {0x06b4, 0x0404}, - {0x06b5, 0x0405}, {0x06b6, 0x0406}, {0x06b7, 0x0407}, {0x06b8, 0x0408}, - {0x06b9, 0x0409}, {0x06ba, 0x040a}, {0x06bb, 0x040b}, {0x06bc, 0x040c}, - {0x06be, 0x040e}, {0x06bf, 0x040f}, {0x06c0, 0x044e}, {0x06c1, 0x0430}, - {0x06c2, 0x0431}, {0x06c3, 0x0446}, {0x06c4, 0x0434}, {0x06c5, 0x0435}, - {0x06c6, 0x0444}, {0x06c7, 0x0433}, {0x06c8, 0x0445}, {0x06c9, 0x0438}, - {0x06ca, 0x0439}, {0x06cb, 0x043a}, {0x06cc, 0x043b}, {0x06cd, 0x043c}, - {0x06ce, 0x043d}, {0x06cf, 0x043e}, {0x06d0, 0x043f}, {0x06d1, 0x044f}, - {0x06d2, 0x0440}, {0x06d3, 0x0441}, {0x06d4, 0x0442}, {0x06d5, 0x0443}, - {0x06d6, 0x0436}, {0x06d7, 0x0432}, {0x06d8, 0x044c}, {0x06d9, 0x044b}, - {0x06da, 0x0437}, {0x06db, 0x0448}, {0x06dc, 0x044d}, {0x06dd, 0x0449}, - {0x06de, 0x0447}, {0x06df, 0x044a}, {0x06e0, 0x042e}, {0x06e1, 0x0410}, - {0x06e2, 0x0411}, {0x06e3, 0x0426}, {0x06e4, 0x0414}, {0x06e5, 0x0415}, - {0x06e6, 0x0424}, {0x06e7, 0x0413}, {0x06e8, 0x0425}, {0x06e9, 0x0418}, - {0x06ea, 0x0419}, {0x06eb, 0x041a}, {0x06ec, 0x041b}, {0x06ed, 0x041c}, - {0x06ee, 0x041d}, {0x06ef, 0x041e}, {0x06f0, 0x041f}, {0x06f1, 0x042f}, - {0x06f2, 0x0420}, {0x06f3, 0x0421}, {0x06f4, 0x0422}, {0x06f5, 0x0423}, - {0x06f6, 0x0416}, {0x06f7, 0x0412}, {0x06f8, 0x042c}, {0x06f9, 0x042b}, - {0x06fa, 0x0417}, {0x06fb, 0x0428}, {0x06fc, 0x042d}, {0x06fd, 0x0429}, - {0x06fe, 0x0427}, {0x06ff, 0x042a}, {0x07a1, 0x0386}, {0x07a2, 0x0388}, - {0x07a3, 0x0389}, {0x07a4, 0x038a}, {0x07a5, 0x03aa}, {0x07a7, 0x038c}, - {0x07a8, 0x038e}, {0x07a9, 0x03ab}, {0x07ab, 0x038f}, {0x07ae, 0x0385}, - {0x07af, 0x2015}, {0x07b1, 0x03ac}, {0x07b2, 0x03ad}, {0x07b3, 0x03ae}, - {0x07b4, 0x03af}, {0x07b5, 0x03ca}, {0x07b6, 0x0390}, {0x07b7, 0x03cc}, - {0x07b8, 0x03cd}, {0x07b9, 0x03cb}, {0x07ba, 0x03b0}, {0x07bb, 0x03ce}, - {0x07c1, 0x0391}, {0x07c2, 0x0392}, {0x07c3, 0x0393}, {0x07c4, 0x0394}, - {0x07c5, 0x0395}, {0x07c6, 0x0396}, {0x07c7, 0x0397}, {0x07c8, 0x0398}, - {0x07c9, 0x0399}, {0x07ca, 0x039a}, {0x07cb, 0x039b}, {0x07cb, 0x039b}, - {0x07cc, 0x039c}, {0x07cd, 0x039d}, {0x07ce, 0x039e}, {0x07cf, 0x039f}, - {0x07d0, 0x03a0}, {0x07d1, 0x03a1}, {0x07d2, 0x03a3}, {0x07d4, 0x03a4}, - {0x07d5, 0x03a5}, {0x07d6, 0x03a6}, {0x07d7, 0x03a7}, {0x07d8, 0x03a8}, - {0x07d9, 0x03a9}, {0x07e1, 0x03b1}, {0x07e2, 0x03b2}, {0x07e3, 0x03b3}, - {0x07e4, 0x03b4}, {0x07e5, 0x03b5}, {0x07e6, 0x03b6}, {0x07e7, 0x03b7}, - {0x07e8, 0x03b8}, {0x07e9, 0x03b9}, {0x07ea, 0x03ba}, {0x07eb, 0x03bb}, - {0x07ec, 0x03bc}, {0x07ed, 0x03bd}, {0x07ee, 0x03be}, {0x07ef, 0x03bf}, - {0x07f0, 0x03c0}, {0x07f1, 0x03c1}, {0x07f2, 0x03c3}, {0x07f3, 0x03c2}, - {0x07f4, 0x03c4}, {0x07f5, 0x03c5}, {0x07f6, 0x03c6}, {0x07f7, 0x03c7}, - {0x07f8, 0x03c8}, {0x07f9, 0x03c9}, {0x08a1, 0x23b7}, {0x08a2, 0x250c}, - {0x08a3, 0x2500}, {0x08a4, 0x2320}, {0x08a5, 0x2321}, {0x08a6, 0x2502}, - {0x08a7, 0x23a1}, {0x08a8, 0x23a3}, {0x08a9, 0x23a4}, {0x08aa, 0x23a6}, - {0x08ab, 0x239b}, {0x08ac, 0x239d}, {0x08ad, 0x239e}, {0x08ae, 0x23a0}, - {0x08af, 0x23a8}, {0x08b0, 0x23ac}, {0x08b1, 0x0000}, {0x08b2, 0x0000}, - {0x08b3, 0x0000}, {0x08b4, 0x0000}, {0x08b5, 0x0000}, {0x08b6, 0x0000}, - {0x08b7, 0x0000}, {0x08bc, 0x2264}, {0x08bd, 0x2260}, {0x08be, 0x2265}, - {0x08bf, 0x222b}, {0x08c0, 0x2234}, {0x08c1, 0x221d}, {0x08c2, 0x221e}, - {0x08c5, 0x2207}, {0x08c8, 0x223c}, {0x08c9, 0x2243}, {0x08cd, 0x21d4}, - {0x08ce, 0x21d2}, {0x08cf, 0x2261}, {0x08d6, 0x221a}, {0x08da, 0x2282}, - {0x08db, 0x2283}, {0x08dc, 0x2229}, {0x08dd, 0x222a}, {0x08de, 0x2227}, - {0x08df, 0x2228}, {0x08ef, 0x2202}, {0x08f6, 0x0192}, {0x08fb, 0x2190}, - {0x08fc, 0x2191}, {0x08fd, 0x2192}, {0x08fe, 0x2193}, {0x09df, 0x0000}, - {0x09e0, 0x25c6}, {0x09e1, 0x2592}, {0x09e2, 0x2409}, {0x09e3, 0x240c}, - {0x09e4, 0x240d}, {0x09e5, 0x240a}, {0x09e8, 0x2424}, {0x09e9, 0x240b}, - {0x09ea, 0x2518}, {0x09eb, 0x2510}, {0x09ec, 0x250c}, {0x09ed, 0x2514}, - {0x09ee, 0x253c}, {0x09ef, 0x23ba}, {0x09f0, 0x23bb}, {0x09f1, 0x2500}, - {0x09f2, 0x23bc}, {0x09f3, 0x23bd}, {0x09f4, 0x251c}, {0x09f5, 0x2524}, - {0x09f6, 0x2534}, {0x09f7, 0x252c}, {0x09f8, 0x2502}, {0x0aa1, 0x2003}, - {0x0aa2, 0x2002}, {0x0aa3, 0x2004}, {0x0aa4, 0x2005}, {0x0aa5, 0x2007}, - {0x0aa6, 0x2008}, {0x0aa7, 0x2009}, {0x0aa8, 0x200a}, {0x0aa9, 0x2014}, - {0x0aaa, 0x2013}, {0x0aac, 0x2423}, {0x0aae, 0x2026}, {0x0aaf, 0x2025}, - {0x0ab0, 0x2153}, {0x0ab1, 0x2154}, {0x0ab2, 0x2155}, {0x0ab3, 0x2156}, - {0x0ab4, 0x2157}, {0x0ab5, 0x2158}, {0x0ab6, 0x2159}, {0x0ab7, 0x215a}, - {0x0ab8, 0x2105}, {0x0abb, 0x2012}, {0x0abc, 0x27e8}, {0x0abd, 0x002e}, - {0x0abe, 0x27e9}, {0x0abf, 0x0000}, {0x0ac3, 0x215b}, {0x0ac4, 0x215c}, - {0x0ac5, 0x215d}, {0x0ac6, 0x215e}, {0x0ac9, 0x2122}, {0x0aca, 0x2613}, - {0x0acb, 0x0000}, {0x0acc, 0x25c1}, {0x0acd, 0x25b7}, {0x0ace, 0x25cb}, - {0x0acf, 0x25af}, {0x0ad0, 0x2018}, {0x0ad1, 0x2019}, {0x0ad2, 0x201c}, - {0x0ad3, 0x201d}, {0x0ad4, 0x211e}, {0x0ad6, 0x2032}, {0x0ad7, 0x2033}, - {0x0ad9, 0x271d}, {0x0ada, 0x0000}, {0x0adb, 0x25ac}, {0x0adc, 0x25c0}, - {0x0add, 0x25b6}, {0x0ade, 0x25cf}, {0x0adf, 0x25ae}, {0x0ae0, 0x25e6}, - {0x0ae1, 0x25ab}, {0x0ae2, 0x25ad}, {0x0ae3, 0x25b3}, {0x0ae4, 0x25bd}, - {0x0ae5, 0x2606}, {0x0ae6, 0x2022}, {0x0ae7, 0x25aa}, {0x0ae8, 0x25b2}, - {0x0ae9, 0x25bc}, {0x0aea, 0x261c}, {0x0aeb, 0x261e}, {0x0aec, 0x2663}, - {0x0aed, 0x2666}, {0x0aee, 0x2665}, {0x0af0, 0x2720}, {0x0af1, 0x2020}, - {0x0af2, 0x2021}, {0x0af3, 0x2713}, {0x0af4, 0x2717}, {0x0af5, 0x266f}, - {0x0af6, 0x266d}, {0x0af7, 0x2642}, {0x0af8, 0x2640}, {0x0af9, 0x260e}, - {0x0afa, 0x2315}, {0x0afb, 0x2117}, {0x0afc, 0x2038}, {0x0afd, 0x201a}, - {0x0afe, 0x201e}, {0x0aff, 0x0000}, {0x0ba3, 0x003c}, {0x0ba6, 0x003e}, - {0x0ba8, 0x2228}, {0x0ba9, 0x2227}, {0x0bc0, 0x00af}, {0x0bc2, 0x22a5}, - {0x0bc3, 0x2229}, {0x0bc4, 0x230a}, {0x0bc6, 0x005f}, {0x0bca, 0x2218}, - {0x0bcc, 0x2395}, {0x0bce, 0x22a4}, {0x0bcf, 0x25cb}, {0x0bd3, 0x2308}, - {0x0bd6, 0x222a}, {0x0bd8, 0x2283}, {0x0bda, 0x2282}, {0x0bdc, 0x22a2}, - {0x0bfc, 0x22a3}, {0x0cdf, 0x2017}, {0x0ce0, 0x05d0}, {0x0ce1, 0x05d1}, - {0x0ce1, 0x05d1}, {0x0ce2, 0x05d2}, {0x0ce2, 0x05d2}, {0x0ce3, 0x05d3}, - {0x0ce3, 0x05d3}, {0x0ce4, 0x05d4}, {0x0ce5, 0x05d5}, {0x0ce6, 0x05d6}, - {0x0ce6, 0x05d6}, {0x0ce7, 0x05d7}, {0x0ce7, 0x05d7}, {0x0ce8, 0x05d8}, - {0x0ce8, 0x05d8}, {0x0ce9, 0x05d9}, {0x0cea, 0x05da}, {0x0ceb, 0x05db}, - {0x0cec, 0x05dc}, {0x0ced, 0x05dd}, {0x0cee, 0x05de}, {0x0cef, 0x05df}, - {0x0cf0, 0x05e0}, {0x0cf1, 0x05e1}, {0x0cf1, 0x05e1}, {0x0cf2, 0x05e2}, - {0x0cf3, 0x05e3}, {0x0cf4, 0x05e4}, {0x0cf5, 0x05e5}, {0x0cf5, 0x05e5}, - {0x0cf6, 0x05e6}, {0x0cf6, 0x05e6}, {0x0cf7, 0x05e7}, {0x0cf7, 0x05e7}, - {0x0cf8, 0x05e8}, {0x0cf9, 0x05e9}, {0x0cfa, 0x05ea}, {0x0cfa, 0x05ea}, - {0x0da1, 0x0e01}, {0x0da2, 0x0e02}, {0x0da3, 0x0e03}, {0x0da4, 0x0e04}, - {0x0da5, 0x0e05}, {0x0da6, 0x0e06}, {0x0da7, 0x0e07}, {0x0da8, 0x0e08}, - {0x0da9, 0x0e09}, {0x0daa, 0x0e0a}, {0x0dab, 0x0e0b}, {0x0dac, 0x0e0c}, - {0x0dad, 0x0e0d}, {0x0dae, 0x0e0e}, {0x0daf, 0x0e0f}, {0x0db0, 0x0e10}, - {0x0db1, 0x0e11}, {0x0db2, 0x0e12}, {0x0db3, 0x0e13}, {0x0db4, 0x0e14}, - {0x0db5, 0x0e15}, {0x0db6, 0x0e16}, {0x0db7, 0x0e17}, {0x0db8, 0x0e18}, - {0x0db9, 0x0e19}, {0x0dba, 0x0e1a}, {0x0dbb, 0x0e1b}, {0x0dbc, 0x0e1c}, - {0x0dbd, 0x0e1d}, {0x0dbe, 0x0e1e}, {0x0dbf, 0x0e1f}, {0x0dc0, 0x0e20}, - {0x0dc1, 0x0e21}, {0x0dc2, 0x0e22}, {0x0dc3, 0x0e23}, {0x0dc4, 0x0e24}, - {0x0dc5, 0x0e25}, {0x0dc6, 0x0e26}, {0x0dc7, 0x0e27}, {0x0dc8, 0x0e28}, - {0x0dc9, 0x0e29}, {0x0dca, 0x0e2a}, {0x0dcb, 0x0e2b}, {0x0dcc, 0x0e2c}, - {0x0dcd, 0x0e2d}, {0x0dce, 0x0e2e}, {0x0dcf, 0x0e2f}, {0x0dd0, 0x0e30}, - {0x0dd1, 0x0e31}, {0x0dd2, 0x0e32}, {0x0dd3, 0x0e33}, {0x0dd4, 0x0e34}, - {0x0dd5, 0x0e35}, {0x0dd6, 0x0e36}, {0x0dd7, 0x0e37}, {0x0dd8, 0x0e38}, - {0x0dd9, 0x0e39}, {0x0dda, 0x0e3a}, {0x0dde, 0x0000}, {0x0ddf, 0x0e3f}, - {0x0de0, 0x0e40}, {0x0de1, 0x0e41}, {0x0de2, 0x0e42}, {0x0de3, 0x0e43}, - {0x0de4, 0x0e44}, {0x0de5, 0x0e45}, {0x0de6, 0x0e46}, {0x0de7, 0x0e47}, - {0x0de8, 0x0e48}, {0x0de9, 0x0e49}, {0x0dea, 0x0e4a}, {0x0deb, 0x0e4b}, - {0x0dec, 0x0e4c}, {0x0ded, 0x0e4d}, {0x0df0, 0x0e50}, {0x0df1, 0x0e51}, - {0x0df2, 0x0e52}, {0x0df3, 0x0e53}, {0x0df4, 0x0e54}, {0x0df5, 0x0e55}, - {0x0df6, 0x0e56}, {0x0df7, 0x0e57}, {0x0df8, 0x0e58}, {0x0df9, 0x0e59}, - {0x0ea1, 0x3131}, {0x0ea2, 0x3132}, {0x0ea3, 0x3133}, {0x0ea4, 0x3134}, - {0x0ea5, 0x3135}, {0x0ea6, 0x3136}, {0x0ea7, 0x3137}, {0x0ea8, 0x3138}, - {0x0ea9, 0x3139}, {0x0eaa, 0x313a}, {0x0eab, 0x313b}, {0x0eac, 0x313c}, - {0x0ead, 0x313d}, {0x0eae, 0x313e}, {0x0eaf, 0x313f}, {0x0eb0, 0x3140}, - {0x0eb1, 0x3141}, {0x0eb2, 0x3142}, {0x0eb3, 0x3143}, {0x0eb4, 0x3144}, - {0x0eb5, 0x3145}, {0x0eb6, 0x3146}, {0x0eb7, 0x3147}, {0x0eb8, 0x3148}, - {0x0eb9, 0x3149}, {0x0eba, 0x314a}, {0x0ebb, 0x314b}, {0x0ebc, 0x314c}, - {0x0ebd, 0x314d}, {0x0ebe, 0x314e}, {0x0ebf, 0x314f}, {0x0ec0, 0x3150}, - {0x0ec1, 0x3151}, {0x0ec2, 0x3152}, {0x0ec3, 0x3153}, {0x0ec4, 0x3154}, - {0x0ec5, 0x3155}, {0x0ec6, 0x3156}, {0x0ec7, 0x3157}, {0x0ec8, 0x3158}, - {0x0ec9, 0x3159}, {0x0eca, 0x315a}, {0x0ecb, 0x315b}, {0x0ecc, 0x315c}, - {0x0ecd, 0x315d}, {0x0ece, 0x315e}, {0x0ecf, 0x315f}, {0x0ed0, 0x3160}, - {0x0ed1, 0x3161}, {0x0ed2, 0x3162}, {0x0ed3, 0x3163}, {0x0ed4, 0x11a8}, - {0x0ed5, 0x11a9}, {0x0ed6, 0x11aa}, {0x0ed7, 0x11ab}, {0x0ed8, 0x11ac}, - {0x0ed9, 0x11ad}, {0x0eda, 0x11ae}, {0x0edb, 0x11af}, {0x0edc, 0x11b0}, - {0x0edd, 0x11b1}, {0x0ede, 0x11b2}, {0x0edf, 0x11b3}, {0x0ee0, 0x11b4}, - {0x0ee1, 0x11b5}, {0x0ee2, 0x11b6}, {0x0ee3, 0x11b7}, {0x0ee4, 0x11b8}, - {0x0ee5, 0x11b9}, {0x0ee6, 0x11ba}, {0x0ee7, 0x11bb}, {0x0ee8, 0x11bc}, - {0x0ee9, 0x11bd}, {0x0eea, 0x11be}, {0x0eeb, 0x11bf}, {0x0eec, 0x11c0}, - {0x0eed, 0x11c1}, {0x0eee, 0x11c2}, {0x0eef, 0x316d}, {0x0ef0, 0x3171}, - {0x0ef1, 0x3178}, {0x0ef2, 0x317f}, {0x0ef3, 0x3181}, {0x0ef4, 0x3184}, - {0x0ef5, 0x3186}, {0x0ef6, 0x318d}, {0x0ef7, 0x318e}, {0x0ef8, 0x11eb}, - {0x0ef9, 0x11f0}, {0x0efa, 0x11f9}, {0x0eff, 0x20a9}, {0x13bc, 0x0152}, - {0x13bd, 0x0153}, {0x13be, 0x0178}, {0x20a0, 0x20a0}, {0x20a1, 0x20a1}, - {0x20a2, 0x20a2}, {0x20a3, 0x20a3}, {0x20a4, 0x20a4}, {0x20a5, 0x20a5}, - {0x20a6, 0x20a6}, {0x20a7, 0x20a7}, {0x20a8, 0x20a8}, {0x20a9, 0x20a9}, - {0x20aa, 0x20aa}, {0x20ab, 0x20ab}, {0x20ac, 0x20ac}, {0xfd01, 0x0000}, - {0xfd02, 0x0000}, {0xfd03, 0x0000}, {0xfd04, 0x0000}, {0xfd05, 0x0000}, - {0xfd06, 0x0000}, {0xfd07, 0x0000}, {0xfd08, 0x0000}, {0xfd09, 0x0000}, - {0xfd0a, 0x0000}, {0xfd0b, 0x0000}, {0xfd0c, 0x0000}, {0xfd0d, 0x0000}, - {0xfd0e, 0x0000}, {0xfd0f, 0x0000}, {0xfd10, 0x0000}, {0xfd11, 0x0000}, - {0xfd12, 0x0000}, {0xfd13, 0x0000}, {0xfd14, 0x0000}, {0xfd15, 0x0000}, - {0xfd16, 0x0000}, {0xfd17, 0x0000}, {0xfd18, 0x0000}, {0xfd19, 0x0000}, - {0xfd1a, 0x0000}, {0xfd1b, 0x0000}, {0xfd1c, 0x0000}, {0xfd1d, 0x0000}, - {0xfd1e, 0x0000}, {0xfe01, 0x0000}, {0xfe02, 0x0000}, {0xfe03, 0x0000}, - {0xfe04, 0x0000}, {0xfe05, 0x0000}, {0xfe06, 0x0000}, {0xfe07, 0x0000}, - {0xfe08, 0x0000}, {0xfe09, 0x0000}, {0xfe0a, 0x0000}, {0xfe0b, 0x0000}, - {0xfe0c, 0x0000}, {0xfe0d, 0x0000}, {0xfe0e, 0x0000}, {0xfe0f, 0x0000}, - {0xfe20, 0x0000}, {0xfe21, 0x0000}, {0xfe22, 0x0000}, {0xfe23, 0x0000}, - {0xfe24, 0x0000}, {0xfe25, 0x0000}, {0xfe26, 0x0000}, {0xfe27, 0x0000}, - {0xfe28, 0x0000}, {0xfe29, 0x0000}, {0xfe2a, 0x0000}, {0xfe2b, 0x0000}, - {0xfe2c, 0x0000}, {0xfe2d, 0x0000}, {0xfe2e, 0x0000}, {0xfe2f, 0x0000}, - {0xfe30, 0x0000}, {0xfe31, 0x0000}, {0xfe32, 0x0000}, {0xfe33, 0x0000}, - {0xfe34, 0x0000}, {0xfe50, 0x0300}, {0xfe51, 0x0301}, {0xfe52, 0x0302}, - {0xfe53, 0x0303}, {0xfe54, 0x0304}, {0xfe55, 0x0306}, {0xfe56, 0x0307}, - {0xfe57, 0x0308}, {0xfe58, 0x030a}, {0xfe59, 0x030b}, {0xfe5a, 0x030c}, - {0xfe5b, 0x0327}, {0xfe5c, 0x0328}, {0xfe5d, 0x0345}, {0xfe5e, 0x3099}, - {0xfe5f, 0x309a}, {0xfe70, 0x0000}, {0xfe71, 0x0000}, {0xfe72, 0x0000}, - {0xfe73, 0x0000}, {0xfe74, 0x0000}, {0xfe75, 0x0000}, {0xfe76, 0x0000}, - {0xfe77, 0x0000}, {0xfe78, 0x0000}, {0xfe79, 0x0000}, {0xfe7a, 0x0000}, - {0xfed0, 0x0000}, {0xfed1, 0x0000}, {0xfed2, 0x0000}, {0xfed4, 0x0000}, - {0xfed5, 0x0000}, {0xfee0, 0x0000}, {0xfee1, 0x0000}, {0xfee2, 0x0000}, - {0xfee3, 0x0000}, {0xfee4, 0x0000}, {0xfee5, 0x0000}, {0xfee6, 0x0000}, - {0xfee7, 0x0000}, {0xfee8, 0x0000}, {0xfee9, 0x0000}, {0xfeea, 0x0000}, - {0xfeeb, 0x0000}, {0xfeec, 0x0000}, {0xfeed, 0x0000}, {0xfeee, 0x0000}, - {0xfeef, 0x0000}, {0xfef0, 0x0000}, {0xfef1, 0x0000}, {0xfef2, 0x0000}, - {0xfef3, 0x0000}, {0xfef4, 0x0000}, {0xfef5, 0x0000}, {0xfef6, 0x0000}, - {0xfef7, 0x0000}, {0xfef8, 0x0000}, {0xfef9, 0x0000}, {0xfefa, 0x0000}, - {0xfefb, 0x0000}, {0xfefc, 0x0000}, {0xfefd, 0x0000}, {0xff08, 0x0008}, - {0xff09, 0x0009}, {0xff0a, 0x000a}, {0xff0b, 0x000b}, {0xff0d, 0x000d}, - {0xff13, 0x0013}, {0xff14, 0x0014}, {0xff15, 0x0015}, {0xff1b, 0x001b}, - {0xff20, 0x0000}, {0xff21, 0x0000}, {0xff22, 0x0000}, {0xff23, 0x0000}, - {0xff24, 0x0000}, {0xff25, 0x0000}, {0xff26, 0x0000}, {0xff27, 0x0000}, - {0xff28, 0x0000}, {0xff29, 0x0000}, {0xff2a, 0x0000}, {0xff2b, 0x0000}, - {0xff2c, 0x0000}, {0xff2d, 0x0000}, {0xff2e, 0x0000}, {0xff2f, 0x0000}, - {0xff30, 0x0000}, {0xff31, 0x0000}, {0xff32, 0x0000}, {0xff33, 0x0000}, - {0xff34, 0x0000}, {0xff35, 0x0000}, {0xff36, 0x0000}, {0xff37, 0x0000}, - {0xff38, 0x0000}, {0xff39, 0x0000}, {0xff3a, 0x0000}, {0xff3b, 0x0000}, - {0xff3c, 0x0000}, {0xff3d, 0x0000}, {0xff3e, 0x0000}, {0xff3f, 0x0000}, - {0xff50, 0x0000}, {0xff51, 0x0000}, {0xff52, 0x0000}, {0xff53, 0x0000}, - {0xff54, 0x0000}, {0xff55, 0x0000}, {0xff56, 0x0000}, {0xff57, 0x0000}, - {0xff58, 0x0000}, {0xff60, 0x0000}, {0xff61, 0x0000}, {0xff62, 0x0000}, - {0xff63, 0x0000}, {0xff65, 0x0000}, {0xff66, 0x0000}, {0xff67, 0x0000}, - {0xff68, 0x0000}, {0xff69, 0x0000}, {0xff6a, 0x0000}, {0xff6b, 0x0000}, - {0xff7e, 0x0000}, {0xff7f, 0x0000}, {0xff80, 0x0020}, {0xff89, 0x0009}, - {0xff8d, 0x000d}, {0xff91, 0x0000}, {0xff92, 0x0000}, {0xff93, 0x0000}, - {0xff94, 0x0000}, {0xff95, 0x0000}, {0xff96, 0x0000}, {0xff97, 0x0000}, - {0xff98, 0x0000}, {0xff99, 0x0000}, {0xff9a, 0x0000}, {0xff9b, 0x0000}, - {0xff9c, 0x0000}, {0xff9d, 0x0000}, {0xff9e, 0x0000}, {0xff9f, 0x0000}, - {0xffaa, 0x002a}, {0xffab, 0x002b}, {0xffac, 0x002c}, {0xffad, 0x002d}, - {0xffae, 0x002e}, {0xffaf, 0x002f}, {0xffb0, 0x0030}, {0xffb1, 0x0031}, - {0xffb2, 0x0032}, {0xffb3, 0x0033}, {0xffb4, 0x0034}, {0xffb5, 0x0035}, - {0xffb6, 0x0036}, {0xffb7, 0x0037}, {0xffb8, 0x0038}, {0xffb9, 0x0039}, - {0xffbd, 0x003d}, {0xffbe, 0x0000}, {0xffbf, 0x0000}, {0xffc0, 0x0000}, - {0xffc1, 0x0000}, {0xffc2, 0x0000}, {0xffc3, 0x0000}, {0xffc4, 0x0000}, - {0xffc5, 0x0000}, {0xffc6, 0x0000}, {0xffc7, 0x0000}, {0xffc8, 0x0000}, - {0xffc9, 0x0000}, {0xffca, 0x0000}, {0xffcb, 0x0000}, {0xffcc, 0x0000}, - {0xffcd, 0x0000}, {0xffce, 0x0000}, {0xffcf, 0x0000}, {0xffd0, 0x0000}, - {0xffd1, 0x0000}, {0xffd2, 0x0000}, {0xffd3, 0x0000}, {0xffd4, 0x0000}, - {0xffd5, 0x0000}, {0xffd6, 0x0000}, {0xffd7, 0x0000}, {0xffd8, 0x0000}, - {0xffd9, 0x0000}, {0xffda, 0x0000}, {0xffdb, 0x0000}, {0xffdc, 0x0000}, - {0xffdd, 0x0000}, {0xffde, 0x0000}, {0xffdf, 0x0000}, {0xffe0, 0x0000}, - {0xffe1, 0x0000}, {0xffe2, 0x0000}, {0xffe3, 0x0000}, {0xffe4, 0x0000}, - {0xffe5, 0x0000}, {0xffe6, 0x0000}, {0xffe7, 0x0000}, {0xffe8, 0x0000}, - {0xffe9, 0x0000}, {0xffea, 0x0000}, {0xffeb, 0x0000}, {0xffec, 0x0000}, - {0xffed, 0x0000}, {0xffee, 0x0000}, {0xffff, 0x0000}, {0xffffff, 0x0000}, - {0x06ad, 0x0491}, {0x06bd, 0x0490}, {0x14a1, 0x0000}, {0x14a2, 0x0587}, - {0x14a3, 0x0589}, {0x14a4, 0x0029}, {0x14a5, 0x0028}, {0x14a6, 0x00bb}, - {0x14a7, 0x00ab}, {0x14a8, 0x2014}, {0x14a9, 0x002e}, {0x14aa, 0x055d}, - {0x14ab, 0x002c}, {0x14ac, 0x2013}, {0x14ad, 0x058a}, {0x14ae, 0x2026}, - {0x14af, 0x055c}, {0x14b0, 0x055b}, {0x14b1, 0x055e}, {0x14b2, 0x0531}, - {0x14b3, 0x0561}, {0x14b4, 0x0532}, {0x14b5, 0x0562}, {0x14b6, 0x0533}, - {0x14b7, 0x0563}, {0x14b8, 0x0534}, {0x14b9, 0x0564}, {0x14ba, 0x0535}, - {0x14bb, 0x0565}, {0x14bc, 0x0536}, {0x14bd, 0x0566}, {0x14be, 0x0537}, - {0x14bf, 0x0567}, {0x14c0, 0x0538}, {0x14c1, 0x0568}, {0x14c2, 0x0539}, - {0x14c3, 0x0569}, {0x14c4, 0x053a}, {0x14c5, 0x056a}, {0x14c6, 0x053b}, - {0x14c7, 0x056b}, {0x14c8, 0x053c}, {0x14c9, 0x056c}, {0x14ca, 0x053d}, - {0x14cb, 0x056d}, {0x14cc, 0x053e}, {0x14cd, 0x056e}, {0x14ce, 0x053f}, - {0x14cf, 0x056f}, {0x14d0, 0x0540}, {0x14d1, 0x0570}, {0x14d2, 0x0541}, - {0x14d3, 0x0571}, {0x14d4, 0x0542}, {0x14d5, 0x0572}, {0x14d6, 0x0543}, - {0x14d7, 0x0573}, {0x14d8, 0x0544}, {0x14d9, 0x0574}, {0x14da, 0x0545}, - {0x14db, 0x0575}, {0x14dc, 0x0546}, {0x14dd, 0x0576}, {0x14de, 0x0547}, - {0x14df, 0x0577}, {0x14e0, 0x0548}, {0x14e1, 0x0578}, {0x14e2, 0x0549}, - {0x14e3, 0x0579}, {0x14e4, 0x054a}, {0x14e5, 0x057a}, {0x14e6, 0x054b}, - {0x14e7, 0x057b}, {0x14e8, 0x054c}, {0x14e9, 0x057c}, {0x14ea, 0x054d}, - {0x14eb, 0x057d}, {0x14ec, 0x054e}, {0x14ed, 0x057e}, {0x14ee, 0x054f}, - {0x14ef, 0x057f}, {0x14f0, 0x0550}, {0x14f1, 0x0580}, {0x14f2, 0x0551}, - {0x14f3, 0x0581}, {0x14f4, 0x0552}, {0x14f5, 0x0582}, {0x14f6, 0x0553}, - {0x14f7, 0x0583}, {0x14f8, 0x0554}, {0x14f9, 0x0584}, {0x14fa, 0x0555}, - {0x14fb, 0x0585}, {0x14fc, 0x0556}, {0x14fd, 0x0586}, {0x14fe, 0x055a}, - {0x14ff, 0x00a7}, {0x15d0, 0x10d0}, {0x15d1, 0x10d1}, {0x15d2, 0x10d2}, - {0x15d3, 0x10d3}, {0x15d4, 0x10d4}, {0x15d5, 0x10d5}, {0x15d6, 0x10d6}, - {0x15d7, 0x10d7}, {0x15d8, 0x10d8}, {0x15d9, 0x10d9}, {0x15da, 0x10da}, - {0x15db, 0x10db}, {0x15dc, 0x10dc}, {0x15dd, 0x10dd}, {0x15de, 0x10de}, - {0x15df, 0x10df}, {0x15e0, 0x10e0}, {0x15e1, 0x10e1}, {0x15e2, 0x10e2}, - {0x15e3, 0x10e3}, {0x15e4, 0x10e4}, {0x15e5, 0x10e5}, {0x15e6, 0x10e6}, - {0x15e7, 0x10e7}, {0x15e8, 0x10e8}, {0x15e9, 0x10e9}, {0x15ea, 0x10ea}, - {0x15eb, 0x10eb}, {0x15ec, 0x10ec}, {0x15ed, 0x10ed}, {0x15ee, 0x10ee}, - {0x15ef, 0x10ef}, {0x15f0, 0x10f0}, {0x15f1, 0x10f1}, {0x15f2, 0x10f2}, - {0x15f3, 0x10f3}, {0x15f4, 0x10f4}, {0x15f5, 0x10f5}, {0x15f6, 0x10f6}, - {0x12a1, 0x1e02}, {0x12a2, 0x1e03}, {0x12a6, 0x1e0a}, {0x12a8, 0x1e80}, - {0x12aa, 0x1e82}, {0x12ab, 0x1e0b}, {0x12ac, 0x1ef2}, {0x12b0, 0x1e1e}, - {0x12b1, 0x1e1f}, {0x12b4, 0x1e40}, {0x12b5, 0x1e41}, {0x12b7, 0x1e56}, - {0x12b8, 0x1e81}, {0x12b9, 0x1e57}, {0x12ba, 0x1e83}, {0x12bb, 0x1e60}, - {0x12bc, 0x1ef3}, {0x12bd, 0x1e84}, {0x12be, 0x1e85}, {0x12bf, 0x1e61}, - {0x12d0, 0x0174}, {0x12d7, 0x1e6a}, {0x12de, 0x0176}, {0x12f0, 0x0175}, - {0x12f7, 0x1e6b}, {0x12fe, 0x0177}, {0x0590, 0x06f0}, {0x0591, 0x06f1}, - {0x0592, 0x06f2}, {0x0593, 0x06f3}, {0x0594, 0x06f4}, {0x0595, 0x06f5}, - {0x0596, 0x06f6}, {0x0597, 0x06f7}, {0x0598, 0x06f8}, {0x0599, 0x06f9}, - {0x05a5, 0x066a}, {0x05a6, 0x0670}, {0x05a7, 0x0679}, {0x05a8, 0x067e}, - {0x05a9, 0x0686}, {0x05aa, 0x0688}, {0x05ab, 0x0691}, {0x05ae, 0x06d4}, - {0x05b0, 0x0660}, {0x05b1, 0x0661}, {0x05b2, 0x0662}, {0x05b3, 0x0663}, - {0x05b4, 0x0664}, {0x05b5, 0x0665}, {0x05b6, 0x0666}, {0x05b7, 0x0667}, - {0x05b8, 0x0668}, {0x05b9, 0x0669}, {0x05f3, 0x0653}, {0x05f4, 0x0654}, - {0x05f5, 0x0655}, {0x05f6, 0x0698}, {0x05f7, 0x06a4}, {0x05f8, 0x06a9}, - {0x05f9, 0x06af}, {0x05fa, 0x06ba}, {0x05fb, 0x06be}, {0x05fc, 0x06cc}, - {0x05fd, 0x06d2}, {0x05fe, 0x06c1}, {0x0680, 0x0492}, {0x0681, 0x0496}, - {0x0682, 0x049a}, {0x0683, 0x049c}, {0x0684, 0x04a2}, {0x0685, 0x04ae}, - {0x0686, 0x04b0}, {0x0687, 0x04b2}, {0x0688, 0x04b6}, {0x0689, 0x04b8}, - {0x068a, 0x04ba}, {0x068c, 0x04d8}, {0x068d, 0x04e2}, {0x068e, 0x04e8}, - {0x068f, 0x04ee}, {0x0690, 0x0493}, {0x0691, 0x0497}, {0x0692, 0x049b}, - {0x0693, 0x049d}, {0x0694, 0x04a3}, {0x0695, 0x04af}, {0x0696, 0x04b1}, - {0x0697, 0x04b3}, {0x0698, 0x04b7}, {0x0699, 0x04b9}, {0x069a, 0x04bb}, - {0x069c, 0x04d9}, {0x069d, 0x04e3}, {0x069e, 0x04e9}, {0x069f, 0x04ef}, - {0x16a2, 0x0000}, {0x16a3, 0x1e8a}, {0x16a5, 0x0000}, {0x16a6, 0x012c}, - {0x16a7, 0x0000}, {0x16a8, 0x0000}, {0x16a9, 0x01b5}, {0x16aa, 0x01e6}, - {0x16af, 0x019f}, {0x16b2, 0x0000}, {0x16b3, 0x1e8b}, {0x16b4, 0x0000}, - {0x16b5, 0x0000}, {0x16b6, 0x012d}, {0x16b7, 0x0000}, {0x16b8, 0x0000}, - {0x16b9, 0x01b6}, {0x16ba, 0x01e7}, {0x16bd, 0x01d2}, {0x16bf, 0x0275}, - {0x16c6, 0x018f}, {0x16f6, 0x0259}, {0x16d1, 0x1e36}, {0x16d2, 0x0000}, - {0x16d3, 0x0000}, {0x16e1, 0x1e37}, {0x16e2, 0x0000}, {0x16e3, 0x0000}, - {0x1ea0, 0x1ea0}, {0x1ea1, 0x1ea1}, {0x1ea2, 0x1ea2}, {0x1ea3, 0x1ea3}, - {0x1ea4, 0x1ea4}, {0x1ea5, 0x1ea5}, {0x1ea6, 0x1ea6}, {0x1ea7, 0x1ea7}, - {0x1ea8, 0x1ea8}, {0x1ea9, 0x1ea9}, {0x1eaa, 0x1eaa}, {0x1eab, 0x1eab}, - {0x1eac, 0x1eac}, {0x1ead, 0x1ead}, {0x1eae, 0x1eae}, {0x1eaf, 0x1eaf}, - {0x1eb0, 0x1eb0}, {0x1eb1, 0x1eb1}, {0x1eb2, 0x1eb2}, {0x1eb3, 0x1eb3}, - {0x1eb4, 0x1eb4}, {0x1eb5, 0x1eb5}, {0x1eb6, 0x1eb6}, {0x1eb7, 0x1eb7}, - {0x1eb8, 0x1eb8}, {0x1eb9, 0x1eb9}, {0x1eba, 0x1eba}, {0x1ebb, 0x1ebb}, - {0x1ebc, 0x1ebc}, {0x1ebd, 0x1ebd}, {0x1ebe, 0x1ebe}, {0x1ebf, 0x1ebf}, - {0x1ec0, 0x1ec0}, {0x1ec1, 0x1ec1}, {0x1ec2, 0x1ec2}, {0x1ec3, 0x1ec3}, - {0x1ec4, 0x1ec4}, {0x1ec5, 0x1ec5}, {0x1ec6, 0x1ec6}, {0x1ec7, 0x1ec7}, - {0x1ec8, 0x1ec8}, {0x1ec9, 0x1ec9}, {0x1eca, 0x1eca}, {0x1ecb, 0x1ecb}, - {0x1ecc, 0x1ecc}, {0x1ecd, 0x1ecd}, {0x1ece, 0x1ece}, {0x1ecf, 0x1ecf}, - {0x1ed0, 0x1ed0}, {0x1ed1, 0x1ed1}, {0x1ed2, 0x1ed2}, {0x1ed3, 0x1ed3}, - {0x1ed4, 0x1ed4}, {0x1ed5, 0x1ed5}, {0x1ed6, 0x1ed6}, {0x1ed7, 0x1ed7}, - {0x1ed8, 0x1ed8}, {0x1ed9, 0x1ed9}, {0x1eda, 0x1eda}, {0x1edb, 0x1edb}, - {0x1edc, 0x1edc}, {0x1edd, 0x1edd}, {0x1ede, 0x1ede}, {0x1edf, 0x1edf}, - {0x1ee0, 0x1ee0}, {0x1ee1, 0x1ee1}, {0x1ee2, 0x1ee2}, {0x1ee3, 0x1ee3}, - {0x1ee4, 0x1ee4}, {0x1ee5, 0x1ee5}, {0x1ee6, 0x1ee6}, {0x1ee7, 0x1ee7}, - {0x1ee8, 0x1ee8}, {0x1ee9, 0x1ee9}, {0x1eea, 0x1eea}, {0x1eeb, 0x1eeb}, - {0x1eec, 0x1eec}, {0x1eed, 0x1eed}, {0x1eee, 0x1eee}, {0x1eef, 0x1eef}, - {0x1ef0, 0x1ef0}, {0x1ef1, 0x1ef1}, {0x1ef4, 0x1ef4}, {0x1ef5, 0x1ef5}, - {0x1ef6, 0x1ef6}, {0x1ef7, 0x1ef7}, {0x1ef8, 0x1ef8}, {0x1ef9, 0x1ef9}, - {0x1efa, 0x01a0}, {0x1efb, 0x01a1}, {0x1efc, 0x01af}, {0x1efd, 0x01b0}, - {0x1e9f, 0x0303}, {0x1ef2, 0x0300}, {0x1ef3, 0x0301}, {0x1efe, 0x0309}, - {0x1eff, 0x0323}, {0xfe60, 0x0323}, {0xfe61, 0x0309}, {0xfe62, 0x031b}, + {0x0020, 0x0020}, {0x0021, 0x0021}, {0x0022, 0x0022}, + {0x0023, 0x0023}, {0x0024, 0x0024}, {0x0025, 0x0025}, + {0x0026, 0x0026}, {0x0027, 0x0027}, {0x0027, 0x0027}, + {0x0028, 0x0028}, {0x0029, 0x0029}, {0x002a, 0x002a}, + {0x002b, 0x002b}, {0x002c, 0x002c}, {0x002d, 0x002d}, + {0x002e, 0x002e}, {0x002f, 0x002f}, {0x0030, 0x0030}, + {0x0031, 0x0031}, {0x0032, 0x0032}, {0x0033, 0x0033}, + {0x0034, 0x0034}, {0x0035, 0x0035}, {0x0036, 0x0036}, + {0x0037, 0x0037}, {0x0038, 0x0038}, {0x0039, 0x0039}, + {0x003a, 0x003a}, {0x003b, 0x003b}, {0x003c, 0x003c}, + {0x003d, 0x003d}, {0x003e, 0x003e}, {0x003f, 0x003f}, + {0x0040, 0x0040}, {0x0041, 0x0041}, {0x0042, 0x0042}, + {0x0043, 0x0043}, {0x0044, 0x0044}, {0x0045, 0x0045}, + {0x0046, 0x0046}, {0x0047, 0x0047}, {0x0048, 0x0048}, + {0x0049, 0x0049}, {0x004a, 0x004a}, {0x004b, 0x004b}, + {0x004c, 0x004c}, {0x004d, 0x004d}, {0x004e, 0x004e}, + {0x004f, 0x004f}, {0x0050, 0x0050}, {0x0051, 0x0051}, + {0x0052, 0x0052}, {0x0053, 0x0053}, {0x0054, 0x0054}, + {0x0055, 0x0055}, {0x0056, 0x0056}, {0x0057, 0x0057}, + {0x0058, 0x0058}, {0x0059, 0x0059}, {0x005a, 0x005a}, + {0x005b, 0x005b}, {0x005c, 0x005c}, {0x005d, 0x005d}, + {0x005e, 0x005e}, {0x005f, 0x005f}, {0x0060, 0x0060}, + {0x0060, 0x0060}, {0x0061, 0x0061}, {0x0062, 0x0062}, + {0x0063, 0x0063}, {0x0064, 0x0064}, {0x0065, 0x0065}, + {0x0066, 0x0066}, {0x0067, 0x0067}, {0x0068, 0x0068}, + {0x0069, 0x0069}, {0x006a, 0x006a}, {0x006b, 0x006b}, + {0x006c, 0x006c}, {0x006d, 0x006d}, {0x006e, 0x006e}, + {0x006f, 0x006f}, {0x0070, 0x0070}, {0x0071, 0x0071}, + {0x0072, 0x0072}, {0x0073, 0x0073}, {0x0074, 0x0074}, + {0x0075, 0x0075}, {0x0076, 0x0076}, {0x0077, 0x0077}, + {0x0078, 0x0078}, {0x0079, 0x0079}, {0x007a, 0x007a}, + {0x007b, 0x007b}, {0x007c, 0x007c}, {0x007d, 0x007d}, + {0x007e, 0x007e}, {0x00a0, 0x00a0}, {0x00a1, 0x00a1}, + {0x00a2, 0x00a2}, {0x00a3, 0x00a3}, {0x00a4, 0x00a4}, + {0x00a5, 0x00a5}, {0x00a6, 0x00a6}, {0x00a7, 0x00a7}, + {0x00a8, 0x00a8}, {0x00a9, 0x00a9}, {0x00aa, 0x00aa}, + {0x00ab, 0x00ab}, {0x00ac, 0x00ac}, {0x00ad, 0x00ad}, + {0x00ae, 0x00ae}, {0x00af, 0x00af}, {0x00b0, 0x00b0}, + {0x00b1, 0x00b1}, {0x00b2, 0x00b2}, {0x00b3, 0x00b3}, + {0x00b4, 0x00b4}, {0x00b5, 0x00b5}, {0x00b6, 0x00b6}, + {0x00b7, 0x00b7}, {0x00b8, 0x00b8}, {0x00b9, 0x00b9}, + {0x00ba, 0x00ba}, {0x00bb, 0x00bb}, {0x00bc, 0x00bc}, + {0x00bd, 0x00bd}, {0x00be, 0x00be}, {0x00bf, 0x00bf}, + {0x00c0, 0x00c0}, {0x00c1, 0x00c1}, {0x00c2, 0x00c2}, + {0x00c3, 0x00c3}, {0x00c4, 0x00c4}, {0x00c5, 0x00c5}, + {0x00c6, 0x00c6}, {0x00c7, 0x00c7}, {0x00c8, 0x00c8}, + {0x00c9, 0x00c9}, {0x00ca, 0x00ca}, {0x00cb, 0x00cb}, + {0x00cc, 0x00cc}, {0x00cd, 0x00cd}, {0x00ce, 0x00ce}, + {0x00cf, 0x00cf}, {0x00d0, 0x00d0}, {0x00d0, 0x00d0}, + {0x00d1, 0x00d1}, {0x00d2, 0x00d2}, {0x00d3, 0x00d3}, + {0x00d4, 0x00d4}, {0x00d5, 0x00d5}, {0x00d6, 0x00d6}, + {0x00d7, 0x00d7}, {0x00d8, 0x00d8}, {0x00d9, 0x00d9}, + {0x00da, 0x00da}, {0x00db, 0x00db}, {0x00dc, 0x00dc}, + {0x00dd, 0x00dd}, {0x00de, 0x00de}, {0x00de, 0x00de}, + {0x00df, 0x00df}, {0x00e0, 0x00e0}, {0x00e1, 0x00e1}, + {0x00e2, 0x00e2}, {0x00e3, 0x00e3}, {0x00e4, 0x00e4}, + {0x00e5, 0x00e5}, {0x00e6, 0x00e6}, {0x00e7, 0x00e7}, + {0x00e8, 0x00e8}, {0x00e9, 0x00e9}, {0x00ea, 0x00ea}, + {0x00eb, 0x00eb}, {0x00ec, 0x00ec}, {0x00ed, 0x00ed}, + {0x00ee, 0x00ee}, {0x00ef, 0x00ef}, {0x00f0, 0x00f0}, + {0x00f1, 0x00f1}, {0x00f2, 0x00f2}, {0x00f3, 0x00f3}, + {0x00f4, 0x00f4}, {0x00f5, 0x00f5}, {0x00f6, 0x00f6}, + {0x00f7, 0x00f7}, {0x00f8, 0x00f8}, {0x00f9, 0x00f9}, + {0x00fa, 0x00fa}, {0x00fb, 0x00fb}, {0x00fc, 0x00fc}, + {0x00fd, 0x00fd}, {0x00fe, 0x00fe}, {0x00ff, 0x00ff}, + {0x01a1, 0x0104}, {0x01a2, 0x02d8}, {0x01a3, 0x0141}, + {0x01a5, 0x013d}, {0x01a6, 0x015a}, {0x01a9, 0x0160}, + {0x01aa, 0x015e}, {0x01ab, 0x0164}, {0x01ac, 0x0179}, + {0x01ae, 0x017d}, {0x01af, 0x017b}, {0x01b1, 0x0105}, + {0x01b2, 0x02db}, {0x01b3, 0x0142}, {0x01b5, 0x013e}, + {0x01b6, 0x015b}, {0x01b7, 0x02c7}, {0x01b9, 0x0161}, + {0x01ba, 0x015f}, {0x01bb, 0x0165}, {0x01bc, 0x017a}, + {0x01bd, 0x02dd}, {0x01be, 0x017e}, {0x01bf, 0x017c}, + {0x01c0, 0x0154}, {0x01c3, 0x0102}, {0x01c5, 0x0139}, + {0x01c6, 0x0106}, {0x01c8, 0x010c}, {0x01ca, 0x0118}, + {0x01cc, 0x011a}, {0x01cf, 0x010e}, {0x01d0, 0x0110}, + {0x01d1, 0x0143}, {0x01d2, 0x0147}, {0x01d5, 0x0150}, + {0x01d8, 0x0158}, {0x01d9, 0x016e}, {0x01db, 0x0170}, + {0x01de, 0x0162}, {0x01e0, 0x0155}, {0x01e3, 0x0103}, + {0x01e5, 0x013a}, {0x01e6, 0x0107}, {0x01e8, 0x010d}, + {0x01ea, 0x0119}, {0x01ec, 0x011b}, {0x01ef, 0x010f}, + {0x01f0, 0x0111}, {0x01f1, 0x0144}, {0x01f2, 0x0148}, + {0x01f5, 0x0151}, {0x01f8, 0x0159}, {0x01f9, 0x016f}, + {0x01fb, 0x0171}, {0x01fe, 0x0163}, {0x01ff, 0x02d9}, + {0x02a1, 0x0126}, {0x02a6, 0x0124}, {0x02a9, 0x0130}, + {0x02ab, 0x011e}, {0x02ac, 0x0134}, {0x02b1, 0x0127}, + {0x02b6, 0x0125}, {0x02b9, 0x0131}, {0x02bb, 0x011f}, + {0x02bc, 0x0135}, {0x02c5, 0x010a}, {0x02c6, 0x0108}, + {0x02d5, 0x0120}, {0x02d8, 0x011c}, {0x02dd, 0x016c}, + {0x02de, 0x015c}, {0x02e5, 0x010b}, {0x02e6, 0x0109}, + {0x02f5, 0x0121}, {0x02f8, 0x011d}, {0x02fd, 0x016d}, + {0x02fe, 0x015d}, {0x03a2, 0x0138}, {0x03a3, 0x0156}, + {0x03a5, 0x0128}, {0x03a6, 0x013b}, {0x03aa, 0x0112}, + {0x03ab, 0x0122}, {0x03ac, 0x0166}, {0x03b3, 0x0157}, + {0x03b5, 0x0129}, {0x03b6, 0x013c}, {0x03ba, 0x0113}, + {0x03bb, 0x0123}, {0x03bc, 0x0167}, {0x03bd, 0x014a}, + {0x03bf, 0x014b}, {0x03c0, 0x0100}, {0x03c7, 0x012e}, + {0x03cc, 0x0116}, {0x03cf, 0x012a}, {0x03d1, 0x0145}, + {0x03d2, 0x014c}, {0x03d3, 0x0136}, {0x03d9, 0x0172}, + {0x03dd, 0x0168}, {0x03de, 0x016a}, {0x03e0, 0x0101}, + {0x03e7, 0x012f}, {0x03ec, 0x0117}, {0x03ef, 0x012b}, + {0x03f1, 0x0146}, {0x03f2, 0x014d}, {0x03f3, 0x0137}, + {0x03f9, 0x0173}, {0x03fd, 0x0169}, {0x03fe, 0x016b}, + {0x047e, 0x203e}, {0x04a1, 0x3002}, {0x04a2, 0x300c}, + {0x04a3, 0x300d}, {0x04a4, 0x3001}, {0x04a5, 0x30fb}, + {0x04a6, 0x30f2}, {0x04a7, 0x30a1}, {0x04a8, 0x30a3}, + {0x04a9, 0x30a5}, {0x04aa, 0x30a7}, {0x04ab, 0x30a9}, + {0x04ac, 0x30e3}, {0x04ad, 0x30e5}, {0x04ae, 0x30e7}, + {0x04af, 0x30c3}, {0x04b0, 0x30fc}, {0x04b1, 0x30a2}, + {0x04b2, 0x30a4}, {0x04b3, 0x30a6}, {0x04b4, 0x30a8}, + {0x04b5, 0x30aa}, {0x04b6, 0x30ab}, {0x04b7, 0x30ad}, + {0x04b8, 0x30af}, {0x04b9, 0x30b1}, {0x04ba, 0x30b3}, + {0x04bb, 0x30b5}, {0x04bc, 0x30b7}, {0x04bd, 0x30b9}, + {0x04be, 0x30bb}, {0x04bf, 0x30bd}, {0x04c0, 0x30bf}, + {0x04c1, 0x30c1}, {0x04c2, 0x30c4}, {0x04c3, 0x30c6}, + {0x04c4, 0x30c8}, {0x04c5, 0x30ca}, {0x04c6, 0x30cb}, + {0x04c7, 0x30cc}, {0x04c8, 0x30cd}, {0x04c9, 0x30ce}, + {0x04ca, 0x30cf}, {0x04cb, 0x30d2}, {0x04cc, 0x30d5}, + {0x04cd, 0x30d8}, {0x04ce, 0x30db}, {0x04cf, 0x30de}, + {0x04d0, 0x30df}, {0x04d1, 0x30e0}, {0x04d2, 0x30e1}, + {0x04d3, 0x30e2}, {0x04d4, 0x30e4}, {0x04d5, 0x30e6}, + {0x04d6, 0x30e8}, {0x04d7, 0x30e9}, {0x04d8, 0x30ea}, + {0x04d9, 0x30eb}, {0x04da, 0x30ec}, {0x04db, 0x30ed}, + {0x04dc, 0x30ef}, {0x04dd, 0x30f3}, {0x04de, 0x309b}, + {0x04df, 0x309c}, {0x05ac, 0x060c}, {0x05bb, 0x061b}, + {0x05bf, 0x061f}, {0x05c1, 0x0621}, {0x05c2, 0x0622}, + {0x05c3, 0x0623}, {0x05c4, 0x0624}, {0x05c5, 0x0625}, + {0x05c6, 0x0626}, {0x05c7, 0x0627}, {0x05c8, 0x0628}, + {0x05c9, 0x0629}, {0x05ca, 0x062a}, {0x05cb, 0x062b}, + {0x05cc, 0x062c}, {0x05cd, 0x062d}, {0x05ce, 0x062e}, + {0x05cf, 0x062f}, {0x05d0, 0x0630}, {0x05d1, 0x0631}, + {0x05d2, 0x0632}, {0x05d3, 0x0633}, {0x05d4, 0x0634}, + {0x05d5, 0x0635}, {0x05d6, 0x0636}, {0x05d7, 0x0637}, + {0x05d8, 0x0638}, {0x05d9, 0x0639}, {0x05da, 0x063a}, + {0x05e0, 0x0640}, {0x05e1, 0x0641}, {0x05e2, 0x0642}, + {0x05e3, 0x0643}, {0x05e4, 0x0644}, {0x05e5, 0x0645}, + {0x05e6, 0x0646}, {0x05e7, 0x0647}, {0x05e8, 0x0648}, + {0x05e9, 0x0649}, {0x05ea, 0x064a}, {0x05eb, 0x064b}, + {0x05ec, 0x064c}, {0x05ed, 0x064d}, {0x05ee, 0x064e}, + {0x05ef, 0x064f}, {0x05f0, 0x0650}, {0x05f1, 0x0651}, + {0x05f2, 0x0652}, {0x06a1, 0x0452}, {0x06a2, 0x0453}, + {0x06a3, 0x0451}, {0x06a4, 0x0454}, {0x06a5, 0x0455}, + {0x06a6, 0x0456}, {0x06a7, 0x0457}, {0x06a8, 0x0458}, + {0x06a9, 0x0459}, {0x06aa, 0x045a}, {0x06ab, 0x045b}, + {0x06ac, 0x045c}, {0x06ae, 0x045e}, {0x06af, 0x045f}, + {0x06b0, 0x2116}, {0x06b1, 0x0402}, {0x06b2, 0x0403}, + {0x06b3, 0x0401}, {0x06b4, 0x0404}, {0x06b5, 0x0405}, + {0x06b6, 0x0406}, {0x06b7, 0x0407}, {0x06b8, 0x0408}, + {0x06b9, 0x0409}, {0x06ba, 0x040a}, {0x06bb, 0x040b}, + {0x06bc, 0x040c}, {0x06be, 0x040e}, {0x06bf, 0x040f}, + {0x06c0, 0x044e}, {0x06c1, 0x0430}, {0x06c2, 0x0431}, + {0x06c3, 0x0446}, {0x06c4, 0x0434}, {0x06c5, 0x0435}, + {0x06c6, 0x0444}, {0x06c7, 0x0433}, {0x06c8, 0x0445}, + {0x06c9, 0x0438}, {0x06ca, 0x0439}, {0x06cb, 0x043a}, + {0x06cc, 0x043b}, {0x06cd, 0x043c}, {0x06ce, 0x043d}, + {0x06cf, 0x043e}, {0x06d0, 0x043f}, {0x06d1, 0x044f}, + {0x06d2, 0x0440}, {0x06d3, 0x0441}, {0x06d4, 0x0442}, + {0x06d5, 0x0443}, {0x06d6, 0x0436}, {0x06d7, 0x0432}, + {0x06d8, 0x044c}, {0x06d9, 0x044b}, {0x06da, 0x0437}, + {0x06db, 0x0448}, {0x06dc, 0x044d}, {0x06dd, 0x0449}, + {0x06de, 0x0447}, {0x06df, 0x044a}, {0x06e0, 0x042e}, + {0x06e1, 0x0410}, {0x06e2, 0x0411}, {0x06e3, 0x0426}, + {0x06e4, 0x0414}, {0x06e5, 0x0415}, {0x06e6, 0x0424}, + {0x06e7, 0x0413}, {0x06e8, 0x0425}, {0x06e9, 0x0418}, + {0x06ea, 0x0419}, {0x06eb, 0x041a}, {0x06ec, 0x041b}, + {0x06ed, 0x041c}, {0x06ee, 0x041d}, {0x06ef, 0x041e}, + {0x06f0, 0x041f}, {0x06f1, 0x042f}, {0x06f2, 0x0420}, + {0x06f3, 0x0421}, {0x06f4, 0x0422}, {0x06f5, 0x0423}, + {0x06f6, 0x0416}, {0x06f7, 0x0412}, {0x06f8, 0x042c}, + {0x06f9, 0x042b}, {0x06fa, 0x0417}, {0x06fb, 0x0428}, + {0x06fc, 0x042d}, {0x06fd, 0x0429}, {0x06fe, 0x0427}, + {0x06ff, 0x042a}, {0x07a1, 0x0386}, {0x07a2, 0x0388}, + {0x07a3, 0x0389}, {0x07a4, 0x038a}, {0x07a5, 0x03aa}, + {0x07a7, 0x038c}, {0x07a8, 0x038e}, {0x07a9, 0x03ab}, + {0x07ab, 0x038f}, {0x07ae, 0x0385}, {0x07af, 0x2015}, + {0x07b1, 0x03ac}, {0x07b2, 0x03ad}, {0x07b3, 0x03ae}, + {0x07b4, 0x03af}, {0x07b5, 0x03ca}, {0x07b6, 0x0390}, + {0x07b7, 0x03cc}, {0x07b8, 0x03cd}, {0x07b9, 0x03cb}, + {0x07ba, 0x03b0}, {0x07bb, 0x03ce}, {0x07c1, 0x0391}, + {0x07c2, 0x0392}, {0x07c3, 0x0393}, {0x07c4, 0x0394}, + {0x07c5, 0x0395}, {0x07c6, 0x0396}, {0x07c7, 0x0397}, + {0x07c8, 0x0398}, {0x07c9, 0x0399}, {0x07ca, 0x039a}, + {0x07cb, 0x039b}, {0x07cb, 0x039b}, {0x07cc, 0x039c}, + {0x07cd, 0x039d}, {0x07ce, 0x039e}, {0x07cf, 0x039f}, + {0x07d0, 0x03a0}, {0x07d1, 0x03a1}, {0x07d2, 0x03a3}, + {0x07d4, 0x03a4}, {0x07d5, 0x03a5}, {0x07d6, 0x03a6}, + {0x07d7, 0x03a7}, {0x07d8, 0x03a8}, {0x07d9, 0x03a9}, + {0x07e1, 0x03b1}, {0x07e2, 0x03b2}, {0x07e3, 0x03b3}, + {0x07e4, 0x03b4}, {0x07e5, 0x03b5}, {0x07e6, 0x03b6}, + {0x07e7, 0x03b7}, {0x07e8, 0x03b8}, {0x07e9, 0x03b9}, + {0x07ea, 0x03ba}, {0x07eb, 0x03bb}, {0x07ec, 0x03bc}, + {0x07ed, 0x03bd}, {0x07ee, 0x03be}, {0x07ef, 0x03bf}, + {0x07f0, 0x03c0}, {0x07f1, 0x03c1}, {0x07f2, 0x03c3}, + {0x07f3, 0x03c2}, {0x07f4, 0x03c4}, {0x07f5, 0x03c5}, + {0x07f6, 0x03c6}, {0x07f7, 0x03c7}, {0x07f8, 0x03c8}, + {0x07f9, 0x03c9}, {0x08a1, 0x23b7}, {0x08a2, 0x250c}, + {0x08a3, 0x2500}, {0x08a4, 0x2320}, {0x08a5, 0x2321}, + {0x08a6, 0x2502}, {0x08a7, 0x23a1}, {0x08a8, 0x23a3}, + {0x08a9, 0x23a4}, {0x08aa, 0x23a6}, {0x08ab, 0x239b}, + {0x08ac, 0x239d}, {0x08ad, 0x239e}, {0x08ae, 0x23a0}, + {0x08af, 0x23a8}, {0x08b0, 0x23ac}, {0x08b1, 0x0000}, + {0x08b2, 0x0000}, {0x08b3, 0x0000}, {0x08b4, 0x0000}, + {0x08b5, 0x0000}, {0x08b6, 0x0000}, {0x08b7, 0x0000}, + {0x08bc, 0x2264}, {0x08bd, 0x2260}, {0x08be, 0x2265}, + {0x08bf, 0x222b}, {0x08c0, 0x2234}, {0x08c1, 0x221d}, + {0x08c2, 0x221e}, {0x08c5, 0x2207}, {0x08c8, 0x223c}, + {0x08c9, 0x2243}, {0x08cd, 0x21d4}, {0x08ce, 0x21d2}, + {0x08cf, 0x2261}, {0x08d6, 0x221a}, {0x08da, 0x2282}, + {0x08db, 0x2283}, {0x08dc, 0x2229}, {0x08dd, 0x222a}, + {0x08de, 0x2227}, {0x08df, 0x2228}, {0x08ef, 0x2202}, + {0x08f6, 0x0192}, {0x08fb, 0x2190}, {0x08fc, 0x2191}, + {0x08fd, 0x2192}, {0x08fe, 0x2193}, {0x09df, 0x0000}, + {0x09e0, 0x25c6}, {0x09e1, 0x2592}, {0x09e2, 0x2409}, + {0x09e3, 0x240c}, {0x09e4, 0x240d}, {0x09e5, 0x240a}, + {0x09e8, 0x2424}, {0x09e9, 0x240b}, {0x09ea, 0x2518}, + {0x09eb, 0x2510}, {0x09ec, 0x250c}, {0x09ed, 0x2514}, + {0x09ee, 0x253c}, {0x09ef, 0x23ba}, {0x09f0, 0x23bb}, + {0x09f1, 0x2500}, {0x09f2, 0x23bc}, {0x09f3, 0x23bd}, + {0x09f4, 0x251c}, {0x09f5, 0x2524}, {0x09f6, 0x2534}, + {0x09f7, 0x252c}, {0x09f8, 0x2502}, {0x0aa1, 0x2003}, + {0x0aa2, 0x2002}, {0x0aa3, 0x2004}, {0x0aa4, 0x2005}, + {0x0aa5, 0x2007}, {0x0aa6, 0x2008}, {0x0aa7, 0x2009}, + {0x0aa8, 0x200a}, {0x0aa9, 0x2014}, {0x0aaa, 0x2013}, + {0x0aac, 0x2423}, {0x0aae, 0x2026}, {0x0aaf, 0x2025}, + {0x0ab0, 0x2153}, {0x0ab1, 0x2154}, {0x0ab2, 0x2155}, + {0x0ab3, 0x2156}, {0x0ab4, 0x2157}, {0x0ab5, 0x2158}, + {0x0ab6, 0x2159}, {0x0ab7, 0x215a}, {0x0ab8, 0x2105}, + {0x0abb, 0x2012}, {0x0abc, 0x27e8}, {0x0abd, 0x002e}, + {0x0abe, 0x27e9}, {0x0abf, 0x0000}, {0x0ac3, 0x215b}, + {0x0ac4, 0x215c}, {0x0ac5, 0x215d}, {0x0ac6, 0x215e}, + {0x0ac9, 0x2122}, {0x0aca, 0x2613}, {0x0acb, 0x0000}, + {0x0acc, 0x25c1}, {0x0acd, 0x25b7}, {0x0ace, 0x25cb}, + {0x0acf, 0x25af}, {0x0ad0, 0x2018}, {0x0ad1, 0x2019}, + {0x0ad2, 0x201c}, {0x0ad3, 0x201d}, {0x0ad4, 0x211e}, + {0x0ad6, 0x2032}, {0x0ad7, 0x2033}, {0x0ad9, 0x271d}, + {0x0ada, 0x0000}, {0x0adb, 0x25ac}, {0x0adc, 0x25c0}, + {0x0add, 0x25b6}, {0x0ade, 0x25cf}, {0x0adf, 0x25ae}, + {0x0ae0, 0x25e6}, {0x0ae1, 0x25ab}, {0x0ae2, 0x25ad}, + {0x0ae3, 0x25b3}, {0x0ae4, 0x25bd}, {0x0ae5, 0x2606}, + {0x0ae6, 0x2022}, {0x0ae7, 0x25aa}, {0x0ae8, 0x25b2}, + {0x0ae9, 0x25bc}, {0x0aea, 0x261c}, {0x0aeb, 0x261e}, + {0x0aec, 0x2663}, {0x0aed, 0x2666}, {0x0aee, 0x2665}, + {0x0af0, 0x2720}, {0x0af1, 0x2020}, {0x0af2, 0x2021}, + {0x0af3, 0x2713}, {0x0af4, 0x2717}, {0x0af5, 0x266f}, + {0x0af6, 0x266d}, {0x0af7, 0x2642}, {0x0af8, 0x2640}, + {0x0af9, 0x260e}, {0x0afa, 0x2315}, {0x0afb, 0x2117}, + {0x0afc, 0x2038}, {0x0afd, 0x201a}, {0x0afe, 0x201e}, + {0x0aff, 0x0000}, {0x0ba3, 0x003c}, {0x0ba6, 0x003e}, + {0x0ba8, 0x2228}, {0x0ba9, 0x2227}, {0x0bc0, 0x00af}, + {0x0bc2, 0x22a5}, {0x0bc3, 0x2229}, {0x0bc4, 0x230a}, + {0x0bc6, 0x005f}, {0x0bca, 0x2218}, {0x0bcc, 0x2395}, + {0x0bce, 0x22a4}, {0x0bcf, 0x25cb}, {0x0bd3, 0x2308}, + {0x0bd6, 0x222a}, {0x0bd8, 0x2283}, {0x0bda, 0x2282}, + {0x0bdc, 0x22a2}, {0x0bfc, 0x22a3}, {0x0cdf, 0x2017}, + {0x0ce0, 0x05d0}, {0x0ce1, 0x05d1}, {0x0ce1, 0x05d1}, + {0x0ce2, 0x05d2}, {0x0ce2, 0x05d2}, {0x0ce3, 0x05d3}, + {0x0ce3, 0x05d3}, {0x0ce4, 0x05d4}, {0x0ce5, 0x05d5}, + {0x0ce6, 0x05d6}, {0x0ce6, 0x05d6}, {0x0ce7, 0x05d7}, + {0x0ce7, 0x05d7}, {0x0ce8, 0x05d8}, {0x0ce8, 0x05d8}, + {0x0ce9, 0x05d9}, {0x0cea, 0x05da}, {0x0ceb, 0x05db}, + {0x0cec, 0x05dc}, {0x0ced, 0x05dd}, {0x0cee, 0x05de}, + {0x0cef, 0x05df}, {0x0cf0, 0x05e0}, {0x0cf1, 0x05e1}, + {0x0cf1, 0x05e1}, {0x0cf2, 0x05e2}, {0x0cf3, 0x05e3}, + {0x0cf4, 0x05e4}, {0x0cf5, 0x05e5}, {0x0cf5, 0x05e5}, + {0x0cf6, 0x05e6}, {0x0cf6, 0x05e6}, {0x0cf7, 0x05e7}, + {0x0cf7, 0x05e7}, {0x0cf8, 0x05e8}, {0x0cf9, 0x05e9}, + {0x0cfa, 0x05ea}, {0x0cfa, 0x05ea}, {0x0da1, 0x0e01}, + {0x0da2, 0x0e02}, {0x0da3, 0x0e03}, {0x0da4, 0x0e04}, + {0x0da5, 0x0e05}, {0x0da6, 0x0e06}, {0x0da7, 0x0e07}, + {0x0da8, 0x0e08}, {0x0da9, 0x0e09}, {0x0daa, 0x0e0a}, + {0x0dab, 0x0e0b}, {0x0dac, 0x0e0c}, {0x0dad, 0x0e0d}, + {0x0dae, 0x0e0e}, {0x0daf, 0x0e0f}, {0x0db0, 0x0e10}, + {0x0db1, 0x0e11}, {0x0db2, 0x0e12}, {0x0db3, 0x0e13}, + {0x0db4, 0x0e14}, {0x0db5, 0x0e15}, {0x0db6, 0x0e16}, + {0x0db7, 0x0e17}, {0x0db8, 0x0e18}, {0x0db9, 0x0e19}, + {0x0dba, 0x0e1a}, {0x0dbb, 0x0e1b}, {0x0dbc, 0x0e1c}, + {0x0dbd, 0x0e1d}, {0x0dbe, 0x0e1e}, {0x0dbf, 0x0e1f}, + {0x0dc0, 0x0e20}, {0x0dc1, 0x0e21}, {0x0dc2, 0x0e22}, + {0x0dc3, 0x0e23}, {0x0dc4, 0x0e24}, {0x0dc5, 0x0e25}, + {0x0dc6, 0x0e26}, {0x0dc7, 0x0e27}, {0x0dc8, 0x0e28}, + {0x0dc9, 0x0e29}, {0x0dca, 0x0e2a}, {0x0dcb, 0x0e2b}, + {0x0dcc, 0x0e2c}, {0x0dcd, 0x0e2d}, {0x0dce, 0x0e2e}, + {0x0dcf, 0x0e2f}, {0x0dd0, 0x0e30}, {0x0dd1, 0x0e31}, + {0x0dd2, 0x0e32}, {0x0dd3, 0x0e33}, {0x0dd4, 0x0e34}, + {0x0dd5, 0x0e35}, {0x0dd6, 0x0e36}, {0x0dd7, 0x0e37}, + {0x0dd8, 0x0e38}, {0x0dd9, 0x0e39}, {0x0dda, 0x0e3a}, + {0x0dde, 0x0000}, {0x0ddf, 0x0e3f}, {0x0de0, 0x0e40}, + {0x0de1, 0x0e41}, {0x0de2, 0x0e42}, {0x0de3, 0x0e43}, + {0x0de4, 0x0e44}, {0x0de5, 0x0e45}, {0x0de6, 0x0e46}, + {0x0de7, 0x0e47}, {0x0de8, 0x0e48}, {0x0de9, 0x0e49}, + {0x0dea, 0x0e4a}, {0x0deb, 0x0e4b}, {0x0dec, 0x0e4c}, + {0x0ded, 0x0e4d}, {0x0df0, 0x0e50}, {0x0df1, 0x0e51}, + {0x0df2, 0x0e52}, {0x0df3, 0x0e53}, {0x0df4, 0x0e54}, + {0x0df5, 0x0e55}, {0x0df6, 0x0e56}, {0x0df7, 0x0e57}, + {0x0df8, 0x0e58}, {0x0df9, 0x0e59}, {0x0ea1, 0x3131}, + {0x0ea2, 0x3132}, {0x0ea3, 0x3133}, {0x0ea4, 0x3134}, + {0x0ea5, 0x3135}, {0x0ea6, 0x3136}, {0x0ea7, 0x3137}, + {0x0ea8, 0x3138}, {0x0ea9, 0x3139}, {0x0eaa, 0x313a}, + {0x0eab, 0x313b}, {0x0eac, 0x313c}, {0x0ead, 0x313d}, + {0x0eae, 0x313e}, {0x0eaf, 0x313f}, {0x0eb0, 0x3140}, + {0x0eb1, 0x3141}, {0x0eb2, 0x3142}, {0x0eb3, 0x3143}, + {0x0eb4, 0x3144}, {0x0eb5, 0x3145}, {0x0eb6, 0x3146}, + {0x0eb7, 0x3147}, {0x0eb8, 0x3148}, {0x0eb9, 0x3149}, + {0x0eba, 0x314a}, {0x0ebb, 0x314b}, {0x0ebc, 0x314c}, + {0x0ebd, 0x314d}, {0x0ebe, 0x314e}, {0x0ebf, 0x314f}, + {0x0ec0, 0x3150}, {0x0ec1, 0x3151}, {0x0ec2, 0x3152}, + {0x0ec3, 0x3153}, {0x0ec4, 0x3154}, {0x0ec5, 0x3155}, + {0x0ec6, 0x3156}, {0x0ec7, 0x3157}, {0x0ec8, 0x3158}, + {0x0ec9, 0x3159}, {0x0eca, 0x315a}, {0x0ecb, 0x315b}, + {0x0ecc, 0x315c}, {0x0ecd, 0x315d}, {0x0ece, 0x315e}, + {0x0ecf, 0x315f}, {0x0ed0, 0x3160}, {0x0ed1, 0x3161}, + {0x0ed2, 0x3162}, {0x0ed3, 0x3163}, {0x0ed4, 0x11a8}, + {0x0ed5, 0x11a9}, {0x0ed6, 0x11aa}, {0x0ed7, 0x11ab}, + {0x0ed8, 0x11ac}, {0x0ed9, 0x11ad}, {0x0eda, 0x11ae}, + {0x0edb, 0x11af}, {0x0edc, 0x11b0}, {0x0edd, 0x11b1}, + {0x0ede, 0x11b2}, {0x0edf, 0x11b3}, {0x0ee0, 0x11b4}, + {0x0ee1, 0x11b5}, {0x0ee2, 0x11b6}, {0x0ee3, 0x11b7}, + {0x0ee4, 0x11b8}, {0x0ee5, 0x11b9}, {0x0ee6, 0x11ba}, + {0x0ee7, 0x11bb}, {0x0ee8, 0x11bc}, {0x0ee9, 0x11bd}, + {0x0eea, 0x11be}, {0x0eeb, 0x11bf}, {0x0eec, 0x11c0}, + {0x0eed, 0x11c1}, {0x0eee, 0x11c2}, {0x0eef, 0x316d}, + {0x0ef0, 0x3171}, {0x0ef1, 0x3178}, {0x0ef2, 0x317f}, + {0x0ef3, 0x3181}, {0x0ef4, 0x3184}, {0x0ef5, 0x3186}, + {0x0ef6, 0x318d}, {0x0ef7, 0x318e}, {0x0ef8, 0x11eb}, + {0x0ef9, 0x11f0}, {0x0efa, 0x11f9}, {0x0eff, 0x20a9}, + {0x13bc, 0x0152}, {0x13bd, 0x0153}, {0x13be, 0x0178}, + {0x20a0, 0x20a0}, {0x20a1, 0x20a1}, {0x20a2, 0x20a2}, + {0x20a3, 0x20a3}, {0x20a4, 0x20a4}, {0x20a5, 0x20a5}, + {0x20a6, 0x20a6}, {0x20a7, 0x20a7}, {0x20a8, 0x20a8}, + {0x20a9, 0x20a9}, {0x20aa, 0x20aa}, {0x20ab, 0x20ab}, + {0x20ac, 0x20ac}, {0xfd01, 0x0000}, {0xfd02, 0x0000}, + {0xfd03, 0x0000}, {0xfd04, 0x0000}, {0xfd05, 0x0000}, + {0xfd06, 0x0000}, {0xfd07, 0x0000}, {0xfd08, 0x0000}, + {0xfd09, 0x0000}, {0xfd0a, 0x0000}, {0xfd0b, 0x0000}, + {0xfd0c, 0x0000}, {0xfd0d, 0x0000}, {0xfd0e, 0x0000}, + {0xfd0f, 0x0000}, {0xfd10, 0x0000}, {0xfd11, 0x0000}, + {0xfd12, 0x0000}, {0xfd13, 0x0000}, {0xfd14, 0x0000}, + {0xfd15, 0x0000}, {0xfd16, 0x0000}, {0xfd17, 0x0000}, + {0xfd18, 0x0000}, {0xfd19, 0x0000}, {0xfd1a, 0x0000}, + {0xfd1b, 0x0000}, {0xfd1c, 0x0000}, {0xfd1d, 0x0000}, + {0xfd1e, 0x0000}, {0xfe01, 0x0000}, {0xfe02, 0x0000}, + {0xfe03, 0x0000}, {0xfe04, 0x0000}, {0xfe05, 0x0000}, + {0xfe06, 0x0000}, {0xfe07, 0x0000}, {0xfe08, 0x0000}, + {0xfe09, 0x0000}, {0xfe0a, 0x0000}, {0xfe0b, 0x0000}, + {0xfe0c, 0x0000}, {0xfe0d, 0x0000}, {0xfe0e, 0x0000}, + {0xfe0f, 0x0000}, {0xfe20, 0x0000}, {0xfe21, 0x0000}, + {0xfe22, 0x0000}, {0xfe23, 0x0000}, {0xfe24, 0x0000}, + {0xfe25, 0x0000}, {0xfe26, 0x0000}, {0xfe27, 0x0000}, + {0xfe28, 0x0000}, {0xfe29, 0x0000}, {0xfe2a, 0x0000}, + {0xfe2b, 0x0000}, {0xfe2c, 0x0000}, {0xfe2d, 0x0000}, + {0xfe2e, 0x0000}, {0xfe2f, 0x0000}, {0xfe30, 0x0000}, + {0xfe31, 0x0000}, {0xfe32, 0x0000}, {0xfe33, 0x0000}, + {0xfe34, 0x0000}, {0xfe50, 0x0300}, {0xfe51, 0x0301}, + {0xfe52, 0x0302}, {0xfe53, 0x0303}, {0xfe54, 0x0304}, + {0xfe55, 0x0306}, {0xfe56, 0x0307}, {0xfe57, 0x0308}, + {0xfe58, 0x030a}, {0xfe59, 0x030b}, {0xfe5a, 0x030c}, + {0xfe5b, 0x0327}, {0xfe5c, 0x0328}, {0xfe5d, 0x0345}, + {0xfe5e, 0x3099}, {0xfe5f, 0x309a}, {0xfe70, 0x0000}, + {0xfe71, 0x0000}, {0xfe72, 0x0000}, {0xfe73, 0x0000}, + {0xfe74, 0x0000}, {0xfe75, 0x0000}, {0xfe76, 0x0000}, + {0xfe77, 0x0000}, {0xfe78, 0x0000}, {0xfe79, 0x0000}, + {0xfe7a, 0x0000}, {0xfed0, 0x0000}, {0xfed1, 0x0000}, + {0xfed2, 0x0000}, {0xfed4, 0x0000}, {0xfed5, 0x0000}, + {0xfee0, 0x0000}, {0xfee1, 0x0000}, {0xfee2, 0x0000}, + {0xfee3, 0x0000}, {0xfee4, 0x0000}, {0xfee5, 0x0000}, + {0xfee6, 0x0000}, {0xfee7, 0x0000}, {0xfee8, 0x0000}, + {0xfee9, 0x0000}, {0xfeea, 0x0000}, {0xfeeb, 0x0000}, + {0xfeec, 0x0000}, {0xfeed, 0x0000}, {0xfeee, 0x0000}, + {0xfeef, 0x0000}, {0xfef0, 0x0000}, {0xfef1, 0x0000}, + {0xfef2, 0x0000}, {0xfef3, 0x0000}, {0xfef4, 0x0000}, + {0xfef5, 0x0000}, {0xfef6, 0x0000}, {0xfef7, 0x0000}, + {0xfef8, 0x0000}, {0xfef9, 0x0000}, {0xfefa, 0x0000}, + {0xfefb, 0x0000}, {0xfefc, 0x0000}, {0xfefd, 0x0000}, + {0xff08, 0x0008}, {0xff09, 0x0009}, {0xff0a, 0x000a}, + {0xff0b, 0x000b}, {0xff0d, 0x000d}, {0xff13, 0x0013}, + {0xff14, 0x0014}, {0xff15, 0x0015}, {0xff1b, 0x001b}, + {0xff20, 0x0000}, {0xff21, 0x0000}, {0xff22, 0x0000}, + {0xff23, 0x0000}, {0xff24, 0x0000}, {0xff25, 0x0000}, + {0xff26, 0x0000}, {0xff27, 0x0000}, {0xff28, 0x0000}, + {0xff29, 0x0000}, {0xff2a, 0x0000}, {0xff2b, 0x0000}, + {0xff2c, 0x0000}, {0xff2d, 0x0000}, {0xff2e, 0x0000}, + {0xff2f, 0x0000}, {0xff30, 0x0000}, {0xff31, 0x0000}, + {0xff32, 0x0000}, {0xff33, 0x0000}, {0xff34, 0x0000}, + {0xff35, 0x0000}, {0xff36, 0x0000}, {0xff37, 0x0000}, + {0xff38, 0x0000}, {0xff39, 0x0000}, {0xff3a, 0x0000}, + {0xff3b, 0x0000}, {0xff3c, 0x0000}, {0xff3d, 0x0000}, + {0xff3e, 0x0000}, {0xff3f, 0x0000}, {0xff50, 0x0000}, + {0xff51, 0x0000}, {0xff52, 0x0000}, {0xff53, 0x0000}, + {0xff54, 0x0000}, {0xff55, 0x0000}, {0xff56, 0x0000}, + {0xff57, 0x0000}, {0xff58, 0x0000}, {0xff60, 0x0000}, + {0xff61, 0x0000}, {0xff62, 0x0000}, {0xff63, 0x0000}, + {0xff65, 0x0000}, {0xff66, 0x0000}, {0xff67, 0x0000}, + {0xff68, 0x0000}, {0xff69, 0x0000}, {0xff6a, 0x0000}, + {0xff6b, 0x0000}, {0xff7e, 0x0000}, {0xff7f, 0x0000}, + {0xff80, 0x0020}, {0xff89, 0x0009}, {0xff8d, 0x000d}, + {0xff91, 0x0000}, {0xff92, 0x0000}, {0xff93, 0x0000}, + {0xff94, 0x0000}, {0xff95, 0x0000}, {0xff96, 0x0000}, + {0xff97, 0x0000}, {0xff98, 0x0000}, {0xff99, 0x0000}, + {0xff9a, 0x0000}, {0xff9b, 0x0000}, {0xff9c, 0x0000}, + {0xff9d, 0x0000}, {0xff9e, 0x0000}, {0xff9f, 0x0000}, + {0xffaa, 0x002a}, {0xffab, 0x002b}, {0xffac, 0x002c}, + {0xffad, 0x002d}, {0xffae, 0x002e}, {0xffaf, 0x002f}, + {0xffb0, 0x0030}, {0xffb1, 0x0031}, {0xffb2, 0x0032}, + {0xffb3, 0x0033}, {0xffb4, 0x0034}, {0xffb5, 0x0035}, + {0xffb6, 0x0036}, {0xffb7, 0x0037}, {0xffb8, 0x0038}, + {0xffb9, 0x0039}, {0xffbd, 0x003d}, {0xffbe, 0x0000}, + {0xffbf, 0x0000}, {0xffc0, 0x0000}, {0xffc1, 0x0000}, + {0xffc2, 0x0000}, {0xffc3, 0x0000}, {0xffc4, 0x0000}, + {0xffc5, 0x0000}, {0xffc6, 0x0000}, {0xffc7, 0x0000}, + {0xffc8, 0x0000}, {0xffc9, 0x0000}, {0xffca, 0x0000}, + {0xffcb, 0x0000}, {0xffcc, 0x0000}, {0xffcd, 0x0000}, + {0xffce, 0x0000}, {0xffcf, 0x0000}, {0xffd0, 0x0000}, + {0xffd1, 0x0000}, {0xffd2, 0x0000}, {0xffd3, 0x0000}, + {0xffd4, 0x0000}, {0xffd5, 0x0000}, {0xffd6, 0x0000}, + {0xffd7, 0x0000}, {0xffd8, 0x0000}, {0xffd9, 0x0000}, + {0xffda, 0x0000}, {0xffdb, 0x0000}, {0xffdc, 0x0000}, + {0xffdd, 0x0000}, {0xffde, 0x0000}, {0xffdf, 0x0000}, + {0xffe0, 0x0000}, {0xffe1, 0x0000}, {0xffe2, 0x0000}, + {0xffe3, 0x0000}, {0xffe4, 0x0000}, {0xffe5, 0x0000}, + {0xffe6, 0x0000}, {0xffe7, 0x0000}, {0xffe8, 0x0000}, + {0xffe9, 0x0000}, {0xffea, 0x0000}, {0xffeb, 0x0000}, + {0xffec, 0x0000}, {0xffed, 0x0000}, {0xffee, 0x0000}, + {0xffff, 0x0000}, {0xffffff, 0x0000}, {0x06ad, 0x0491}, + {0x06bd, 0x0490}, {0x14a1, 0x0000}, {0x14a2, 0x0587}, + {0x14a3, 0x0589}, {0x14a4, 0x0029}, {0x14a5, 0x0028}, + {0x14a6, 0x00bb}, {0x14a7, 0x00ab}, {0x14a8, 0x2014}, + {0x14a9, 0x002e}, {0x14aa, 0x055d}, {0x14ab, 0x002c}, + {0x14ac, 0x2013}, {0x14ad, 0x058a}, {0x14ae, 0x2026}, + {0x14af, 0x055c}, {0x14b0, 0x055b}, {0x14b1, 0x055e}, + {0x14b2, 0x0531}, {0x14b3, 0x0561}, {0x14b4, 0x0532}, + {0x14b5, 0x0562}, {0x14b6, 0x0533}, {0x14b7, 0x0563}, + {0x14b8, 0x0534}, {0x14b9, 0x0564}, {0x14ba, 0x0535}, + {0x14bb, 0x0565}, {0x14bc, 0x0536}, {0x14bd, 0x0566}, + {0x14be, 0x0537}, {0x14bf, 0x0567}, {0x14c0, 0x0538}, + {0x14c1, 0x0568}, {0x14c2, 0x0539}, {0x14c3, 0x0569}, + {0x14c4, 0x053a}, {0x14c5, 0x056a}, {0x14c6, 0x053b}, + {0x14c7, 0x056b}, {0x14c8, 0x053c}, {0x14c9, 0x056c}, + {0x14ca, 0x053d}, {0x14cb, 0x056d}, {0x14cc, 0x053e}, + {0x14cd, 0x056e}, {0x14ce, 0x053f}, {0x14cf, 0x056f}, + {0x14d0, 0x0540}, {0x14d1, 0x0570}, {0x14d2, 0x0541}, + {0x14d3, 0x0571}, {0x14d4, 0x0542}, {0x14d5, 0x0572}, + {0x14d6, 0x0543}, {0x14d7, 0x0573}, {0x14d8, 0x0544}, + {0x14d9, 0x0574}, {0x14da, 0x0545}, {0x14db, 0x0575}, + {0x14dc, 0x0546}, {0x14dd, 0x0576}, {0x14de, 0x0547}, + {0x14df, 0x0577}, {0x14e0, 0x0548}, {0x14e1, 0x0578}, + {0x14e2, 0x0549}, {0x14e3, 0x0579}, {0x14e4, 0x054a}, + {0x14e5, 0x057a}, {0x14e6, 0x054b}, {0x14e7, 0x057b}, + {0x14e8, 0x054c}, {0x14e9, 0x057c}, {0x14ea, 0x054d}, + {0x14eb, 0x057d}, {0x14ec, 0x054e}, {0x14ed, 0x057e}, + {0x14ee, 0x054f}, {0x14ef, 0x057f}, {0x14f0, 0x0550}, + {0x14f1, 0x0580}, {0x14f2, 0x0551}, {0x14f3, 0x0581}, + {0x14f4, 0x0552}, {0x14f5, 0x0582}, {0x14f6, 0x0553}, + {0x14f7, 0x0583}, {0x14f8, 0x0554}, {0x14f9, 0x0584}, + {0x14fa, 0x0555}, {0x14fb, 0x0585}, {0x14fc, 0x0556}, + {0x14fd, 0x0586}, {0x14fe, 0x055a}, {0x14ff, 0x00a7}, + {0x15d0, 0x10d0}, {0x15d1, 0x10d1}, {0x15d2, 0x10d2}, + {0x15d3, 0x10d3}, {0x15d4, 0x10d4}, {0x15d5, 0x10d5}, + {0x15d6, 0x10d6}, {0x15d7, 0x10d7}, {0x15d8, 0x10d8}, + {0x15d9, 0x10d9}, {0x15da, 0x10da}, {0x15db, 0x10db}, + {0x15dc, 0x10dc}, {0x15dd, 0x10dd}, {0x15de, 0x10de}, + {0x15df, 0x10df}, {0x15e0, 0x10e0}, {0x15e1, 0x10e1}, + {0x15e2, 0x10e2}, {0x15e3, 0x10e3}, {0x15e4, 0x10e4}, + {0x15e5, 0x10e5}, {0x15e6, 0x10e6}, {0x15e7, 0x10e7}, + {0x15e8, 0x10e8}, {0x15e9, 0x10e9}, {0x15ea, 0x10ea}, + {0x15eb, 0x10eb}, {0x15ec, 0x10ec}, {0x15ed, 0x10ed}, + {0x15ee, 0x10ee}, {0x15ef, 0x10ef}, {0x15f0, 0x10f0}, + {0x15f1, 0x10f1}, {0x15f2, 0x10f2}, {0x15f3, 0x10f3}, + {0x15f4, 0x10f4}, {0x15f5, 0x10f5}, {0x15f6, 0x10f6}, + {0x12a1, 0x1e02}, {0x12a2, 0x1e03}, {0x12a6, 0x1e0a}, + {0x12a8, 0x1e80}, {0x12aa, 0x1e82}, {0x12ab, 0x1e0b}, + {0x12ac, 0x1ef2}, {0x12b0, 0x1e1e}, {0x12b1, 0x1e1f}, + {0x12b4, 0x1e40}, {0x12b5, 0x1e41}, {0x12b7, 0x1e56}, + {0x12b8, 0x1e81}, {0x12b9, 0x1e57}, {0x12ba, 0x1e83}, + {0x12bb, 0x1e60}, {0x12bc, 0x1ef3}, {0x12bd, 0x1e84}, + {0x12be, 0x1e85}, {0x12bf, 0x1e61}, {0x12d0, 0x0174}, + {0x12d7, 0x1e6a}, {0x12de, 0x0176}, {0x12f0, 0x0175}, + {0x12f7, 0x1e6b}, {0x12fe, 0x0177}, {0x0590, 0x06f0}, + {0x0591, 0x06f1}, {0x0592, 0x06f2}, {0x0593, 0x06f3}, + {0x0594, 0x06f4}, {0x0595, 0x06f5}, {0x0596, 0x06f6}, + {0x0597, 0x06f7}, {0x0598, 0x06f8}, {0x0599, 0x06f9}, + {0x05a5, 0x066a}, {0x05a6, 0x0670}, {0x05a7, 0x0679}, + {0x05a8, 0x067e}, {0x05a9, 0x0686}, {0x05aa, 0x0688}, + {0x05ab, 0x0691}, {0x05ae, 0x06d4}, {0x05b0, 0x0660}, + {0x05b1, 0x0661}, {0x05b2, 0x0662}, {0x05b3, 0x0663}, + {0x05b4, 0x0664}, {0x05b5, 0x0665}, {0x05b6, 0x0666}, + {0x05b7, 0x0667}, {0x05b8, 0x0668}, {0x05b9, 0x0669}, + {0x05f3, 0x0653}, {0x05f4, 0x0654}, {0x05f5, 0x0655}, + {0x05f6, 0x0698}, {0x05f7, 0x06a4}, {0x05f8, 0x06a9}, + {0x05f9, 0x06af}, {0x05fa, 0x06ba}, {0x05fb, 0x06be}, + {0x05fc, 0x06cc}, {0x05fd, 0x06d2}, {0x05fe, 0x06c1}, + {0x0680, 0x0492}, {0x0681, 0x0496}, {0x0682, 0x049a}, + {0x0683, 0x049c}, {0x0684, 0x04a2}, {0x0685, 0x04ae}, + {0x0686, 0x04b0}, {0x0687, 0x04b2}, {0x0688, 0x04b6}, + {0x0689, 0x04b8}, {0x068a, 0x04ba}, {0x068c, 0x04d8}, + {0x068d, 0x04e2}, {0x068e, 0x04e8}, {0x068f, 0x04ee}, + {0x0690, 0x0493}, {0x0691, 0x0497}, {0x0692, 0x049b}, + {0x0693, 0x049d}, {0x0694, 0x04a3}, {0x0695, 0x04af}, + {0x0696, 0x04b1}, {0x0697, 0x04b3}, {0x0698, 0x04b7}, + {0x0699, 0x04b9}, {0x069a, 0x04bb}, {0x069c, 0x04d9}, + {0x069d, 0x04e3}, {0x069e, 0x04e9}, {0x069f, 0x04ef}, + {0x16a2, 0x0000}, {0x16a3, 0x1e8a}, {0x16a5, 0x0000}, + {0x16a6, 0x012c}, {0x16a7, 0x0000}, {0x16a8, 0x0000}, + {0x16a9, 0x01b5}, {0x16aa, 0x01e6}, {0x16af, 0x019f}, + {0x16b2, 0x0000}, {0x16b3, 0x1e8b}, {0x16b4, 0x0000}, + {0x16b5, 0x0000}, {0x16b6, 0x012d}, {0x16b7, 0x0000}, + {0x16b8, 0x0000}, {0x16b9, 0x01b6}, {0x16ba, 0x01e7}, + {0x16bd, 0x01d2}, {0x16bf, 0x0275}, {0x16c6, 0x018f}, + {0x16f6, 0x0259}, {0x16d1, 0x1e36}, {0x16d2, 0x0000}, + {0x16d3, 0x0000}, {0x16e1, 0x1e37}, {0x16e2, 0x0000}, + {0x16e3, 0x0000}, {0x1ea0, 0x1ea0}, {0x1ea1, 0x1ea1}, + {0x1ea2, 0x1ea2}, {0x1ea3, 0x1ea3}, {0x1ea4, 0x1ea4}, + {0x1ea5, 0x1ea5}, {0x1ea6, 0x1ea6}, {0x1ea7, 0x1ea7}, + {0x1ea8, 0x1ea8}, {0x1ea9, 0x1ea9}, {0x1eaa, 0x1eaa}, + {0x1eab, 0x1eab}, {0x1eac, 0x1eac}, {0x1ead, 0x1ead}, + {0x1eae, 0x1eae}, {0x1eaf, 0x1eaf}, {0x1eb0, 0x1eb0}, + {0x1eb1, 0x1eb1}, {0x1eb2, 0x1eb2}, {0x1eb3, 0x1eb3}, + {0x1eb4, 0x1eb4}, {0x1eb5, 0x1eb5}, {0x1eb6, 0x1eb6}, + {0x1eb7, 0x1eb7}, {0x1eb8, 0x1eb8}, {0x1eb9, 0x1eb9}, + {0x1eba, 0x1eba}, {0x1ebb, 0x1ebb}, {0x1ebc, 0x1ebc}, + {0x1ebd, 0x1ebd}, {0x1ebe, 0x1ebe}, {0x1ebf, 0x1ebf}, + {0x1ec0, 0x1ec0}, {0x1ec1, 0x1ec1}, {0x1ec2, 0x1ec2}, + {0x1ec3, 0x1ec3}, {0x1ec4, 0x1ec4}, {0x1ec5, 0x1ec5}, + {0x1ec6, 0x1ec6}, {0x1ec7, 0x1ec7}, {0x1ec8, 0x1ec8}, + {0x1ec9, 0x1ec9}, {0x1eca, 0x1eca}, {0x1ecb, 0x1ecb}, + {0x1ecc, 0x1ecc}, {0x1ecd, 0x1ecd}, {0x1ece, 0x1ece}, + {0x1ecf, 0x1ecf}, {0x1ed0, 0x1ed0}, {0x1ed1, 0x1ed1}, + {0x1ed2, 0x1ed2}, {0x1ed3, 0x1ed3}, {0x1ed4, 0x1ed4}, + {0x1ed5, 0x1ed5}, {0x1ed6, 0x1ed6}, {0x1ed7, 0x1ed7}, + {0x1ed8, 0x1ed8}, {0x1ed9, 0x1ed9}, {0x1eda, 0x1eda}, + {0x1edb, 0x1edb}, {0x1edc, 0x1edc}, {0x1edd, 0x1edd}, + {0x1ede, 0x1ede}, {0x1edf, 0x1edf}, {0x1ee0, 0x1ee0}, + {0x1ee1, 0x1ee1}, {0x1ee2, 0x1ee2}, {0x1ee3, 0x1ee3}, + {0x1ee4, 0x1ee4}, {0x1ee5, 0x1ee5}, {0x1ee6, 0x1ee6}, + {0x1ee7, 0x1ee7}, {0x1ee8, 0x1ee8}, {0x1ee9, 0x1ee9}, + {0x1eea, 0x1eea}, {0x1eeb, 0x1eeb}, {0x1eec, 0x1eec}, + {0x1eed, 0x1eed}, {0x1eee, 0x1eee}, {0x1eef, 0x1eef}, + {0x1ef0, 0x1ef0}, {0x1ef1, 0x1ef1}, {0x1ef4, 0x1ef4}, + {0x1ef5, 0x1ef5}, {0x1ef6, 0x1ef6}, {0x1ef7, 0x1ef7}, + {0x1ef8, 0x1ef8}, {0x1ef9, 0x1ef9}, {0x1efa, 0x01a0}, + {0x1efb, 0x01a1}, {0x1efc, 0x01af}, {0x1efd, 0x01b0}, + {0x1e9f, 0x0303}, {0x1ef2, 0x0300}, {0x1ef3, 0x0301}, + {0x1efe, 0x0309}, {0x1eff, 0x0323}, {0xfe60, 0x0323}, + {0xfe61, 0x0309}, {0xfe62, 0x031b}, }; static int comparator(const void *a, const void *b) { @@ -429,9 +565,9 @@ uint32_t X11KeySymToUCS(uint32_t x11KeySym) { uint32_t key[2] = {x11KeySym, 0}; const uint32_t *found = (uint32_t *) bsearch( - key, x11KeySymToUCSData, - sizeof(x11KeySymToUCSData) / sizeof(x11KeySymToUCSData[0]), - sizeof(x11KeySymToUCSData[0]), comparator); + key, x11KeySymToUCSData, + sizeof(x11KeySymToUCSData) / sizeof(x11KeySymToUCSData[0]), + sizeof(x11KeySymToUCSData[0]), comparator); if (found) return found[1]; diff --git a/AppKit/X11.backend/X11Pasteboard.h b/AppKit/X11.backend/X11Pasteboard.h index d813274c..411903cc 100644 --- a/AppKit/X11.backend/X11Pasteboard.h +++ b/AppKit/X11.backend/X11Pasteboard.h @@ -29,7 +29,7 @@ along with Darling. If not, see . NSMutableDictionary *_typeToData; NSMutableDictionary> - *_typeToOwner; + *_typeToOwner; NSInteger _changeCount; Atom _receivingProperty; diff --git a/AppKit/X11.backend/X11Pasteboard.m b/AppKit/X11.backend/X11Pasteboard.m index 4c5f824e..0e91a5d1 100644 --- a/AppKit/X11.backend/X11Pasteboard.m +++ b/AppKit/X11.backend/X11Pasteboard.m @@ -55,7 +55,7 @@ static NSMutableDictionary *nameToPboard; -10, 1, 1, 0, 0, 0); XSelectInput(_display, _window, SelectionClear | SelectionRequest | SelectionNotify | - PropertyNotify); + PropertyNotify); [x11Display setWindow: self forID: _window]; @@ -193,10 +193,10 @@ static NSMutableDictionary *nameToPboard; _selectionNotifyResult = WAITING; while (_selectionNotifyResult == WAITING) { [[NSDisplay currentDisplay] - nextEventMatchingMask: NSAnyEventMask - untilDate: [NSDate distantFuture] - inMode: NSDefaultRunLoopMode - dequeue: NO]; + nextEventMatchingMask: NSAnyEventMask + untilDate: [NSDate distantFuture] + inMode: NSDefaultRunLoopMode + dequeue: NO]; } return [self readDataFromReceivingProperty]; @@ -253,7 +253,7 @@ static NSMutableDictionary *nameToPboard; - (NSArray *) types { return [[_typeToData allKeys] - arrayByAddingObjectsFromArray: [_typeToOwner allKeys]]; + arrayByAddingObjectsFromArray: [_typeToOwner allKeys]]; } - (void) selectionNotify: (XSelectionEvent *) event { diff --git a/AppKit/X11.backend/X11SubWindow.m b/AppKit/X11.backend/X11SubWindow.m index b9a7fe18..738ab457 100644 --- a/AppKit/X11.backend/X11SubWindow.m +++ b/AppKit/X11.backend/X11SubWindow.m @@ -20,11 +20,11 @@ _display = [(X11Display *) [NSDisplay currentDisplay] display]; - _window = - XCreateSimpleWindow(_display, [parent windowHandle], frame.origin.x, - frame.origin.y, frame.size.width, frame.size.height, - 0, 0, 0 /* border_width, border, background */ - ); + _window = XCreateSimpleWindow(_display, [parent windowHandle], + frame.origin.x, frame.origin.y, + frame.size.width, frame.size.height, 0, 0, + 0 /* border_width, border, background */ + ); [self show]; return self; diff --git a/AppKit/X11.backend/X11Window.m b/AppKit/X11.backend/X11Window.m index ad72546e..2be9ea02 100644 --- a/AppKit/X11.backend/X11Window.m +++ b/AppKit/X11.backend/X11Window.m @@ -104,15 +104,15 @@ static NSData *makeWindowIcon() { // Render the image in ARGB. O2BitmapContext *context = (O2BitmapContext *) O2BitmapContextCreate( - NULL, width, height, 8, width * 4, colorSpace, - kO2ImageAlphaPremultipliedFirst | kO2BitmapByteOrder32Host); + NULL, width, height, 8, width * 4, colorSpace, + kO2ImageAlphaPremultipliedFirst | kO2BitmapByteOrder32Host); [context drawImage: image inRect: O2RectMake(0, 0, width, height)]; int *imageData = O2BitmapContextGetData(context); // Convert to the format accepted by Xlib. NSMutableData *data = - [NSMutableData dataWithLength: width * height * sizeof(long)]; + [NSMutableData dataWithLength: width * height * sizeof(long)]; long *dataPtr = (long *) [data mutableBytes]; int count = width * height; for (int i = 0; i < count; i++) { @@ -143,9 +143,9 @@ static NSData *makeWindowIcon() { return; XChangeProperty( - _display, _window, XInternAtom(_display, "_NET_WM_ICON", False), - XInternAtom(_display, "CARDINAL", False), 32, PropModeReplace, - [data bytes], [data length] / sizeof(long)); + _display, _window, XInternAtom(_display, "_NET_WM_ICON", False), + XInternAtom(_display, "CARDINAL", False), 32, PropModeReplace, + [data bytes], [data length] / sizeof(long)); } - (instancetype) initWithDelegate: (NSWindow *) delegate { @@ -179,8 +179,8 @@ static NSData *makeWindowIcon() { } Colormap cmap = - XCreateColormap(_display, RootWindow(_display, _visualInfo->screen), - _visualInfo->visual, AllocNone); + XCreateColormap(_display, RootWindow(_display, _visualInfo->screen), + _visualInfo->visual, AllocNone); if (cmap < 0) { NSLog(@"XCreateColormap failed"); @@ -191,17 +191,17 @@ static NSData *makeWindowIcon() { XSetWindowAttributes xattr; unsigned long xattr_mask; xattr.override_redirect = - _styleMask == NSBorderlessWindowMask ? True : False; + _styleMask == NSBorderlessWindowMask ? True : False; xattr_mask = CWOverrideRedirect | CWColormap; xattr.colormap = cmap; _window = XCreateWindow( - _display, DefaultRootWindow(_display), _frame.origin.x, _frame.origin.y, - _frame.size.width, _frame.size.height, 0, - (_visualInfo == NULL) ? CopyFromParent : _visualInfo->depth, - InputOutput, - (_visualInfo == NULL) ? CopyFromParent : _visualInfo->visual, - xattr_mask, &xattr); + _display, DefaultRootWindow(_display), _frame.origin.x, + _frame.origin.y, _frame.size.width, _frame.size.height, 0, + (_visualInfo == NULL) ? CopyFromParent : _visualInfo->depth, + InputOutput, + (_visualInfo == NULL) ? CopyFromParent : _visualInfo->visual, + xattr_mask, &xattr); [self syncDelegateProperties]; @@ -241,7 +241,7 @@ static NSData *makeWindowIcon() { if (isTransient && [NSApp mainWindow]) { X11Window *mainWindow = - (X11Window *) [[NSApp mainWindow] platformWindow]; + (X11Window *) [[NSApp mainWindow] platformWindow]; XSetTransientForHint(_display, _window, [mainWindow windowHandle]); } @@ -272,7 +272,7 @@ static NSData *makeWindowIcon() { - (void) setStyleMaskInternal: (NSUInteger) mask force: (BOOL) force { if (force || (mask & NSWindowStyleMaskResizable) != - (_styleMask & NSWindowStyleMaskResizable)) { + (_styleMask & NSWindowStyleMaskResizable)) { XSizeHints *sh = XAllocSizeHints(); if (mask & NSWindowStyleMaskResizable) { // Make resizable @@ -293,11 +293,11 @@ static NSData *makeWindowIcon() { int states_cnt = 0; if (_isModal) { states[states_cnt++] = - (long) XInternAtom(_display, "_NET_WM_STATE_MODAL", False); + (long) XInternAtom(_display, "_NET_WM_STATE_MODAL", False); } if (mask & NSWindowStyleMaskFullScreen) { - states[states_cnt++] = - (long) XInternAtom(_display, "_NET_WM_STATE_FULLSCREEN", False); + states[states_cnt++] = (long) XInternAtom( + _display, "_NET_WM_STATE_FULLSCREEN", False); } XChangeProperty(_display, _window, XInternAtom(_display, "_NET_WM_STATE", False), XA_ATOM, @@ -312,7 +312,7 @@ static NSData *makeWindowIcon() { event.format = 32; event.data.l[0] = (mask & NSWindowStyleMaskFullScreen) ? 1 : 2; event.data.l[1] = - (long) XInternAtom(_display, "_NET_WM_STATE_FULLSCREEN", False); + (long) XInternAtom(_display, "_NET_WM_STATE_FULLSCREEN", False); event.data.l[3] = 1; XSendEvent(_display, DefaultRootWindow(_display), False, SubstructureNotifyMask | SubstructureRedirectMask, @@ -337,7 +337,7 @@ static NSData *makeWindowIcon() { long input_mode; unsigned long status; } hints = { - 2, 0, 0, 0, 0, + 2, 0, 0, 0, 0, }; XChangeProperty(dpy, w, XInternAtom(dpy, "_MOTIF_WM_HINTS", False), XInternAtom(dpy, "_MOTIF_WM_HINTS", False), 32, @@ -417,15 +417,15 @@ static NSData *makeWindowIcon() { - (O2Context *) createCGContextIfNeeded { if (_context == nil) { O2ColorSpaceRef colorSpace = O2ColorSpaceCreateDeviceRGB(); - O2Surface *surface = - [[O2Surface alloc] initWithBytes: NULL - width: _frame.size.width - height: _frame.size.height - bitsPerComponent: 8 - bytesPerRow: 0 - colorSpace: colorSpace - bitmapInfo: kO2ImageAlphaPremultipliedFirst | - kO2BitmapByteOrder32Little]; + O2Surface *surface = [[O2Surface alloc] + initWithBytes: NULL + width: _frame.size.width + height: _frame.size.height + bitsPerComponent: 8 + bytesPerRow: 0 + colorSpace: colorSpace + bitmapInfo: kO2ImageAlphaPremultipliedFirst | + kO2BitmapByteOrder32Little]; O2ColorSpaceRelease(colorSpace); _context = [[O2Context_builtin_FT alloc] initWithSurface: surface flipped: NO]; @@ -568,19 +568,19 @@ static NSData *makeWindowIcon() { NSLog(@"CGLCreateContext failed at %s %d with error %d", __FILE__, __LINE__, error); - [NSException - raise: NSGenericException - format: @"Failed to create GL context, CGL error %d", error]; + [NSException raise: NSGenericException + format: @"Failed to create GL context, CGL error %d", + error]; } if ((error = CGLContextMakeCurrentAndAttachToWindow( - _cglContext, _cglWindow)) != kCGLNoError) - NSLog( - @"CGLContextMakeCurrentAndAttachToWindow failed with error %d", - error); + _cglContext, _cglWindow)) != kCGLNoError) + NSLog(@"CGLContextMakeCurrentAndAttachToWindow failed with error " + @"%d", + error); } if (_cglContext != nil && _caContext == nil) { _caContext = - [[CAWindowOpenGLContext alloc] initWithCGLContext: _cglContext]; + [[CAWindowOpenGLContext alloc] initWithCGLContext: _cglContext]; } } @@ -683,7 +683,7 @@ static int ignoreBadWindow(Display *display, XErrorEvent *errorEvent) { - (O2Rect) transformFrame: (O2Rect) frame { return NSMakeRect(frame.origin.x, DisplayHeight(_display, DefaultScreen(_display)) - - frame.origin.y - frame.size.height, + frame.origin.y - frame.size.height, fmax(frame.size.width, 1.0), fmax(frame.size.height, 1.0)); } diff --git a/AppKit/_NSManagedProxy.h b/AppKit/_NSManagedProxy.h index 1d05a418..faeb5e8b 100644 --- a/AppKit/_NSManagedProxy.h +++ b/AppKit/_NSManagedProxy.h @@ -61,13 +61,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (id) objectAtIndex: (NSUInteger) index; - (NSUInteger) count; - (void) addObserver: (NSObject *) observer - toObjectsAtIndexes: (NSIndexSet *) indexes - forKeyPath: (NSString *) keyPath - options: (NSKeyValueObservingOptions) options - context: (void *) context; + toObjectsAtIndexes: (NSIndexSet *) indexes + forKeyPath: (NSString *) keyPath + options: (NSKeyValueObservingOptions) options + context: (void *) context; - (void) removeObserver: (NSObject *) observer - fromObjectsAtIndexes: (NSIndexSet *) indexes - forKeyPath: (NSString *) keyPath; + fromObjectsAtIndexes: (NSIndexSet *) indexes + forKeyPath: (NSString *) keyPath; - (void) notifyObserver: (_NSManagedProxy_observerInfo *) observerInfo; - (void) _refresh; - (id) objectValueForTableColumn: (NSTableColumn *) column; diff --git a/AppKit/include/AppKit/NSAccessibilityConstants.h b/AppKit/include/AppKit/NSAccessibilityConstants.h index 6a63f19c..623bbc12 100644 --- a/AppKit/include/AppKit/NSAccessibilityConstants.h +++ b/AppKit/include/AppKit/NSAccessibilityConstants.h @@ -34,20 +34,20 @@ APPKIT_EXPORT NSString *const NSAccessibilitySharedTextUIElementsAttribute; APPKIT_EXPORT NSString *const NSAccessibilityVisibleCharacterRangeAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityAttributedStringForRangeParameterizedAttribute; + *const NSAccessibilityAttributedStringForRangeParameterizedAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityBoundsForRangeParameterizedAttribute; + *const NSAccessibilityBoundsForRangeParameterizedAttribute; APPKIT_EXPORT NSString *const NSAccessibilityLineForIndexParameterizedAttribute; APPKIT_EXPORT NSString *const NSAccessibilityRTFForRangeParameterizedAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityRangeForIndexParameterizedAttribute; + *const NSAccessibilityRangeForIndexParameterizedAttribute; APPKIT_EXPORT NSString *const NSAccessibilityRangeForLineParameterizedAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityRangeForPositionParameterizedAttribute; + *const NSAccessibilityRangeForPositionParameterizedAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityStringForRangeParameterizedAttribute; + *const NSAccessibilityStringForRangeParameterizedAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityStyleRangeForIndexParameterizedAttribute; + *const NSAccessibilityStyleRangeForIndexParameterizedAttribute; APPKIT_EXPORT NSString *const NSAccessibilityAttachmentTextAttribute; APPKIT_EXPORT NSString *const NSAccessibilityBackgroundColorTextAttribute; @@ -118,7 +118,7 @@ APPKIT_EXPORT NSString *const NSAccessibilitySelectedCellsAttribute; APPKIT_EXPORT NSString *const NSAccessibilityVisibleCellsAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityCellForColumnAndRowParameterizedAttribute; + *const NSAccessibilityCellForColumnAndRowParameterizedAttribute; APPKIT_EXPORT NSString *const NSAccessibilityRowIndexRangeAttribute; APPKIT_EXPORT NSString *const NSAccessibilityColumnIndexRangeAttribute; @@ -133,13 +133,13 @@ APPKIT_EXPORT NSString *const NSAccessibilityHorizontalUnitDescriptionAttribute; APPKIT_EXPORT NSString *const NSAccessibilityVerticalUnitDescriptionAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityLayoutPointForScreenPointParameterizedAttribute; + *const NSAccessibilityLayoutPointForScreenPointParameterizedAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityLayoutSizeForScreenSizeParameterizedAttribute; + *const NSAccessibilityLayoutSizeForScreenSizeParameterizedAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityScreenPointForLayoutPointParameterizedAttribute; + *const NSAccessibilityScreenPointForLayoutPointParameterizedAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityScreenSizeForLayoutSizeParameterizedAttribute; + *const NSAccessibilityScreenSizeForLayoutSizeParameterizedAttribute; APPKIT_EXPORT NSString *const NSAccessibilityHandlesAttribute; @@ -177,7 +177,7 @@ APPKIT_EXPORT NSString *const NSAccessibilityUnknownUnitValue; APPKIT_EXPORT NSString *const NSAccessibilityLinkedUIElementsAttribute; APPKIT_EXPORT NSString - *const NSAccessibilityServesAsTitleForUIElementsAttribute; + *const NSAccessibilityServesAsTitleForUIElementsAttribute; APPKIT_EXPORT NSString *const NSAccessibilityTitleUIElementAttribute; APPKIT_EXPORT NSString *const NSAccessibilityDecrementButtonAttribute; @@ -294,7 +294,7 @@ APPKIT_EXPORT NSString *const NSAccessibilityShowMenuAction; APPKIT_EXPORT NSString *const NSAccessibilityMainWindowChangedNotification; APPKIT_EXPORT NSString *const NSAccessibilityFocusedWindowChangedNotification; APPKIT_EXPORT NSString - *const NSAccessibilityFocusedUIElementChangedNotification; + *const NSAccessibilityFocusedUIElementChangedNotification; APPKIT_EXPORT NSString *const NSAccessibilityWindowCreatedNotification; APPKIT_EXPORT NSString *const NSAccessibilityWindowDeminiaturizedNotification; @@ -320,7 +320,7 @@ APPKIT_EXPORT NSString *const NSAccessibilityValueChangedNotification; APPKIT_EXPORT NSString *const NSAccessibilityHelpTagCreatedNotification; APPKIT_EXPORT NSString *const NSAccessibilityRowCountChangedNotification; APPKIT_EXPORT NSString - *const NSAccessibilitySelectedChildrenChangedNotification; + *const NSAccessibilitySelectedChildrenChangedNotification; APPKIT_EXPORT NSString *const NSAccessibilitySelectedColumnsChangedNotification; APPKIT_EXPORT NSString *const NSAccessibilitySelectedRowsChangedNotification; APPKIT_EXPORT NSString *const NSAccessibilitySelectedTextChangedNotification; @@ -338,7 +338,7 @@ APPKIT_EXPORT NSString *const NSAccessibilityEventSourceUserDataKey; APPKIT_EXPORT NSString *const NSAccessibilityEventTimestampKey; APPKIT_EXPORT NSString *const NSAccessibilityMainThreadIdleNotification; APPKIT_EXPORT NSString - *const NSAccessibilitySupportsMainThreadIdleNotificationAttribute; + *const NSAccessibilitySupportsMainThreadIdleNotificationAttribute; /* End undocumented */ APPKIT_EXPORT NSString *const NSAccessibilityErrorCodeExceptionInfo; diff --git a/AppKit/include/AppKit/NSAnimation.h b/AppKit/include/AppKit/NSAnimation.h index 6796b1c0..89a2c421 100644 --- a/AppKit/include/AppKit/NSAnimation.h +++ b/AppKit/include/AppKit/NSAnimation.h @@ -71,7 +71,7 @@ APPKIT_EXPORT NSString *NSAnimationTriggerOrderOut; } - initWithDuration: (NSTimeInterval) duration - animationCurve: (NSAnimationCurve) curve; + animationCurve: (NSAnimationCurve) curve; - (NSTimeInterval) duration; - (NSAnimationCurve) animationCurve; @@ -112,9 +112,9 @@ APPKIT_EXPORT NSString *NSAnimationTriggerOrderOut; @interface NSObject (NSAnimationDelegate) - (BOOL) animationShouldStart: (NSAnimation *) animation; - (float) animation: (NSAnimation *) animation - valueForProgress: (NSAnimationProgress) progress; + valueForProgress: (NSAnimationProgress) progress; - (void) animation: (NSAnimation *) animation - didReachProgressMark: (NSAnimationProgress) progress; + didReachProgressMark: (NSAnimationProgress) progress; - (void) animationDidEnd: (NSAnimation *) animation; - (void) animationDidStop: (NSAnimation *) animation; @end diff --git a/AppKit/include/AppKit/NSAppearance.h b/AppKit/include/AppKit/NSAppearance.h index 403df4c5..830948ae 100644 --- a/AppKit/include/AppKit/NSAppearance.h +++ b/AppKit/include/AppKit/NSAppearance.h @@ -29,9 +29,9 @@ APPKIT_EXPORT NSString *const NSAppearanceNameVibrantLight; APPKIT_EXPORT NSString *const NSAppearanceNameAccessibilityHighContrastAqua; APPKIT_EXPORT NSString *const NSAppearanceNameAccessibilityHighContrastDarkAqua; APPKIT_EXPORT NSString - *const NSAppearanceNameAccessibilityHighContrastVibrantLight; + *const NSAppearanceNameAccessibilityHighContrastVibrantLight; APPKIT_EXPORT NSString - *const NSAppearanceNameAccessibilityHighContrastVibrantDark; + *const NSAppearanceNameAccessibilityHighContrastVibrantDark; APPKIT_EXPORT NSString *const NSAppearanceNameControlStrip; // Undocumented diff --git a/AppKit/include/AppKit/NSApplication.h b/AppKit/include/AppKit/NSApplication.h index 6c305420..bb8cac95 100644 --- a/AppKit/include/AppKit/NSApplication.h +++ b/AppKit/include/AppKit/NSApplication.h @@ -30,15 +30,15 @@ APPKIT_EXPORT const NSRunLoopMode NSModalPanelRunLoopMode; APPKIT_EXPORT const NSRunLoopMode NSEventTrackingRunLoopMode; APPKIT_EXPORT const NSNotificationName - NSApplicationWillFinishLaunchingNotification; + NSApplicationWillFinishLaunchingNotification; APPKIT_EXPORT const NSNotificationName - NSApplicationDidFinishLaunchingNotification; + NSApplicationDidFinishLaunchingNotification; APPKIT_EXPORT const NSNotificationName - NSApplicationWillBecomeActiveNotification; + NSApplicationWillBecomeActiveNotification; APPKIT_EXPORT const NSNotificationName NSApplicationDidBecomeActiveNotification; APPKIT_EXPORT const NSNotificationName - NSApplicationWillResignActiveNotification; + NSApplicationWillResignActiveNotification; APPKIT_EXPORT const NSNotificationName NSApplicationDidResignActiveNotification; APPKIT_EXPORT const NSNotificationName NSApplicationWillUpdateNotification; @@ -52,7 +52,7 @@ APPKIT_EXPORT const NSNotificationName NSApplicationDidUnhideNotification; APPKIT_EXPORT const NSNotificationName NSApplicationWillTerminateNotification; APPKIT_EXPORT const NSNotificationName - NSApplicationDidChangeScreenParametersNotification; + NSApplicationDidChangeScreenParametersNotification; typedef double NSAppKitVersion; APPKIT_EXPORT const NSAppKitVersion NSAppKitVersionNumber; @@ -197,10 +197,10 @@ typedef enum { - (void) abortModal; - (void) beginSheet: (NSWindow *) sheet - modalForWindow: (NSWindow *) window - modalDelegate: (id) modalDelegate - didEndSelector: (SEL) didEndSelector - contextInfo: (void *) contextInfo; + modalForWindow: (NSWindow *) window + modalDelegate: (id) modalDelegate + didEndSelector: (SEL) didEndSelector + contextInfo: (void *) contextInfo; - (void) endSheet: (NSWindow *) sheet returnCode: (NSModalResponse) returnCode; - (void) endSheet: (NSWindow *) sheet; @@ -289,7 +289,7 @@ APPKIT_EXPORT __kindof NSApplication *NSApp; - (void) application: (NSApplication *) application openFiles: (NSArray *) pathArray; - (BOOL) application: (NSApplication *) application - openFileWithoutUI: (NSString *) path; + openFileWithoutUI: (NSString *) path; - (BOOL) application: (NSApplication *) applicationsender openTempFile: (NSString *) path; - (BOOL) applicationShouldHandleReopen: (NSApplication *) application @@ -304,15 +304,15 @@ APPKIT_EXPORT __kindof NSApplication *NSApp; - (NSMenu *) applicationDockMenu: (NSApplication *) application; - (BOOL) application: (NSApplication *) application - delegateHandlesKey: (NSString *) key; + delegateHandlesKey: (NSString *) key; - (NSError *) application: (NSApplication *) application willPresentError: (NSError *) error; - (BOOL) applicationShouldTerminateAfterLastWindowClosed: - (NSApplication *) application; + (NSApplication *) application; - (NSApplicationTerminateReply) applicationShouldTerminate: - (NSApplication *) application; + (NSApplication *) application; @end @@ -348,9 +348,9 @@ APPKIT_EXPORT __kindof NSApplication *NSApp; hasVisibleWindows: (BOOL) flag; - (BOOL) applicationShouldOpenUntitledFile: (NSApplication *) sender; - (NSApplicationTerminateReply) applicationShouldTerminate: - (NSApplication *) sender; + (NSApplication *) sender; - (BOOL) applicationShouldTerminateAfterLastWindowClosed: - (NSApplication *) theApplication; + (NSApplication *) theApplication; - (void) applicationWillBecomeActive: (NSNotification *) aNotification; - (void) applicationWillFinishLaunching: (NSNotification *) aNotification; - (void) applicationWillHide: (NSNotification *) aNotification; diff --git a/AppKit/include/AppKit/NSArrayController.h b/AppKit/include/AppKit/NSArrayController.h index 1c39ebb4..4971727a 100644 --- a/AppKit/include/AppKit/NSArrayController.h +++ b/AppKit/include/AppKit/NSArrayController.h @@ -102,7 +102,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) addObjects: (NSArray *) objects; - (void) insertObject: (id) object atArrangedObjectIndex: (unsigned) index; - (void) insertObjects: (NSArray *) objects - atArrangedObjectIndexes: (NSIndexSet *) indices; + atArrangedObjectIndexes: (NSIndexSet *) indices; - (void) removeObjectAtArrangedObjectIndex: (unsigned) index; - (void) removeObjectsAtArrangedObjectIndexes: (NSIndexSet *) indices; - (void) remove: (id) sender; diff --git a/AppKit/include/AppKit/NSAttributedString.h b/AppKit/include/AppKit/NSAttributedString.h index 093044b0..03a7bd38 100644 --- a/AppKit/include/AppKit/NSAttributedString.h +++ b/AppKit/include/AppKit/NSAttributedString.h @@ -22,7 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSFont, NSColor, NSParagraphStyle, NSTextAttachment, NSFileWrapper, - NSTextList, NSTextBlock, NSTextTable; + NSTextList, NSTextBlock, NSTextTable; APPKIT_EXPORT NSString *const NSFontAttributeName; APPKIT_EXPORT NSString *const NSParagraphStyleAttributeName; @@ -148,38 +148,38 @@ enum { #pragma mark Creating an NSAttributedString + (NSAttributedString *) attributedStringWithAttachment: - (NSTextAttachment *) attachment; + (NSTextAttachment *) attachment; - initWithData: (NSData *) data - options: (NSDictionary *) options - documentAttributes: (NSDictionary **) attributes - error: (NSError **) error; + options: (NSDictionary *) options + documentAttributes: (NSDictionary **) attributes + error: (NSError **) error; - initWithDocFormat: (NSData *) werd - documentAttributes: (NSDictionary **) attributes; + documentAttributes: (NSDictionary **) attributes; - initWithHTML: (NSData *) html - baseURL: (NSURL *) url - documentAttributes: (NSDictionary **) attributes; + baseURL: (NSURL *) url + documentAttributes: (NSDictionary **) attributes; - initWithHTML: (NSData *) html - documentAttributes: (NSDictionary **) attributes; + documentAttributes: (NSDictionary **) attributes; - initWithHTML: (NSData *) html - options: (NSDictionary *) options - documentAttributes: (NSDictionary **) attributes; + options: (NSDictionary *) options + documentAttributes: (NSDictionary **) attributes; - initWithPath: (NSString *) path - documentAttributes: (NSDictionary **) attributes; + documentAttributes: (NSDictionary **) attributes; - initWithRTF: (NSData *) rtf documentAttributes: (NSDictionary **) attributes; - initWithRTFD: (NSData *) rtfd - documentAttributes: (NSDictionary **) attributes; + documentAttributes: (NSDictionary **) attributes; - initWithRTFDFileWrapper: (NSFileWrapper *) wrapper - documentAttributes: (NSDictionary **) attributes; + documentAttributes: (NSDictionary **) attributes; - initWithURL: (NSURL *) url documentAttributes: (NSDictionary **) attributes; - initWithURL: (NSURL *) url - options: (NSDictionary *) options - documentAttributes: (NSDictionary **) attributes - error: (NSError **) error; + options: (NSDictionary *) options + documentAttributes: (NSDictionary **) attributes + error: (NSError **) error; #pragma mark - #pragma mark Retrieving Font Attribute Information @@ -219,7 +219,7 @@ enum { - (NSData *) docFormatFromRange: (NSRange) range documentAttributes: (NSDictionary *) attributes; - (NSData *) RTFFromRange: (NSRange) range - documentAttributes: (NSDictionary *) attributes; + documentAttributes: (NSDictionary *) attributes; - (NSData *) RTFDFromRange: (NSRange) range documentAttributes: (NSDictionary *) attributes; - (NSFileWrapper *) RTFDFileWrapperFromRange: (NSRange) range diff --git a/AppKit/include/AppKit/NSBitmapImageRep.h b/AppKit/include/AppKit/NSBitmapImageRep.h index 5ddf4aaf..e07f6709 100644 --- a/AppKit/include/AppKit/NSBitmapImageRep.h +++ b/AppKit/include/AppKit/NSBitmapImageRep.h @@ -84,7 +84,7 @@ APPKIT_EXPORT NSBitmapImageRepPropertyKey NSImageCurrentFrame; + (NSData *) TIFFRepresentationOfImageRepsInArray: (NSArray *) array; + (NSData *) TIFFRepresentationOfImageRepsInArray: (NSArray *) array usingCompression: - (NSTIFFCompression) compression + (NSTIFFCompression) compression factor: (float) factor; + (NSData *) representationOfImageRepsInArray: (NSArray *) array diff --git a/AppKit/include/AppKit/NSBrowser.h b/AppKit/include/AppKit/NSBrowser.h index e213f4ae..be62d236 100644 --- a/AppKit/include/AppKit/NSBrowser.h +++ b/AppKit/include/AppKit/NSBrowser.h @@ -138,17 +138,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (BOOL) browser: (NSBrowser *) browser isColumnValid: (NSInteger) column; - (NSInteger) browser: (NSBrowser *) browser - numberOfRowsInColumn: (NSInteger) column; + numberOfRowsInColumn: (NSInteger) column; - (void) browser: (NSBrowser *) browser - createRowsForColumn: (NSInteger) column - inMatrix: (NSMatrix *) matrix; + createRowsForColumn: (NSInteger) column + inMatrix: (NSMatrix *) matrix; - (BOOL) browser: (NSBrowser *) browser - selectRow: (NSInteger) row - inColumn: (NSInteger) column; + selectRow: (NSInteger) row + inColumn: (NSInteger) column; - (BOOL) browser: (NSBrowser *) browser - selectCellWithString: (NSString *) title - inColumn: (NSInteger) column; + selectCellWithString: (NSString *) title + inColumn: (NSInteger) column; - (NSString *) browser: (NSBrowser *) browser titleOfColumn: (NSInteger) column; @@ -156,8 +156,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) browserDidScroll: (NSBrowser *) browser; - (void) browser: (NSBrowser *) browser - willDisplayCell: cell - atRow: (NSInteger) row - column: (NSInteger) column; + willDisplayCell: cell + atRow: (NSInteger) row + column: (NSInteger) column; @end diff --git a/AppKit/include/AppKit/NSCachedImageRep.h b/AppKit/include/AppKit/NSCachedImageRep.h index 3323bbd2..fe5c12a5 100644 --- a/AppKit/include/AppKit/NSCachedImageRep.h +++ b/AppKit/include/AppKit/NSCachedImageRep.h @@ -27,9 +27,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithWindow: (NSWindow *) window rect: (NSRect) rect; - initWithSize: (NSSize) size - depth: (NSWindowDepth) windowDepth - separate: (BOOL) separateWindow - alpha: (BOOL) hasAlpha; + depth: (NSWindowDepth) windowDepth + separate: (BOOL) separateWindow + alpha: (BOOL) hasAlpha; - (NSWindow *) window; - (NSRect) rect; diff --git a/AppKit/include/AppKit/NSCell.h b/AppKit/include/AppKit/NSCell.h index f5de1f28..5bc5e99b 100644 --- a/AppKit/include/AppKit/NSCell.h +++ b/AppKit/include/AppKit/NSCell.h @@ -263,9 +263,9 @@ enum { inView: (NSView *) view mouseIsUp: (BOOL) flag; - (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) frame - ofView: (NSView *) view - untilMouseUp: (BOOL) flag; + inRect: (NSRect) frame + ofView: (NSView *) view + untilMouseUp: (BOOL) flag; - (NSText *) setUpFieldEditorAttributes: (NSText *) editor; diff --git a/AppKit/include/AppKit/NSCollectionViewLayout.h b/AppKit/include/AppKit/NSCollectionViewLayout.h index 3b2160a6..c42d696f 100644 --- a/AppKit/include/AppKit/NSCollectionViewLayout.h +++ b/AppKit/include/AppKit/NSCollectionViewLayout.h @@ -24,4 +24,4 @@ typedef NSString *NSCollectionViewDecorationElementKind; APPKIT_EXPORT NSCollectionViewSupplementaryElementKind const - NSCollectionElementKindInterItemGapIndicator; + NSCollectionElementKindInterItemGapIndicator; diff --git a/AppKit/include/AppKit/NSColor.h b/AppKit/include/AppKit/NSColor.h index 994be010..8759caac 100644 --- a/AppKit/include/AppKit/NSColor.h +++ b/AppKit/include/AppKit/NSColor.h @@ -133,9 +133,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ blue: (CGFloat *) blue alpha: (CGFloat *) alpha; - (void) getHue: (CGFloat *) hue - saturation: (CGFloat *) saturation - brightness: (CGFloat *) brightness - alpha: (CGFloat *) alpha; + saturation: (CGFloat *) saturation + brightness: (CGFloat *) brightness + alpha: (CGFloat *) alpha; - (void) getCyan: (CGFloat *) cyan magenta: (CGFloat *) magenta yellow: (CGFloat *) yellow diff --git a/AppKit/include/AppKit/NSColorPanel.h b/AppKit/include/AppKit/NSColorPanel.h index 785195cb..1b347dcd 100644 --- a/AppKit/include/AppKit/NSColorPanel.h +++ b/AppKit/include/AppKit/NSColorPanel.h @@ -21,7 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSButton, NSColorWell, NSMatrix, NSView, NSColorList, NSSplitView, - NSTextField, NSSlider; + NSTextField, NSSlider; enum { NSColorPanelGrayModeMask = (1 << 0), diff --git a/AppKit/include/AppKit/NSControl.h b/AppKit/include/AppKit/NSControl.h index df65d12a..43bdc92d 100644 --- a/AppKit/include/AppKit/NSControl.h +++ b/AppKit/include/AppKit/NSControl.h @@ -134,17 +134,17 @@ APPKIT_EXPORT const NSNotificationName NSControlTextDidEndEditingNotification; @protocol NSControlTextEditingDelegate @optional - (BOOL) control: (NSControl *) control - textView: (NSTextView *) textView - doCommandBySelector: (SEL) selector; + textView: (NSTextView *) textView + doCommandBySelector: (SEL) selector; - (BOOL) control: (NSControl *) control - textShouldBeginEditing: (NSText *) fieldEditor; + textShouldBeginEditing: (NSText *) fieldEditor; - (BOOL) control: (NSControl *) control - textShouldEndEditing: (NSText *) fieldEditor; + textShouldEndEditing: (NSText *) fieldEditor; - (BOOL) control: (NSControl *) control - didFailToFormatString: (NSString *) string - errorDescription: (NSString *) error; + didFailToFormatString: (NSString *) string + errorDescription: (NSString *) error; - (void) control: (NSControl *) control - didFailToValidatePartialString: (NSString *) string - errorDescription: (NSString *) error; + didFailToValidatePartialString: (NSString *) string + errorDescription: (NSString *) error; - (BOOL) control: (NSControl *) control isValidObject: (id) obj; @end diff --git a/AppKit/include/AppKit/NSCursor.h b/AppKit/include/AppKit/NSCursor.h index bfd10172..cb5bb988 100644 --- a/AppKit/include/AppKit/NSCursor.h +++ b/AppKit/include/AppKit/NSCursor.h @@ -58,9 +58,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (void) setHiddenUntilMouseMoves: (BOOL) flag; - initWithImage: (NSImage *) image - foregroundColorHint: (NSColor *) foregroundHint - backgroundColorHint: (NSColor *) backgroundHint - hotSpot: (NSPoint) hotSpot; + foregroundColorHint: (NSColor *) foregroundHint + backgroundColorHint: (NSColor *) backgroundHint + hotSpot: (NSPoint) hotSpot; - initWithImage: (NSImage *) image hotSpot: (NSPoint) hotSpot; - (NSImage *) image; diff --git a/AppKit/include/AppKit/NSDatePickerCell.h b/AppKit/include/AppKit/NSDatePickerCell.h index e04f4a60..5de2451b 100644 --- a/AppKit/include/AppKit/NSDatePickerCell.h +++ b/AppKit/include/AppKit/NSDatePickerCell.h @@ -103,6 +103,6 @@ typedef NSUInteger NSDatePickerStyle; @interface NSObject (NSDatePickerCellDelegate) - (void) datePickerCell: (NSDatePickerCell *) datePickerCell - validateProposedDateValue: (NSDate **) dateValue - timeInterval: (NSTimeInterval *) timeInterval; + validateProposedDateValue: (NSDate **) dateValue + timeInterval: (NSTimeInterval *) timeInterval; @end diff --git a/AppKit/include/AppKit/NSDisplay.h b/AppKit/include/AppKit/NSDisplay.h index 01dcd3e3..65c33c7e 100644 --- a/AppKit/include/AppKit/NSDisplay.h +++ b/AppKit/include/AppKit/NSDisplay.h @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSColor, NSDraggingManager, NSPrintInfo, NSView, NSSavePanel, - NSOpenPanel, NSFontTypeface, CGWindow; + NSOpenPanel, NSFontTypeface, CGWindow; @interface NSDisplay : NSObject { NSMutableArray *_eventQueue; @@ -76,22 +76,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (int) runModalPageLayoutWithPrintInfo: (NSPrintInfo *) printInfo; - (int) runModalPrintPanelWithPrintInfoDictionary: - (NSMutableDictionary *) attributes; + (NSMutableDictionary *) attributes; - (CGContextRef) graphicsPortForPrintOperationWithView: (NSView *) view printInfo: - (NSPrintInfo *) printInfo + (NSPrintInfo *) printInfo pageRange: (NSRange) pageRange; - (BOOL) implementsCustomPanelForClass: (Class) panelClass; - (int) savePanel: (NSSavePanel *) savePanel - runModalForDirectory: (NSString *) directory - file: (NSString *) file; + runModalForDirectory: (NSString *) directory + file: (NSString *) file; - (int) openPanel: (NSOpenPanel *) openPanel - runModalForDirectory: (NSString *) directory - file: (NSString *) file - types: (NSArray *) types; + runModalForDirectory: (NSString *) directory + file: (NSString *) file + types: (NSArray *) types; - (NSPoint) mouseLocation; - (NSUInteger) currentModifierFlags; @@ -99,9 +99,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSArray *) orderedWindowNumbers; - (CGRect) insetRect: (CGRect) frame - forNativeWindowBorderWithStyle: (NSUInteger) styleMask; + forNativeWindowBorderWithStyle: (NSUInteger) styleMask; - (CGRect) outsetRect: (CGRect) frame - forNativeWindowBorderWithStyle: (NSUInteger) styleMask; + forNativeWindowBorderWithStyle: (NSUInteger) styleMask; - (NSArray *) modesForScreen: (int) screenIndex; - (NSDictionary *) currentModeForScreen: (int) screenIndex; diff --git a/AppKit/include/AppKit/NSDocument.h b/AppKit/include/AppKit/NSDocument.h index b9fabec4..62d760d7 100644 --- a/AppKit/include/AppKit/NSDocument.h +++ b/AppKit/include/AppKit/NSDocument.h @@ -21,7 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSWindow, NSWindowController, NSSavePanel, NSMenuItem, NSFileWrapper, - NSPrintOperation, NSPrintInfo, NSPageLayout, NSView; + NSPrintOperation, NSPrintInfo, NSPageLayout, NSView; typedef enum { NSChangeDone, @@ -64,9 +64,9 @@ typedef enum { ofType: (NSString *) type error: (NSError **) error; - initForURL: (NSURL *) url - withContentsOfURL: (NSURL *) contentsURL - ofType: (NSString *) type - error: (NSError **) error; + withContentsOfURL: (NSURL *) contentsURL + ofType: (NSString *) type + error: (NSError **) error; - (NSURL *) autosavedContentsFileURL; - (NSDate *) fileModificationDate; @@ -127,10 +127,10 @@ typedef enum { ofType: (NSString *) type error: (NSError **) error; - (BOOL) writeToURL: (NSURL *) url - ofType: (NSString *) type - forSaveOperation: (NSSaveOperationType) operation - originalContentsURL: (NSURL *) contentsURL - error: (NSError **) error; + ofType: (NSString *) type + forSaveOperation: (NSSaveOperationType) operation + originalContentsURL: (NSURL *) contentsURL + error: (NSError **) error; - (BOOL) writeSafelyToURL: (NSURL *) url ofType: (NSString *) type forSaveOperation: (NSSaveOperationType) operation @@ -150,10 +150,10 @@ typedef enum { - (NSError *) willPresentError: (NSError *) error; - (BOOL) presentError: (NSError *) error; - (void) presentError: (NSError *) error - modalForWindow: (NSWindow *) window - delegate: delegate - didPresentSelector: (SEL) selector - contextInfo: (void *) info; + modalForWindow: (NSWindow *) window + delegate: delegate + didPresentSelector: (SEL) selector + contextInfo: (void *) info; - (NSArray *) writableTypesForSaveOperation: (NSSaveOperationType) operation; - (BOOL) shouldRunSavePanelWithAccessoryView; @@ -168,15 +168,15 @@ typedef enum { didSaveSelector: (SEL) selector contextInfo: (void *) info; - (BOOL) saveToURL: (NSURL *) url - ofType: (NSString *) type - forSaveOperation: (NSSaveOperationType) operation - error: (NSError **) error; + ofType: (NSString *) type + forSaveOperation: (NSSaveOperationType) operation + error: (NSError **) error; - (void) saveToURL: (NSURL *) url - ofType: (NSString *) type - forSaveOperation: (NSSaveOperationType) operation - delegate: delegate - didSaveSelector: (SEL) selector - contextInfo: (void *) info; + ofType: (NSString *) type + forSaveOperation: (NSSaveOperationType) operation + delegate: delegate + didSaveSelector: (SEL) selector + contextInfo: (void *) info; - (BOOL) preparePageLayout: (NSPageLayout *) pageLayout; - (BOOL) shouldChangePrintInfo: (NSPrintInfo *) printInfo; @@ -227,7 +227,7 @@ typedef enum { saveOperation: (NSSaveOperationType) operation; - (NSString *) fileName; - (NSString *) fileNameFromRunningSavePanelForSaveOperation: - (NSSaveOperationType) operation; + (NSSaveOperationType) operation; - (NSFileWrapper *) fileWrapperRepresentationOfType: (NSString *) type; - initWithContentsOfFile: (NSString *) path ofType: (NSString *) type; - initWithContentsOfURL: (NSURL *) url ofType: (NSString *) type; @@ -244,16 +244,16 @@ typedef enum { - (int) runModalPageLayoutWithPrintInfo: (NSPrintInfo *) printInfo; - (void) setFileName: (NSString *) path; - (void) saveToFile: (NSString *) path - saveOperation: (NSSaveOperationType) operation - delegate: delegate - didSaveSelector: (SEL) selector - contextInfo: (void *) info; + saveOperation: (NSSaveOperationType) operation + delegate: delegate + didSaveSelector: (SEL) selector + contextInfo: (void *) info; - (BOOL) shouldCloseWindowController: (NSWindowController *) controller; - (BOOL) writeToFile: (NSString *) path ofType: (NSString *) type; - (BOOL) writeToFile: (NSString *) path - ofType: (NSString *) type - originalFile: (NSString *) original - saveOperation: (NSSaveOperationType) operation; + ofType: (NSString *) type + originalFile: (NSString *) original + saveOperation: (NSSaveOperationType) operation; - (BOOL) writeToURL: (NSURL *) url ofType: (NSString *) type; - (BOOL) writeWithBackupToFile: (NSString *) path ofType: (NSString *) type diff --git a/AppKit/include/AppKit/NSDocumentController.h b/AppKit/include/AppKit/NSDocumentController.h index 2d43ee26..8f9bf57f 100644 --- a/AppKit/include/AppKit/NSDocumentController.h +++ b/AppKit/include/AppKit/NSDocumentController.h @@ -60,9 +60,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ofType: (NSString *) type error: (NSError **) error; - makeDocumentForURL: (NSURL *) url - withContentsOfURL: (NSURL *) contentsURL - ofType: (NSString *) type - error: (NSError **) error; + withContentsOfURL: (NSURL *) contentsURL + ofType: (NSString *) type + error: (NSError **) error; - makeUntitledDocumentOfType: (NSString *) type; - openUntitledDocumentOfType: (NSString *) type display: (BOOL) display; @@ -89,10 +89,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSError *) willPresentError: (NSError *) error; - (BOOL) presentError: (NSError *) error; - (void) presentError: (NSError *) error - modalForWindow: (NSWindow *) window - delegate: delegate - didPresentSelector: (SEL) selector - contextInfo: (void *) info; + modalForWindow: (NSWindow *) window + delegate: delegate + didPresentSelector: (SEL) selector + contextInfo: (void *) info; - (int) runModalOpenPanel: (NSOpenPanel *) openPanel forTypes: (NSArray *) extensions; diff --git a/AppKit/include/AppKit/NSEvent.h b/AppKit/include/AppKit/NSEvent.h index 3260df8d..0677f2e7 100644 --- a/AppKit/include/AppKit/NSEvent.h +++ b/AppKit/include/AppKit/NSEvent.h @@ -255,15 +255,15 @@ enum { NSApplicationActivated = 0, NSApplicationDeactivated = 1 }; pressure: (float) pressure; + (NSEvent *) keyEventWithType: (NSEventType) type - location: (NSPoint) location - modifierFlags: (NSEventModifierFlags) modifierFlags - timestamp: (NSTimeInterval) timestamp - windowNumber: (NSInteger) windowNumber - context: (NSGraphicsContext *) context - characters: (NSString *) characters - charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers - isARepeat: (BOOL) isARepeat - keyCode: (unsigned short) keyCode; + location: (NSPoint) location + modifierFlags: (NSEventModifierFlags) modifierFlags + timestamp: (NSTimeInterval) timestamp + windowNumber: (NSInteger) windowNumber + context: (NSGraphicsContext *) context + characters: (NSString *) characters + charactersIgnoringModifiers: (NSString *) charactersIgnoringModifiers + isARepeat: (BOOL) isARepeat + keyCode: (unsigned short) keyCode; + (NSEvent *) otherEventWithType: (NSEventType) type location: (NSPoint) location diff --git a/AppKit/include/AppKit/NSFontDescriptor.h b/AppKit/include/AppKit/NSFontDescriptor.h index 512e3386..faf971f6 100644 --- a/AppKit/include/AppKit/NSFontDescriptor.h +++ b/AppKit/include/AppKit/NSFontDescriptor.h @@ -73,13 +73,13 @@ APPKIT_EXPORT const NSFontWeight NSFontWeightRegular; - (NSFontSymbolicTraits) symbolicTraits; - (NSFontDescriptor *) fontDescriptorByAddingAttributes: - (NSDictionary *) attributes; + (NSDictionary *) attributes; - (NSFontDescriptor *) fontDescriptorWithFace: (NSString *) face; - (NSFontDescriptor *) fontDescriptorWithFamily: (NSString *) family; - (NSFontDescriptor *) fontDescriptorWithMatrix: (NSAffineTransform *) matrix; - (NSFontDescriptor *) fontDescriptorWithSize: (CGFloat) pointSize; - (NSFontDescriptor *) fontDescriptorWithSymbolicTraits: - (NSFontSymbolicTraits) traits; + (NSFontSymbolicTraits) traits; - (NSArray *) matchingFontDescriptorsWithMandatoryKeys: (NSSet *) keys; - (NSFontDescriptor *) matchingFontDescriptorWithMandatoryKeys: (NSSet *) keys; diff --git a/AppKit/include/AppKit/NSFontManager.h b/AppKit/include/AppKit/NSFontManager.h index 7584bab5..33430c58 100644 --- a/AppKit/include/AppKit/NSFontManager.h +++ b/AppKit/include/AppKit/NSFontManager.h @@ -85,7 +85,7 @@ enum { - (NSArray *) availableFontFamilies; - (NSArray *) availableMembersOfFontFamily: (NSString *) name; - (NSArray *) availableFontNamesMatchingFontDescriptor: - (NSFontDescriptor *) descriptor; + (NSFontDescriptor *) descriptor; - (NSArray *) availableFontNamesWithTraits: (NSFontTraitMask) traits; - (BOOL) fontNamed: (NSString *) name hasTraits: (NSFontTraitMask) traits; diff --git a/AppKit/include/AppKit/NSGlyphGenerator.h b/AppKit/include/AppKit/NSGlyphGenerator.h index 9301ecd7..882662f0 100644 --- a/AppKit/include/AppKit/NSGlyphGenerator.h +++ b/AppKit/include/AppKit/NSGlyphGenerator.h @@ -27,9 +27,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSAttributedString *) attributedString; - (void) insertGlyphs: (const NSGlyph *) glyphs - length: (NSUInteger) length - forStartingGlyphAtIndex: (NSUInteger) glyphIndex - characterIndex: (NSUInteger) characterIndex; + length: (NSUInteger) length + forStartingGlyphAtIndex: (NSUInteger) glyphIndex + characterIndex: (NSUInteger) characterIndex; - (void) setIntAttribute: (NSInteger) intAttribute value: (NSInteger) value diff --git a/AppKit/include/AppKit/NSGlyphInfo.h b/AppKit/include/AppKit/NSGlyphInfo.h index c24d210e..c9e9d810 100644 --- a/AppKit/include/AppKit/NSGlyphInfo.h +++ b/AppKit/include/AppKit/NSGlyphInfo.h @@ -28,10 +28,10 @@ typedef NSInteger NSCharacterCollection; NSString *_glyphName; } -+ (NSGlyphInfo *) glyphInfoWithCharacterIdentifier: (NSUInteger) identifier - collection: - (NSCharacterCollection) collection - baseString: (NSString *) baseString; ++ (NSGlyphInfo *) + glyphInfoWithCharacterIdentifier: (NSUInteger) identifier + collection: (NSCharacterCollection) collection + baseString: (NSString *) baseString; + (NSGlyphInfo *) glyphInfoWithGlyph: (NSGlyph) glyph forFont: (NSFont *) font diff --git a/AppKit/include/AppKit/NSGradient.h b/AppKit/include/AppKit/NSGradient.h index 1bac2964..0ad0e9c0 100644 --- a/AppKit/include/AppKit/NSGradient.h +++ b/AppKit/include/AppKit/NSGradient.h @@ -36,8 +36,8 @@ typedef enum { } - initWithColors: (NSArray *) colors - atLocations: (const CGFloat *) locations - colorSpace: (NSColorSpace *) colorSpace; + atLocations: (const CGFloat *) locations + colorSpace: (NSColorSpace *) colorSpace; - initWithStartingColor: (NSColor *) startingColor endingColor: (NSColor *) endingColor; - initWithColors: (NSArray *) colors; @@ -57,7 +57,7 @@ typedef enum { - (void) drawInRect: (NSRect) rect relativeCenterPosition: (NSPoint) center; - (void) drawInBezierPath: (NSBezierPath *) path - relativeCenterPosition: (NSPoint) center; + relativeCenterPosition: (NSPoint) center; - (NSColorSpace *) colorSpace; - (NSInteger) numberOfColorStops; diff --git a/AppKit/include/AppKit/NSGraphicsContext.h b/AppKit/include/AppKit/NSGraphicsContext.h index 9fd5a4bd..9b14ea6e 100644 --- a/AppKit/include/AppKit/NSGraphicsContext.h +++ b/AppKit/include/AppKit/NSGraphicsContext.h @@ -34,9 +34,9 @@ typedef enum { typedef enum { NSColorRenderingIntentDefault = kCGRenderingIntentDefault, NSColorRenderingIntentAbsoluteColorimetric = - kCGRenderingIntentAbsoluteColorimetric, + kCGRenderingIntentAbsoluteColorimetric, NSColorRenderingIntentRelativeColorimetric = - kCGRenderingIntentRelativeColorimetric, + kCGRenderingIntentRelativeColorimetric, NSColorRenderingIntentPerceptual = kCGRenderingIntentPerceptual, NSColorRenderingIntentSaturation = kCGRenderingIntentSaturation, } NSColorRenderingIntent; @@ -59,7 +59,7 @@ typedef enum { + (NSGraphicsContext *) graphicsContextWithGraphicsPort: (CGContextRef) context flipped: (BOOL) flipped; + (NSGraphicsContext *) graphicsContextWithBitmapImageRep: - (NSBitmapImageRep *) imageRep; + (NSBitmapImageRep *) imageRep; + (NSGraphicsContext *) currentContext; + (void) setCurrentContext: (NSGraphicsContext *) context; diff --git a/AppKit/include/AppKit/NSKeyValueBinding.h b/AppKit/include/AppKit/NSKeyValueBinding.h index 48a7ea07..9764a127 100644 --- a/AppKit/include/AppKit/NSKeyValueBinding.h +++ b/AppKit/include/AppKit/NSKeyValueBinding.h @@ -55,7 +55,7 @@ APPKIT_EXPORT NSString *const NSMultipleValuesPlaceholderBindingOption; APPKIT_EXPORT NSString *const NSCreatesSortDescriptorBindingOption; APPKIT_EXPORT NSString *const NSRaisesForNotApplicableKeysBindingOption; APPKIT_EXPORT NSString - *const NSAllowsEditingMultipleValuesSelectionBindingOption; + *const NSAllowsEditingMultipleValuesSelectionBindingOption; APPKIT_EXPORT NSString *const NSValueTransformerNameBindingOption; APPKIT_EXPORT NSString *const NSValueTransformerBindingOption; APPKIT_EXPORT NSString *const NSConditionallySetsEnabledBindingOption; diff --git a/AppKit/include/AppKit/NSLayoutManager.h b/AppKit/include/AppKit/NSLayoutManager.h index a88c5117..49daa546 100644 --- a/AppKit/include/AppKit/NSLayoutManager.h +++ b/AppKit/include/AppKit/NSLayoutManager.h @@ -21,7 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSTextStorage, NSGlyphGenerator, NSTypesetter, NSTextContainer, - NSTextView, NSRulerView; + NSTextView, NSRulerView; @class NSWindow, NSColor, NSCell; typedef enum { @@ -83,8 +83,8 @@ typedef enum { atIndex: (NSUInteger) index; - (void) insertGlyph: (NSGlyph) glyph - atGlyphIndex: (NSUInteger) glyphIndex - characterIndex: (NSUInteger) characterIndex; + atGlyphIndex: (NSUInteger) glyphIndex + characterIndex: (NSUInteger) characterIndex; - (void) replaceGlyphAtIndex: (NSUInteger) glyphIndex withGlyph: (NSGlyph) glyph; - (void) deleteGlyphsInRange: (NSRange) glyphRange; @@ -112,15 +112,15 @@ typedef enum { bidiLevels: (unsigned char *) bidiLevels; - (NSTextContainer *) textContainerForGlyphAtIndex: (NSUInteger) glyphIndex - effectiveRange: - (NSRangePointer) effectiveGlyphRange; + effectiveRange: (NSRangePointer) + effectiveGlyphRange; - (NSRect) lineFragmentRectForGlyphAtIndex: (NSUInteger) glyphIndex effectiveRange: - (NSRangePointer) effectiveGlyphRange; + (NSRangePointer) effectiveGlyphRange; - (NSPoint) locationForGlyphAtIndex: (NSUInteger) glyphIndex; - (NSRect) lineFragmentUsedRectForGlyphAtIndex: (NSUInteger) glyphIndex effectiveRange: - (NSRangePointer) effectiveGlyphRange; + (NSRangePointer) effectiveGlyphRange; - (NSRect) usedRectForTextContainer: (NSTextContainer *) container; - (NSRect) extraLineFragmentRect; - (NSRect) extraLineFragmentUsedRect; @@ -132,7 +132,7 @@ typedef enum { forGlyphRange: (NSRange) glyphRange usedRect: (NSRect) usedRect; - (void) setLocation: (NSPoint) location - forStartOfGlyphRange: (NSRange) glyphRange; + forStartOfGlyphRange: (NSRange) glyphRange; - (void) setExtraLineFragmentRect: (NSRect) fragmentRect usedRect: (NSRect) usedRect @@ -148,22 +148,22 @@ typedef enum { - (void) invalidateDisplayForCharacterRange: (NSRange) charRange; - (void) textStorage: (NSTextStorage *) storage - edited: (NSUInteger) editedMask - range: (NSRange) range - changeInLength: (NSInteger) changeInLength - invalidatedRange: (NSRange) invalidateRange; + edited: (NSUInteger) editedMask + range: (NSRange) range + changeInLength: (NSInteger) changeInLength + invalidatedRange: (NSRange) invalidateRange; - (void) textContainerChangedGeometry: (NSTextContainer *) container; - (void) ensureLayoutForTextContainer: (NSTextContainer *) container; - (NSUInteger) glyphIndexForPoint: (NSPoint) point - inTextContainer: (NSTextContainer *) container - fractionOfDistanceThroughGlyph: (CGFloat *) fraction; + inTextContainer: (NSTextContainer *) container + fractionOfDistanceThroughGlyph: (CGFloat *) fraction; - (NSUInteger) glyphIndexForPoint: (NSPoint) point inTextContainer: (NSTextContainer *) container; - (CGFloat) fractionOfDistanceThroughGlyphForPoint: (NSPoint) point inTextContainer: - (NSTextContainer *) container; + (NSTextContainer *) container; - (NSRange) glyphRangeForTextContainer: (NSTextContainer *) container; - (NSRange) glyphRangeForCharacterRange: (NSRange) charRange @@ -172,9 +172,10 @@ typedef enum { inTextContainer: (NSTextContainer *) container; - (NSRange) glyphRangeForBoundingRectWithoutAdditionalLayout: (NSRect) bounds inTextContainer: - (NSTextContainer *) container; + (NSTextContainer *) + container; - (NSRange) rangeOfNominallySpacedGlyphsContainingIndex: - (NSUInteger) glyphIndex; + (NSUInteger) glyphIndex; - (NSRect) boundingRectForGlyphRange: (NSRange) glyphRange inTextContainer: (NSTextContainer *) container; @@ -197,12 +198,12 @@ typedef enum { glyphIndex: (NSUInteger *) glyphIndex; - (void) showPackedGlyphs: (char *) glyphs - length: (NSUInteger) length - glyphRange: (NSRange) glyphRange - atPoint: (NSPoint) point - font: (NSFont *) font - color: (NSColor *) color - printingAdjustment: (NSSize) printingAdjustment; + length: (NSUInteger) length + glyphRange: (NSRange) glyphRange + atPoint: (NSPoint) point + font: (NSFont *) font + color: (NSColor *) color + printingAdjustment: (NSSize) printingAdjustment; - (void) drawBackgroundForGlyphRange: (NSRange) glyphRange atPoint: (NSPoint) origin; @@ -216,10 +217,10 @@ typedef enum { lineFragmentGlyphRange: (NSRange) lineGlyphRange containerOrigin: (NSPoint) containerOrigin; - (void) underlineGlyphRange: (NSRange) glyphRange - underlineType: (NSInteger) underlineVal - lineFragmentRect: (NSRect) lineRect - lineFragmentGlyphRange: (NSRange) lineGlyphRange - containerOrigin: (NSPoint) containerOrigin; + underlineType: (NSInteger) underlineVal + lineFragmentRect: (NSRect) lineRect + lineFragmentGlyphRange: (NSRange) lineGlyphRange + containerOrigin: (NSPoint) containerOrigin; - (void) drawStrikethroughForGlyphRange: (NSRange) glyphRange strikethroughType: (NSInteger) strikethroughVal @@ -237,7 +238,8 @@ typedef enum { - (NSDictionary *) temporaryAttributesAtCharacterIndex: (NSUInteger) charIndex effectiveRange: - (NSRangePointer) effectiveCharRange; + (NSRangePointer) + effectiveCharRange; - (void) setTemporaryAttributes: (NSDictionary *) attrs forCharacterRange: (NSRange) charRange; - (void) addTemporaryAttributes: (NSDictionary *) attrs @@ -249,9 +251,9 @@ typedef enum { atCharacterIndex: (NSUInteger) location effectiveRange: (NSRangePointer) range; - (id) temporaryAttribute: (NSString *) attrName - atCharacterIndex: (NSUInteger) location - longestEffectiveRange: (NSRangePointer) range - inRange: (NSRange) rangeLimit; + atCharacterIndex: (NSUInteger) location + longestEffectiveRange: (NSRangePointer) range + inRange: (NSRange) rangeLimit; - (NSDictionary *) temporaryAttributesAtCharacterIndex: (NSUInteger) location longestEffectiveRange: (NSRangePointer) range inRange: (NSRange) rangeLimit; @@ -271,11 +273,11 @@ typedef enum { @protocol NSLayoutManagerDelegate @optional - (void) layoutManager: (NSLayoutManager *) layoutManager - didCompleteLayoutForTextContainer: (NSTextContainer *) textContainer - atEnd: (BOOL) layoutFinishedFlag; + didCompleteLayoutForTextContainer: (NSTextContainer *) textContainer + atEnd: (BOOL) layoutFinishedFlag; - (NSDictionary *) layoutManager: (NSLayoutManager *) layoutManager - shouldUseTemporaryAttributes: (NSDictionary *) attrs - forDrawingToScreen: (BOOL) toScreen - atCharacterIndex: (NSUInteger) charIndex - effectiveRange: (NSRangePointer) effectiveCharRange; + shouldUseTemporaryAttributes: (NSDictionary *) attrs + forDrawingToScreen: (BOOL) toScreen + atCharacterIndex: (NSUInteger) charIndex + effectiveRange: (NSRangePointer) effectiveCharRange; @end diff --git a/AppKit/include/AppKit/NSMatrix.h b/AppKit/include/AppKit/NSMatrix.h index 686bd93a..91a59157 100644 --- a/AppKit/include/AppKit/NSMatrix.h +++ b/AppKit/include/AppKit/NSMatrix.h @@ -57,15 +57,15 @@ typedef enum { } - initWithFrame: (NSRect) frame - mode: (NSMatrixMode) mode - prototype: (NSCell *) prototype - numberOfRows: (NSInteger) rows - numberOfColumns: (NSInteger) columns; + mode: (NSMatrixMode) mode + prototype: (NSCell *) prototype + numberOfRows: (NSInteger) rows + numberOfColumns: (NSInteger) columns; - initWithFrame: (NSRect) frame - mode: (NSMatrixMode) mode - cellClass: (Class) cls - numberOfRows: (NSInteger) rows - numberOfColumns: (NSInteger) columns; + mode: (NSMatrixMode) mode + cellClass: (Class) cls + numberOfRows: (NSInteger) rows + numberOfColumns: (NSInteger) columns; - delegate; - (SEL) doubleAction; @@ -81,8 +81,8 @@ typedef enum { column: (NSInteger *) column ofCell: (NSCell *) cell; - (BOOL) getRow: (NSInteger *) row - column: (NSInteger *) column - forPoint: (NSPoint) point; + column: (NSInteger *) column + forPoint: (NSPoint) point; - (NSInteger) numberOfRows; - (NSInteger) numberOfColumns; diff --git a/AppKit/include/AppKit/NSMenu.h b/AppKit/include/AppKit/NSMenu.h index 2d67410c..4366b489 100644 --- a/AppKit/include/AppKit/NSMenu.h +++ b/AppKit/include/AppKit/NSMenu.h @@ -111,8 +111,8 @@ APPKIT_EXPORT const NSNotificationName NSMenuDidEndTrackingNotification; - (NSInteger) numberOfItemsInMenu: (NSMenu *) menu; - (void) menu: (NSMenu *) menu willHighlightItem: (NSMenuItem *) item; - (BOOL) menu: (NSMenu *) menu - updateItem: (NSMenuItem *) item - atIndex: (NSInteger) index - shouldCancel: (BOOL) shouldCancel; + updateItem: (NSMenuItem *) item + atIndex: (NSInteger) index + shouldCancel: (BOOL) shouldCancel; @end diff --git a/AppKit/include/AppKit/NSNibLoading.h b/AppKit/include/AppKit/NSNibLoading.h index 3b81b76e..84d9332c 100644 --- a/AppKit/include/AppKit/NSNibLoading.h +++ b/AppKit/include/AppKit/NSNibLoading.h @@ -24,8 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #if 0 #define NIBDEBUG(desc, ...) \ do { \ - NSString *location = \ - [NSString stringWithFormat: @"%s %ld", __FILE__, (long) __LINE__]; \ + NSString *location = [NSString \ + stringWithFormat: @"%s %ld", __FILE__, (long) __LINE__]; \ NSString *msg = [NSString stringWithFormat: desc, ##__VA_ARGS__]; \ NSLog(@"%@: %@", location, msg); \ } while (0) @@ -52,14 +52,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @interface NSBundle (NSNibLoading) + (BOOL) loadNibFile: (NSString *) path - externalNameTable: (NSDictionary *) nameTable - withZone: (NSZone *) zone; + externalNameTable: (NSDictionary *) nameTable + withZone: (NSZone *) zone; + (BOOL) loadNibNamed: (NSString *) name owner: owner; - (BOOL) loadNibFile: (NSString *) fileName - externalNameTable: (NSDictionary *) nameTable - withZone: (NSZone *) zone; + externalNameTable: (NSDictionary *) nameTable + withZone: (NSZone *) zone; @end @@ -73,12 +73,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (void) popNibPath; + (void) pushNibPath: (id) path; + (BOOL) _loadNibFile: (id) file - externalNameTable: (id) tableName - options: (id) options - withZone: (struct _NSZone *) zone; + externalNameTable: (id) tableName + options: (id) options + withZone: (struct _NSZone *) zone; - (BOOL) loadNibFile: (id) file - externalNameTable: (id) tableName - options: (id) options - withZone: (struct _NSZone *) zone; + externalNameTable: (id) tableName + options: (id) options + withZone: (struct _NSZone *) zone; @end diff --git a/AppKit/include/AppKit/NSObject+BindingSupport.h b/AppKit/include/AppKit/NSObject+BindingSupport.h index 725209da..fcbd1912 100644 --- a/AppKit/include/AppKit/NSObject+BindingSupport.h +++ b/AppKit/include/AppKit/NSObject+BindingSupport.h @@ -25,9 +25,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @interface NSObject (BindingSupport) - (void) bind: (id) binding - toObject: (id) destination - withKeyPath: (NSString *) keyPath - options: (NSDictionary *) options; + toObject: (id) destination + withKeyPath: (NSString *) keyPath + options: (NSDictionary *) options; - (NSDictionary *) infoForBinding: (id) binding; - (void) unbind: (id) binding; + (void) exposeBinding: (id) binding; diff --git a/AppKit/include/AppKit/NSObjectController.h b/AppKit/include/AppKit/NSObjectController.h index d26c5424..1bc7696a 100644 --- a/AppKit/include/AppKit/NSObjectController.h +++ b/AppKit/include/AppKit/NSObjectController.h @@ -18,7 +18,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSString, NSPredicate, NSFetchRequest, NSManagedObjectContext, - NSMenuItem, NSError, NSArray, NSCountedSet; + NSMenuItem, NSError, NSArray, NSCountedSet; @interface NSObjectController : NSController { NSString *_objectClassName; diff --git a/AppKit/include/AppKit/NSOpenGLContext.h b/AppKit/include/AppKit/NSOpenGLContext.h index 6aa3e5df..c34d7ada 100644 --- a/AppKit/include/AppKit/NSOpenGLContext.h +++ b/AppKit/include/AppKit/NSOpenGLContext.h @@ -47,7 +47,7 @@ typedef enum { + (void) clearCurrentContext; - initWithFormat: (NSOpenGLPixelFormat *) pixelFormat - shareContext: (NSOpenGLContext *) shareContext; + shareContext: (NSOpenGLContext *) shareContext; - (NSView *) view; - (NSOpenGLPixelBuffer *) pixelBuffer; @@ -56,9 +56,9 @@ typedef enum { - (void *) CGLContextObj; - (void) getValues: (GLint *) vals - forParameter: (NSOpenGLContextParameter) parameter; + forParameter: (NSOpenGLContextParameter) parameter; - (void) setValues: (const GLint *) vals - forParameter: (NSOpenGLContextParameter) parameter; + forParameter: (NSOpenGLContextParameter) parameter; - (void) setView: (NSView *) view; - (void) makeCurrentContext; @@ -71,9 +71,9 @@ typedef enum { height: (long) height rowbytes: (long) rowbytes; - (void) setPixelBuffer: (NSOpenGLPixelBuffer *) pixelBuffer - cubeMapFace: (unsigned long) cubeMapFace - mipMapLeve: (long) mipMapLevel - currentVirtualScreen: (int) screen; + cubeMapFace: (unsigned long) cubeMapFace + mipMapLeve: (long) mipMapLevel + currentVirtualScreen: (int) screen; - (void) setTextureImageToPixelBuffer: (NSOpenGLPixelBuffer *) pixelBuffer colorBuffer: (unsigned long) source; diff --git a/AppKit/include/AppKit/NSOpenGLPixelFormat.h b/AppKit/include/AppKit/NSOpenGLPixelFormat.h index d3af44b9..8a48ba5d 100644 --- a/AppKit/include/AppKit/NSOpenGLPixelFormat.h +++ b/AppKit/include/AppKit/NSOpenGLPixelFormat.h @@ -68,13 +68,13 @@ typedef uint32_t NSOpenGLPixelFormatAttribute; } - (instancetype) initWithAttributes: - (const NSOpenGLPixelFormatAttribute *) attributes; + (const NSOpenGLPixelFormatAttribute *) attributes; - (void *) CGLPixelFormatObj; - (GLint) numberOfVirtualScreens; - (void) getValues: (long *) values - forAttribute: (NSOpenGLPixelFormatAttribute) attribute - forVirtualScreen: (int) screen; + forAttribute: (NSOpenGLPixelFormatAttribute) attribute + forVirtualScreen: (int) screen; @end diff --git a/AppKit/include/AppKit/NSOutlineView.h b/AppKit/include/AppKit/NSOutlineView.h index 9bc82748..d788b415 100644 --- a/AppKit/include/AppKit/NSOutlineView.h +++ b/AppKit/include/AppKit/NSOutlineView.h @@ -97,18 +97,18 @@ APPKIT_EXPORT NSString *const NSOutlineViewDisclosureButtonKey; @interface NSObject (NSOutlineView_dataSource) - (NSInteger) outlineView: (NSOutlineView *) outlineView - numberOfChildrenOfItem: item; + numberOfChildrenOfItem: item; - (BOOL) outlineView: (NSOutlineView *) outlineView isItemExpandable: item; - outlineView: (NSOutlineView *) outlineView - child: (NSInteger) index - ofItem: item; + child: (NSInteger) index + ofItem: item; - outlineView: (NSOutlineView *) outlineView - objectValueForTableColumn: (NSTableColumn *) tableColumn - byItem: item; + objectValueForTableColumn: (NSTableColumn *) tableColumn + byItem: item; - (void) outlineView: (NSOutlineView *) outlineView - setObjectValue: object - forTableColumn: (NSTableColumn *) tableColumn - byItem: item; + setObjectValue: object + forTableColumn: (NSTableColumn *) tableColumn + byItem: item; @end @interface NSObject (NSOutlineView_delegate) @@ -116,19 +116,19 @@ APPKIT_EXPORT NSString *const NSOutlineViewDisclosureButtonKey; - (BOOL) outlineView: (NSOutlineView *) outlineView shouldCollapseItem: item; - (BOOL) selectionShouldChangeInOutlineView: (NSOutlineView *) outlineView; - (BOOL) outlineView: (NSOutlineView *) outlineView - shouldEditTableColumn: (NSTableColumn *) tableColumn - item: item; + shouldEditTableColumn: (NSTableColumn *) tableColumn + item: item; - (BOOL) outlineView: (NSOutlineView *) outlineView shouldSelectItem: item; - (BOOL) outlineView: (NSOutlineView *) outlineView - shouldSelectTableColumn: (NSTableColumn *) tableColumn; + shouldSelectTableColumn: (NSTableColumn *) tableColumn; - (void) outlineView: (NSOutlineView *) outlineView - willDisplayCell: cell - forTableColumn: (NSTableColumn *) tableColumn - item: item; + willDisplayCell: cell + forTableColumn: (NSTableColumn *) tableColumn + item: item; - (void) outlineView: (NSOutlineView *) outlineView - willDisplayOutlineCell: cell - forTableColumn: (NSTableColumn *) tableColumn - item: item; + willDisplayOutlineCell: cell + forTableColumn: (NSTableColumn *) tableColumn + item: item; @end @interface NSObject (NSOutlineView_notifications) diff --git a/AppKit/include/AppKit/NSPanel.h b/AppKit/include/AppKit/NSPanel.h index 986a8e65..a71492ab 100644 --- a/AppKit/include/AppKit/NSPanel.h +++ b/AppKit/include/AppKit/NSPanel.h @@ -54,8 +54,8 @@ APPKIT_EXPORT NSInteger NSRunAlertPanel(NSString *title, NSString *message, NSString *alternateButton, NSString *otherButton, ...); APPKIT_EXPORT NSInteger NSRunInformationalAlertPanel( - NSString *title, NSString *msgFormat, NSString *defaultButton, - NSString *alternateButton, NSString *otherButton, ...); + NSString *title, NSString *msgFormat, NSString *defaultButton, + NSString *alternateButton, NSString *otherButton, ...); APPKIT_EXPORT NSInteger NSRunCriticalAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, diff --git a/AppKit/include/AppKit/NSPasteboard.h b/AppKit/include/AppKit/NSPasteboard.h index b69529f0..65d657c8 100644 --- a/AppKit/include/AppKit/NSPasteboard.h +++ b/AppKit/include/AppKit/NSPasteboard.h @@ -69,14 +69,14 @@ APPKIT_EXPORT const NSPasteboardName NSPasteboardNameGeneral; typedef NSString *NSPasteboardReadingOptionKey; APPKIT_EXPORT const NSPasteboardReadingOptionKey - NSPasteboardURLReadingContentsConformToTypesKey; + NSPasteboardURLReadingContentsConformToTypesKey; @class NSPasteboard; // @interface NSObject (NSPasteboard) @protocol NSPasteboardTypeOwner - (void) pasteboard: (NSPasteboard *) sender - provideDataForType: (NSPasteboardType) type; + provideDataForType: (NSPasteboardType) type; - (void) pasteboardChangedOwner: (NSPasteboard *) sender; @end @@ -93,7 +93,7 @@ APPKIT_EXPORT const NSPasteboardReadingOptionKey - (NSArray *) types; - (NSPasteboardType) availableTypeFromArray: - (NSArray *) types; + (NSArray *) types; - (NSData *) dataForType: (NSPasteboardType) type; - (NSString *) stringForType: (NSPasteboardType) type; diff --git a/AppKit/include/AppKit/NSPathControl.h b/AppKit/include/AppKit/NSPathControl.h index 5a730fd4..a08b788f 100644 --- a/AppKit/include/AppKit/NSPathControl.h +++ b/AppKit/include/AppKit/NSPathControl.h @@ -13,15 +13,15 @@ - (BOOL) pathControl: (NSPathControl *) pathControl acceptDrop: (id) info; - (BOOL) pathControl: (NSPathControl *) pathControl - shouldDragPathComponentCell: (NSPathComponentCell *) pathComponentCell - withPasteboard: (NSPasteboard *) pasteboard; + shouldDragPathComponentCell: (NSPathComponentCell *) pathComponentCell + withPasteboard: (NSPasteboard *) pasteboard; - (NSDragOperation) pathControl: (NSPathControl *) pathControl validateDrop: (id) info; - (void) pathControl: (NSPathControl *) pathControl - willDisplayOpenPanel: (NSOpenPanel *) openPanel; + willDisplayOpenPanel: (NSOpenPanel *) openPanel; - (void) pathControl: (NSPathControl *) pathControl - willPopUpMenu: (NSMenu *) menu; + willPopUpMenu: (NSMenu *) menu; @end diff --git a/AppKit/include/AppKit/NSResponder.h b/AppKit/include/AppKit/NSResponder.h index 2c4fbe39..11dfac87 100644 --- a/AppKit/include/AppKit/NSResponder.h +++ b/AppKit/include/AppKit/NSResponder.h @@ -51,10 +51,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSError *) willPresentError: (NSError *) error; - (BOOL) presentError: (NSError *) error; - (void) presentError: (NSError *) error - modalForWindow: (NSWindow *) window - delegate: delegate - didPresentSelector: (SEL) selector - contextInfo: (void *) info; + modalForWindow: (NSWindow *) window + delegate: delegate + didPresentSelector: (SEL) selector + contextInfo: (void *) info; - (void) keyUp: (NSEvent *) event; - (void) keyDown: (NSEvent *) event; @@ -169,6 +169,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) moveToEndOfDocumentAndModifySelection: sender; // n.b.: - (void) moveToBeginningOfDocumentAndModifySelection: - sender; // these aren't in OSX (can't hurt) + sender; // these aren't in OSX (can't hurt) @end diff --git a/AppKit/include/AppKit/NSRulerMarker.h b/AppKit/include/AppKit/NSRulerMarker.h index 09a49f08..13ee291d 100644 --- a/AppKit/include/AppKit/NSRulerMarker.h +++ b/AppKit/include/AppKit/NSRulerMarker.h @@ -38,9 +38,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSImage *) defaultMarkerImage; - initWithRulerView: (NSRulerView *) ruler - markerLocation: (CGFloat) location - image: (NSImage *) image - imageOrigin: (NSPoint) point; + markerLocation: (CGFloat) location + image: (NSImage *) image + imageOrigin: (NSPoint) point; - (NSRulerView *) ruler; - (CGFloat) markerLocation; diff --git a/AppKit/include/AppKit/NSRulerView.h b/AppKit/include/AppKit/NSRulerView.h index 2d03200c..fafcc23d 100644 --- a/AppKit/include/AppKit/NSRulerView.h +++ b/AppKit/include/AppKit/NSRulerView.h @@ -40,10 +40,10 @@ typedef enum { NSHorizontalRuler, NSVerticalRuler } NSRulerOrientation; } + (void) registerUnitWithName: (NSString *) name - abbreviation: (NSString *) abbreviation - unitToPointsConversionFactor: (CGFloat) conversionFactor - stepUpCycle: (NSArray *) stepUpCycle - stepDownCycle: (NSArray *) stepDownCycle; + abbreviation: (NSString *) abbreviation + unitToPointsConversionFactor: (CGFloat) conversionFactor + stepUpCycle: (NSArray *) stepUpCycle + stepDownCycle: (NSArray *) stepDownCycle; - initWithScrollView: (NSScrollView *) scrollView orientation: (NSRulerOrientation) orientation; @@ -75,7 +75,7 @@ typedef enum { NSHorizontalRuler, NSVerticalRuler } NSRulerOrientation; - (void) setOriginOffset: (CGFloat) value; - (BOOL) trackMarker: (NSRulerMarker *) marker - withMouseEvent: (NSEvent *) event; + withMouseEvent: (NSEvent *) event; - (void) moveRulerlineFromLocation: (CGFloat) fromLocation toLocation: (CGFloat) toLocation; @@ -90,30 +90,30 @@ typedef enum { NSHorizontalRuler, NSVerticalRuler } NSRulerOrientation; @interface NSView (NSRulerMarker_clientView) - (void) rulerView: (NSRulerView *) rulerView - willSetClientView: (NSView *) clientView; + willSetClientView: (NSView *) clientView; - (void) rulerView: (NSRulerView *) rulerView - handleMouseDown: (NSEvent *) event; + handleMouseDown: (NSEvent *) event; - (BOOL) rulerView: (NSRulerView *) rulerView - shouldAddMarker: (NSRulerMarker *) marker; + shouldAddMarker: (NSRulerMarker *) marker; - (CGFloat) rulerView: (NSRulerView *) rulerView willAddMarker: (NSRulerMarker *) marker atLocation: (CGFloat) location; - (void) rulerView: (NSRulerView *) rulerView - didAddMarker: (NSRulerMarker *) marker; + didAddMarker: (NSRulerMarker *) marker; - (BOOL) rulerView: (NSRulerView *) rulerView - shouldRemoveMarker: (NSRulerMarker *) marker; + shouldRemoveMarker: (NSRulerMarker *) marker; - (void) rulerView: (NSRulerView *) rulerView - didRemoveMarker: (NSRulerMarker *) marker; + didRemoveMarker: (NSRulerMarker *) marker; - (BOOL) rulerView: (NSRulerView *) rulerView - shouldMoveMarker: (NSRulerMarker *) marker; + shouldMoveMarker: (NSRulerMarker *) marker; - (CGFloat) rulerView: (NSRulerView *) rulerView - willMoveMarker: (NSRulerMarker *) marker - toLocation: (CGFloat) location; + willMoveMarker: (NSRulerMarker *) marker + toLocation: (CGFloat) location; - (void) rulerView: (NSRulerView *) rulerView - didMoveMarker: (NSRulerMarker *) marker; + didMoveMarker: (NSRulerMarker *) marker; @end diff --git a/AppKit/include/AppKit/NSSpellChecker.h b/AppKit/include/AppKit/NSSpellChecker.h index 29cd79c2..aaf2083b 100644 --- a/AppKit/include/AppKit/NSSpellChecker.h +++ b/AppKit/include/AppKit/NSSpellChecker.h @@ -23,12 +23,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSView, NSMenu, NSViewController, NSPanel, NSMutableDictionary, - NSMutableSet; + NSMutableSet; APPKIT_EXPORT NSString - *const NSSpellCheckerDidChangeAutomaticTextReplacementNotification; + *const NSSpellCheckerDidChangeAutomaticTextReplacementNotification; APPKIT_EXPORT NSString - *const NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification; + *const NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification; APPKIT_EXPORT NSString *const NSTextCheckingOrthographyKey; APPKIT_EXPORT NSString *const NSTextCheckingQuotesKey; @@ -95,7 +95,7 @@ typedef NSInteger NSCorrectionResponse; - (void) setAccessoryView: (NSView *) view; - (NSViewController *) substitutionsPanelAccessoryViewController; - (void) setSubstitutionsPanelAccessoryViewController: - (NSViewController *) viewController; + (NSViewController *) viewController; #pragma mark - #pragma mark Checking Strings for Spelling and Grammar @@ -117,12 +117,12 @@ typedef NSInteger NSCorrectionResponse; inSpellDocumentWithTag: (NSInteger) documentTag details: (NSArray **) outDetails; - (NSArray *) checkString: (NSString *) string - range: (NSRange) range - types: (NSTextCheckingTypes) types - options: (NSDictionary *) options - inSpellDocumentWithTag: (NSInteger) tag - orthography: (NSOrthography **) orthography - wordCount: (NSInteger *) wordCount; + range: (NSRange) range + types: (NSTextCheckingTypes) types + options: (NSDictionary *) options + inSpellDocumentWithTag: (NSInteger) tag + orthography: (NSOrthography **) orthography + wordCount: (NSInteger *) wordCount; #ifdef NS_BLOCKS - (NSInteger) requestCheckingOfString: (NSString *) stringToCheck @@ -131,9 +131,10 @@ typedef NSInteger NSCorrectionResponse; options: (NSDictionary *) options inSpellDocumentWithTag: (NSInteger) tag completionHandler: - (void (^)(NSInteger sequenceNumber, NSArray *results, - NSOrthography *orthography, - NSInteger wordCount)) completionHandler; + (void (^)(NSInteger sequenceNumber, + NSArray *results, + NSOrthography *orthography, + NSInteger wordCount)) completionHandler; #endif - (NSArray *) guessesForWordRange: (NSRange) range @@ -148,7 +149,7 @@ typedef NSInteger NSCorrectionResponse; - (void) closeSpellDocumentWithTag: (NSInteger) tag; - (void) ignoreWord: (NSString *) word inSpellDocumentWithTag: (NSInteger) tag; - (void) setIgnoredWords: (NSArray *) ignoredWords - inSpellDocumentWithTag: (NSInteger) tag; + inSpellDocumentWithTag: (NSInteger) tag; - (NSArray *) ignoredWordsInSpellDocumentWithTag: (NSInteger) tag; - (void) setWordFieldStringValue: (NSString *) string; - (void) updateSpellingPanelWithMisspelledWord: (NSString *) word; @@ -186,16 +187,16 @@ typedef NSInteger NSCorrectionResponse; alternativeStrings: (NSArray *) alternativeStrings forStringInRect: (NSRect) rect view: (NSView *) view - completionHandler: - (void (^)(NSString *acceptedString)) completionBlock; + completionHandler: (void (^)(NSString *acceptedString)) + completionBlock; #endif - (void) dismissCorrectionIndicatorForView: (NSView *) view; - (void) recordResponse: (NSCorrectionResponse) response - toCorrection: (NSString *) correction - forWord: (NSString *) word - language: (NSString *) language - inSpellDocumentWithTag: (NSInteger) tag; + toCorrection: (NSString *) correction + forWord: (NSString *) word + language: (NSString *) language + inSpellDocumentWithTag: (NSInteger) tag; #pragma mark - #pragma mark Automatic Text Replacement diff --git a/AppKit/include/AppKit/NSSplitView.h b/AppKit/include/AppKit/NSSplitView.h index 2895f9c8..3bbe939a 100644 --- a/AppKit/include/AppKit/NSSplitView.h +++ b/AppKit/include/AppKit/NSSplitView.h @@ -63,38 +63,38 @@ typedef enum { // splitView:constrainMix:max:ofSubviewAt with two individual methods for each. @interface NSObject (NSSplitView_delegate) - (BOOL) splitView: (NSSplitView *) splitView - canCollapseSubview: (NSView *) subview; + canCollapseSubview: (NSView *) subview; - (BOOL) splitView: (NSSplitView *) splitView - shouldCollapseSubview: (NSView *) subview - forDoubleClickOnDividerAtIndex: (int) index; + shouldCollapseSubview: (NSView *) subview + forDoubleClickOnDividerAtIndex: (int) index; - (CGFloat) splitView: (NSSplitView *) splitView - constrainMinCoordinate: (CGFloat) proposedMinimumPosition - ofSubviewAt: (int) index; + constrainMinCoordinate: (CGFloat) proposedMinimumPosition + ofSubviewAt: (int) index; - (CGFloat) splitView: (NSSplitView *) splitView - constrainMaxCoordinate: (CGFloat) proposedMaximumPosition - ofSubviewAt: (int) index; + constrainMaxCoordinate: (CGFloat) proposedMaximumPosition + ofSubviewAt: (int) index; - (void) splitView: (NSSplitView *) splitView - constrainMinCoordinate: (CGFloat *) min - maxCoordinate: (CGFloat *) max - ofSubviewAt: (int) index; + constrainMinCoordinate: (CGFloat *) min + maxCoordinate: (CGFloat *) max + ofSubviewAt: (int) index; - (CGFloat) splitView: (NSSplitView *) splitView - constrainSplitPosition: (CGFloat) pos - ofSubviewAt: (int) index; + constrainSplitPosition: (CGFloat) pos + ofSubviewAt: (int) index; - (void) splitView: (NSSplitView *) splitView - resizeSubviewsWithOldSize: (NSSize) size; + resizeSubviewsWithOldSize: (NSSize) size; - (BOOL) splitView: (NSSplitView *) splitView - shouldAdjustSizeOfSubview: (NSView *) view; + shouldAdjustSizeOfSubview: (NSView *) view; - (BOOL) splitView: (NSSplitView *) splitView - shouldHideDividerAtIndex: (int) index; + shouldHideDividerAtIndex: (int) index; - (NSRect) splitView: (NSSplitView *) splitView - effectiveRect: (NSRect) proposedEffectiveRect - forDrawnRect: (NSRect) drawnRect - ofDividerAtIndex: (int) index; + effectiveRect: (NSRect) proposedEffectiveRect + forDrawnRect: (NSRect) drawnRect + ofDividerAtIndex: (int) index; - (NSRect) splitView: (NSSplitView *) splitView - additionalEffectiveRectOfDividerAtIndex: (NSInteger) index; + additionalEffectiveRectOfDividerAtIndex: (NSInteger) index; - (void) splitViewDidResizeSubviews: (NSNotification *) note; - (void) splitViewWillResizeSubviews: (NSNotification *) note; diff --git a/AppKit/include/AppKit/NSStringDrawing.h b/AppKit/include/AppKit/NSStringDrawing.h index a7580900..4e43f42f 100644 --- a/AppKit/include/AppKit/NSStringDrawing.h +++ b/AppKit/include/AppKit/NSStringDrawing.h @@ -32,7 +32,7 @@ typedef NSInteger NSStringDrawingOptions; @interface NSString (NSStringDrawing) - (void) drawAtPoint: (NSPoint) point - withAttributes: (NSDictionary *) attributes; + withAttributes: (NSDictionary *) attributes; - (void) drawInRect: (NSRect) rect withAttributes: (NSDictionary *) attributes; - (NSSize) sizeWithAttributes: (NSDictionary *) attributes; diff --git a/AppKit/include/AppKit/NSTabView.h b/AppKit/include/AppKit/NSTabView.h index bfef578e..21dcab5e 100644 --- a/AppKit/include/AppKit/NSTabView.h +++ b/AppKit/include/AppKit/NSTabView.h @@ -86,9 +86,9 @@ typedef enum { - (void) tabViewDidChangeNumberOfTabViewItems: (NSTabView *) tabView; - (BOOL) tabView: (NSTabView *) tabView - shouldSelectTabViewItem: (NSTabViewItem *) item; + shouldSelectTabViewItem: (NSTabViewItem *) item; - (void) tabView: (NSTabView *) tabView - willSelectTabViewItem: (NSTabViewItem *) item; + willSelectTabViewItem: (NSTabViewItem *) item; - (void) tabView: (NSTabView *) tabView - didSelectTabViewItem: (NSTabViewItem *) item; + didSelectTabViewItem: (NSTabViewItem *) item; @end diff --git a/AppKit/include/AppKit/NSTableView.h b/AppKit/include/AppKit/NSTableView.h index 0847f5b5..651ce080 100644 --- a/AppKit/include/AppKit/NSTableView.h +++ b/AppKit/include/AppKit/NSTableView.h @@ -236,7 +236,7 @@ typedef enum { - (NSIndexSet *) selectedRowIndexes; - (void) selectRowIndexes: (NSIndexSet *) indexes - byExtendingSelection: (BOOL) extend; + byExtendingSelection: (BOOL) extend; - (NSArray *) sortDescriptors; - (void) setSortDescriptors: (NSArray *) value; @@ -245,40 +245,40 @@ typedef enum { @interface NSObject (NSTableView_dataSource) - (NSInteger) numberOfRowsInTableView: (NSTableView *) tableView; - (id) tableView: (NSTableView *) tableView - objectValueForTableColumn: (NSTableColumn *) tableColumn - row: (NSInteger) row; + objectValueForTableColumn: (NSTableColumn *) tableColumn + row: (NSInteger) row; - (void) tableView: (NSTableView *) tableView - setObjectValue: object - forTableColumn: (NSTableColumn *) tableColumn - row: (NSInteger) row; + setObjectValue: object + forTableColumn: (NSTableColumn *) tableColumn + row: (NSInteger) row; - (BOOL) tableView: (NSTableView *) tableView - writeRowsWithIndexes: (NSIndexSet *) indexes - toPasteboard: (NSPasteboard *) pasteboard; + writeRowsWithIndexes: (NSIndexSet *) indexes + toPasteboard: (NSPasteboard *) pasteboard; - (NSDragOperation) tableView: (NSTableView *) tableView validateDrop: (id) draggingInfo proposedRow: (NSInteger) proposedRow proposedDropOperation: (NSTableViewDropOperation) dropOperation; - (BOOL) tableView: (NSTableView *) tableView - acceptDrop: (id) draggingInfo - row: (NSInteger) row - dropOperation: (NSTableViewDropOperation) dropOperation; + acceptDrop: (id) draggingInfo + row: (NSInteger) row + dropOperation: (NSTableViewDropOperation) dropOperation; @end @interface NSObject (NSTableView_delegate) - (BOOL) tableView: (NSTableView *) tableView - shouldEditTableColumn: (NSTableColumn *) tableColumn - row: (NSInteger) row; + shouldEditTableColumn: (NSTableColumn *) tableColumn + row: (NSInteger) row; - (BOOL) selectionShouldChangeInTableView: (NSTableView *) tableView; - (CGFloat) tableView: (NSTableView *) tableView heightOfRow: (NSInteger) row; - (BOOL) tableView: (NSTableView *) tableView shouldSelectRow: (NSInteger) row; - (BOOL) tableView: (NSTableView *) tableView - shouldSelectTableColumn: (NSTableColumn *) tableColumn; + shouldSelectTableColumn: (NSTableColumn *) tableColumn; - (void) tableView: (NSTableView *) tableView - mouseDownInHeaderOfTableColumn: (NSTableColumn *) tableColumn; + mouseDownInHeaderOfTableColumn: (NSTableColumn *) tableColumn; - (void) tableView: (NSTableView *) tableView - willDisplayCell: cell - forTableColumn: (NSTableColumn *) tableColumn - row: (NSInteger) row; + willDisplayCell: cell + forTableColumn: (NSTableColumn *) tableColumn + row: (NSInteger) row; @end @interface NSObject (NSTableView_notifications) diff --git a/AppKit/include/AppKit/NSTextAttachmentCell.h b/AppKit/include/AppKit/NSTextAttachmentCell.h index 1f5af980..82cea0d5 100644 --- a/AppKit/include/AppKit/NSTextAttachmentCell.h +++ b/AppKit/include/AppKit/NSTextAttachmentCell.h @@ -39,15 +39,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ofView: (NSView *) view atCharacterIndex: (unsigned) characterIndex; +- (BOOL) trackMouse: (NSEvent *) event + inRect: (NSRect) rect + ofView: (NSView *) view + atCharacterIndex: (unsigned) characterIndex + untilMouseUp: (BOOL) untilMouseUp; - (BOOL) trackMouse: (NSEvent *) event inRect: (NSRect) rect ofView: (NSView *) view - atCharacterIndex: (unsigned) characterIndex untilMouseUp: (BOOL) untilMouseUp; -- (BOOL) trackMouse: (NSEvent *) event - inRect: (NSRect) rect - ofView: (NSView *) view - untilMouseUp: (BOOL) untilMouseUp; - (void) highlight: (BOOL) highlight withFrame: (NSRect) frame diff --git a/AppKit/include/AppKit/NSTextBlock.h b/AppKit/include/AppKit/NSTextBlock.h index b21d1dde..26a9ed1f 100644 --- a/AppKit/include/AppKit/NSTextBlock.h +++ b/AppKit/include/AppKit/NSTextBlock.h @@ -71,7 +71,7 @@ typedef enum { - (NSTextBlockValueType) contentWidthValueType; - (CGFloat) valueForDimension: (NSTextBlockDimension) dimension; - (NSTextBlockValueType) valueTypeForDimension: - (NSTextBlockDimension) dimension; + (NSTextBlockDimension) dimension; - (CGFloat) widthForLayer: (NSTextBlockLayer) layer edge: (NSRectEdge) edge; - (NSTextBlockValueType) widthValueTypeForLayer: (NSTextBlockLayer) layer edge: (NSRectEdge) edge; @@ -82,8 +82,8 @@ typedef enum { - (void) setVerticalAlignment: (NSTextBlockVerticalAlignment) alignment; - (void) setContentWidth: (CGFloat) width type: (NSTextBlockValueType) type; - (void) setValue: (CGFloat) value - type: (NSTextBlockValueType) type - forDimension: (NSTextBlockDimension) dimension; + type: (NSTextBlockValueType) type + forDimension: (NSTextBlockDimension) dimension; - (void) setWidth: (CGFloat) value type: (NSTextBlockValueType) type forLayer: (NSTextBlockLayer) layer; diff --git a/AppKit/include/AppKit/NSTextStorage.h b/AppKit/include/AppKit/NSTextStorage.h index 988c3026..f11cf094 100644 --- a/AppKit/include/AppKit/NSTextStorage.h +++ b/AppKit/include/AppKit/NSTextStorage.h @@ -53,8 +53,8 @@ APPKIT_EXPORT NSString *const NSTextStorageDidProcessEditingNotification; - (void) processEditing; - (void) edited: (unsigned) editedMask - range: (NSRange) range - changeInLength: (int) delta; + range: (NSRange) range + changeInLength: (int) delta; - (void) setFont: (NSFont *) font; diff --git a/AppKit/include/AppKit/NSTextTableBlock.h b/AppKit/include/AppKit/NSTextTableBlock.h index 9a87f1ab..04934613 100644 --- a/AppKit/include/AppKit/NSTextTableBlock.h +++ b/AppKit/include/AppKit/NSTextTableBlock.h @@ -30,10 +30,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithTable: (NSTextTable *) table - startingRow: (int) startingRow - rowSpan: (int) rowSpan - startingColumn: (int) startingColumn - columnSpan: (int) columnSpan; + startingRow: (int) startingRow + rowSpan: (int) rowSpan + startingColumn: (int) startingColumn + columnSpan: (int) columnSpan; - (NSTextTable *) table; diff --git a/AppKit/include/AppKit/NSTextView.h b/AppKit/include/AppKit/NSTextView.h index 3540716c..ed0b8d12 100644 --- a/AppKit/include/AppKit/NSTextView.h +++ b/AppKit/include/AppKit/NSTextView.h @@ -99,8 +99,8 @@ APPKIT_EXPORT NSString *const NSOldSelectedCharacterRange; BOOL _allowsUndo; NSMutableArray *_selectedRanges; - NSArray - *_initialRanges; // selected ranges at the start of a selection change + NSArray *_initialRanges; // selected ranges at the start of a selection + // change NSSelectionAffinity _selectionAffinity; NSSelectionGranularity _selectionGranularity; NSDictionary *_selectedTextAttributes; @@ -113,8 +113,8 @@ APPKIT_EXPORT NSString *const NSOldSelectedCharacterRange; // memory hog NSRange _rangeForUserCompletion; // range of original user completion text. - NSString - *_userCompletionHint; // original "hint" text which started completion + NSString *_userCompletionHint; // original "hint" text which started + // completion NSArray *_userCompletions; // current list of completions. shouldn't change // while modal NSInteger _userCompletionSelectedItem; // index within completion array @@ -167,7 +167,7 @@ APPKIT_EXPORT NSString *const NSOldSelectedCharacterRange; - (NSRange) selectionRangeForProposedRange: (NSRange) range granularity: - (NSSelectionGranularity) granularity; + (NSSelectionGranularity) granularity; - (void) setSelectedRange: (NSRange) range affinity: (NSSelectionAffinity) affinity @@ -182,9 +182,9 @@ APPKIT_EXPORT NSString *const NSOldSelectedCharacterRange; - (NSArray *) completionsForPartialWordRange: (NSRange) range indexOfSelectedItem: (NSInteger *) index; - (void) insertCompletion: (NSString *) string - forPartialWordRange: (NSRange) range - movement: (NSInteger) movement - isFinal: (BOOL) isFinal; + forPartialWordRange: (NSRange) range + movement: (NSInteger) movement + isFinal: (BOOL) isFinal; - (NSArray *) writablePasteboardTypes; - (BOOL) writeSelectionToPasteboard: (NSPasteboard *) pasteboard @@ -260,22 +260,24 @@ APPKIT_EXPORT NSString *const NSOldSelectedCharacterRange; - (BOOL) textView: (NSTextView *) textView doCommandBySelector: (SEL) selector; - (NSArray *) textView: (NSTextView *) textView - completions: (NSArray *) words - forPartialWordRange: (NSRange) range - indexOfSelectedItem: (NSInteger *) index; + completions: (NSArray *) words + forPartialWordRange: (NSRange) range + indexOfSelectedItem: (NSInteger *) index; - (void) textViewDidChangeSelection: (NSNotification *) note; - (NSRange) textView: (NSTextView *) textView - willChangeSelectionFromCharacterRange: (NSRange) oldSelectedCharRange - toCharacterRange: (NSRange) newSelectedCharRange; + willChangeSelectionFromCharacterRange: (NSRange) oldSelectedCharRange + toCharacterRange: (NSRange) newSelectedCharRange; - (NSArray *) textView: (NSTextView *) textView - willChangeSelectionFromCharacterRanges: (NSArray *) oldSelectedCharRanges - toCharacterRanges: (NSArray *) newSelectedCharRanges; + willChangeSelectionFromCharacterRanges: + (NSArray *) oldSelectedCharRanges + toCharacterRanges: + (NSArray *) newSelectedCharRanges; - (BOOL) textView: (NSTextView *) textView - shouldChangeTextInRange: (NSRange) affectedCharRange - replacementString: (NSString *) replacementString; + shouldChangeTextInRange: (NSRange) affectedCharRange + replacementString: (NSString *) replacementString; @end diff --git a/AppKit/include/AppKit/NSToolbar.h b/AppKit/include/AppKit/NSToolbar.h index 63f1884e..6cc1b50c 100644 --- a/AppKit/include/AppKit/NSToolbar.h +++ b/AppKit/include/AppKit/NSToolbar.h @@ -23,8 +23,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSString, NSMutableArray, NSArray, NSDictionary, NSNotification, - NSMutableDictionary, NSWindow, NSView, NSToolbarItem, NSToolbarView, - NSToolbarCustomizationPalette; + NSMutableDictionary, NSWindow, NSView, NSToolbarItem, NSToolbarView, + NSToolbarCustomizationPalette; typedef enum { NSToolbarSizeModeDefault, @@ -114,8 +114,8 @@ typedef NSString *NSToolbarIdentifier; @optional - (NSToolbarItem *) toolbar: (NSToolbar *) toolbar - itemForItemIdentifier: (NSToolbarItemIdentifier) identifier - willBeInsertedIntoToolbar: (BOOL) flag; + itemForItemIdentifier: (NSToolbarItemIdentifier) identifier + willBeInsertedIntoToolbar: (BOOL) flag; - (NSArray *) toolbarDefaultItemIdentifiers: (NSToolbar *) toolbar; - (NSArray *) toolbarAllowedItemIdentifiers: (NSToolbar *) toolbar; diff --git a/AppKit/include/AppKit/NSToolbarItem.h b/AppKit/include/AppKit/NSToolbarItem.h index e53c2d33..223c0a2e 100644 --- a/AppKit/include/AppKit/NSToolbarItem.h +++ b/AppKit/include/AppKit/NSToolbarItem.h @@ -34,9 +34,9 @@ enum { typedef NSString *NSToolbarItemIdentifier; APPKIT_EXPORT const NSToolbarItemIdentifier - NSToolbarCustomizeToolbarItemIdentifier; + NSToolbarCustomizeToolbarItemIdentifier; APPKIT_EXPORT const NSToolbarItemIdentifier - NSToolbarFlexibleSpaceItemIdentifier; + NSToolbarFlexibleSpaceItemIdentifier; APPKIT_EXPORT const NSToolbarItemIdentifier NSToolbarPrintItemIdentifier; APPKIT_EXPORT const NSToolbarItemIdentifier NSToolbarSeparatorItemIdentifier; APPKIT_EXPORT const NSToolbarItemIdentifier NSToolbarShowColorsItemIdentifier; diff --git a/AppKit/include/AppKit/NSTouchBarItem.h b/AppKit/include/AppKit/NSTouchBarItem.h index adeab55e..956712e1 100644 --- a/AppKit/include/AppKit/NSTouchBarItem.h +++ b/AppKit/include/AppKit/NSTouchBarItem.h @@ -23,13 +23,13 @@ typedef NSString *NSTouchBarItemIdentifier; APPKIT_EXPORT NSTouchBarItemIdentifier const - NSTouchBarItemIdentifierFixedSpaceLarge; + NSTouchBarItemIdentifierFixedSpaceLarge; APPKIT_EXPORT NSTouchBarItemIdentifier const - NSTouchBarItemIdentifierFixedSpaceSmall; + NSTouchBarItemIdentifierFixedSpaceSmall; APPKIT_EXPORT NSTouchBarItemIdentifier const - NSTouchBarItemIdentifierFlexibleSpace; + NSTouchBarItemIdentifierFlexibleSpace; APPKIT_EXPORT NSTouchBarItemIdentifier const - NSTouchBarItemIdentifierOtherItemsProxy; + NSTouchBarItemIdentifierOtherItemsProxy; @interface NSTouchBarItem : NSObject diff --git a/AppKit/include/AppKit/NSTrackingArea.h b/AppKit/include/AppKit/NSTrackingArea.h index 398495c5..cc630eb3 100644 --- a/AppKit/include/AppKit/NSTrackingArea.h +++ b/AppKit/include/AppKit/NSTrackingArea.h @@ -78,12 +78,12 @@ typedef NSUInteger NSTrackingAreaOptions; // undocumented - (id) _initWithRect: (NSRect) rect - options: (NSTrackingAreaOptions) options - owner: (id) owner - userData: (void *) userData - retainUserData: (BOOL) retainUserData - isToolTip: (BOOL) isToolTip - isLegacy: (BOOL) legacy; + options: (NSTrackingAreaOptions) options + owner: (id) owner + userData: (void *) userData + retainUserData: (BOOL) retainUserData + isToolTip: (BOOL) isToolTip + isLegacy: (BOOL) legacy; //-(void)_setRect:(NSRect)rect; - (NSRect) _rectInWindow; diff --git a/AppKit/include/AppKit/NSTypesetter.h b/AppKit/include/AppKit/NSTypesetter.h index bb4ddac7..328da5ce 100644 --- a/AppKit/include/AppKit/NSTypesetter.h +++ b/AppKit/include/AppKit/NSTypesetter.h @@ -39,7 +39,7 @@ typedef enum { + (NSSize) printingAdjustmentInLayoutManager: (NSLayoutManager *) layoutManager forNominallySpacedGlyphRange: (NSRange) glyphRange packedGlyphs: - (const unsigned char *) packedGlyphs + (const unsigned char *) packedGlyphs count: (NSUInteger) count; + sharedSystemTypesetterForBehavior: (NSTypesetterBehavior) behavior; @@ -71,13 +71,13 @@ typedef enum { elasticBits: (BOOL *) elasticBits bidiLevels: (unsigned char *) bidiLevels; - (void) getLineFragmentRect: (NSRect *) fragmentRect - usedRect: (NSRect *) usedRect - remainingRect: (NSRect *) remainingRect - forStartingGlyphAtIndex: (NSUInteger) startingGlyphIndex - proposedRect: (NSRect) proposedRect - lineSpacing: (CGFloat) lineSpacing - paragraphSpacingBefore: (CGFloat) paragraphSpacingBefore - paragraphSpacingAfter: (CGFloat) paragraphSpacingAfter; + usedRect: (NSRect *) usedRect + remainingRect: (NSRect *) remainingRect + forStartingGlyphAtIndex: (NSUInteger) startingGlyphIndex + proposedRect: (NSRect) proposedRect + lineSpacing: (CGFloat) lineSpacing + paragraphSpacingBefore: (CGFloat) paragraphSpacingBefore + paragraphSpacingAfter: (CGFloat) paragraphSpacingAfter; - (void) setLineFragmentRect: (NSRect) fragmentRect forGlyphRange: (NSRange) glyphRange usedRect: (NSRect) usedRect @@ -85,8 +85,8 @@ typedef enum { - (void) substituteGlyphsInRange: (NSRange) glyphRange withGlyphs: (NSGlyph *) glyphs; - (void) insertGlyph: (NSGlyph) glyph - atGlyphIndex: (NSUInteger) glyphIndex - characterIndex: (NSUInteger) characterIndex; + atGlyphIndex: (NSUInteger) glyphIndex + characterIndex: (NSUInteger) characterIndex; - (void) deleteGlyphsInRange: (NSRange) glyphRange; - (void) setNotShownAttribute: (BOOL) flag forGlyphRange: (NSRange) range; @@ -94,8 +94,8 @@ typedef enum { - (void) setDrawsOutsideLineFragment: (BOOL) flag forGlyphRange: (NSRange) range; - (void) setLocation: (NSPoint) location - withAdvancements: (const CGFloat *) nominalAdvancements - forStartOfGlyphRange: (NSRange) glyphRange; + withAdvancements: (const CGFloat *) nominalAdvancements + forStartOfGlyphRange: (NSRange) glyphRange; - (void) setAttachmentSize: (NSSize) size forGlyphRange: (NSRange) glyphRange; - (void) setBidiLevels: (const unsigned char *) bidiLevels forGlyphRange: (NSRange) glyphRange; @@ -107,10 +107,10 @@ typedef enum { usedRect: (NSRect *) usedRect baselineOffset: (CGFloat *) baselineOffset; - (BOOL) shouldBreakLineByHyphenatingBeforeCharacterAtIndex: - (NSUInteger) characterIndex; + (NSUInteger) characterIndex; - (BOOL) shouldBreakLineByWordBeforeCharacterAtIndex: - (NSUInteger) characterIndex; + (NSUInteger) characterIndex; - (CGFloat) hyphenationFactorForGlyphAtIndex: (NSUInteger) glyphIndex; @@ -137,7 +137,7 @@ typedef enum { - (NSRange) paragraphSeparatorCharacterRange; - (NSRange) paragraphSeparatorGlyphRange; - (NSTypesetterControlCharacterAction) actionForControlCharacterAtIndex: - (NSUInteger) characterIndex; + (NSUInteger) characterIndex; - (NSFont *) substituteFontForFont: (NSFont *) font; - (void) setAttributedString: (NSAttributedString *) text; @@ -159,9 +159,9 @@ typedef enum { maxLocation: (CGFloat) maxLocation; - (void) getLineFragmentRect: (NSRect *) fragmentRect - usedRect: (NSRect *) usedRect - forParagraphSeparatorGlyphRange: (NSRange) glyphRange - atProposedOrigin: (NSPoint) proposedOrigin; + usedRect: (NSRect *) usedRect + forParagraphSeparatorGlyphRange: (NSRange) glyphRange + atProposedOrigin: (NSPoint) proposedOrigin; - (CGFloat) lineSpacingAfterGlyphAtIndex: (NSUInteger) glyphIndex withProposedLineFragmentRect: (NSRect) rect; diff --git a/AppKit/include/AppKit/NSUserDefaultsController.h b/AppKit/include/AppKit/NSUserDefaultsController.h index 9291c4fb..4f66f9bb 100644 --- a/AppKit/include/AppKit/NSUserDefaultsController.h +++ b/AppKit/include/AppKit/NSUserDefaultsController.h @@ -30,7 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + sharedUserDefaultsController; - initWithDefaults: (NSUserDefaults *) defaults - initialValues: (NSDictionary *) values; + initialValues: (NSDictionary *) values; - (NSUserDefaults *) defaults; - (NSDictionary *) initialValues; diff --git a/AppKit/include/AppKit/NSView.h b/AppKit/include/AppKit/NSView.h index a6047680..5f5e1bd4 100644 --- a/AppKit/include/AppKit/NSView.h +++ b/AppKit/include/AppKit/NSView.h @@ -27,8 +27,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSWindow, NSMenu, NSMenuItem, NSCursor, NSClipView, NSPasteboard, - NSTextInputContext, NSImage, NSBitmapImageRep, NSScrollView, NSTrackingArea, - NSShadow, NSScreen, CALayer, CIFilter, CALayerContext; + NSTextInputContext, NSImage, NSBitmapImageRep, NSScrollView, + NSTrackingArea, NSShadow, NSScreen, CALayer, CIFilter, CALayerContext; // See Cocoa Event Handling Guide : Using Tracking-Area Objects : Compatibility // Issues @@ -229,7 +229,7 @@ APPKIT_EXPORT const NSNotificationName NSViewGlobalFrameDidChangeNotification; - (void) replaceSubview: (NSView *) oldView with: (NSView *) newView; - (void) setSubviews: (NSArray *) newSubviews; - (void) sortSubviewsUsingFunction: - (NSComparisonResult (*)(id, id, void *)) compareFunction + (NSComparisonResult (*)(id, id, void *)) compareFunction context: (void *) context; - (void) didAddSubview: (NSView *) subview; - (void) willRemoveSubview: (NSView *) subview; @@ -319,7 +319,7 @@ APPKIT_EXPORT const NSNotificationName NSViewGlobalFrameDidChangeNotification; - (void) setLayerContentsPlacement: (NSViewLayerContentsPlacement) newPlacement; - (NSViewLayerContentsRedrawPolicy) layerContentsRedrawPolicy; - (void) setLayerContentsRedrawPolicy: - (NSViewLayerContentsRedrawPolicy) newPolicy; + (NSViewLayerContentsRedrawPolicy) newPolicy; - (CALayer *) makeBackingLayer; - (NSArray *) backgroundFilters; @@ -446,7 +446,7 @@ APPKIT_EXPORT const NSNotificationName NSViewGlobalFrameDidChangeNotification; @interface NSObject (NSView_toolTipOwner) - (NSString *) view: (NSView *) view - stringForToolTip: (NSToolTipTag) tag - point: (NSPoint) point - userData: (void *) data; + stringForToolTip: (NSToolTipTag) tag + point: (NSPoint) point + userData: (void *) data; @end diff --git a/AppKit/include/AppKit/NSWindow.h b/AppKit/include/AppKit/NSWindow.h index 59e0655a..09b5dd1f 100644 --- a/AppKit/include/AppKit/NSWindow.h +++ b/AppKit/include/AppKit/NSWindow.h @@ -27,10 +27,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSView, NSEvent, NSColor, NSColorSpace, NSCursor, NSImage, NSScreen, - NSText, NSTextView, CGWindow, NSPasteboard, NSSheetContext, NSUndoManager, - NSButton, NSButtonCell, NSDrawer, NSDockTile, NSToolbar, - NSWindowAnimationContext, NSTrackingArea, NSThemeFrame, NSWindowController, - NSMenuItem, CARenderer; + NSText, NSTextView, CGWindow, NSPasteboard, NSSheetContext, + NSUndoManager, NSButton, NSButtonCell, NSDrawer, NSDockTile, NSToolbar, + NSWindowAnimationContext, NSTrackingArea, NSThemeFrame, + NSWindowController, NSMenuItem, CARenderer; @protocol NSWindowDelegate; // Old NSWindowStyleMask constants @@ -253,7 +253,7 @@ APPKIT_EXPORT const NSNotificationName NSWindowDidExposeNotification; + (CGFloat) minFrameWidthWithTitle: (NSString *) title styleMask: (NSWindowStyleMask) styleMask; + (NSInteger) windowNumberAtPoint: (NSPoint) point - belowWindowWithWindowNumber: (NSInteger) window; + belowWindowWithWindowNumber: (NSInteger) window; + (NSArray *) windowNumbersWithOptions: (NSWindowNumberListOptions) options; + (void) removeFrameUsingName: (NSString *) name; @@ -582,8 +582,8 @@ APPKIT_EXPORT const NSNotificationName NSWindowDidExposeNotification; - (void) windowWillBeginSheet: (NSNotification *) note; - (void) windowDidEndSheet: (NSNotification *) note; - (NSRect) window: (NSWindow *) window - willPositionSheet: (NSWindow *) sheet - usingRect: (NSRect) rect; + willPositionSheet: (NSWindow *) sheet + usingRect: (NSRect) rect; - (void) windowDidChangeScreen: (NSNotification *) note; - (void) windowDidChangeScreenProfile: (NSNotification *) note; diff --git a/AppKit/include/AppKit/NSWorkspace.h b/AppKit/include/AppKit/NSWorkspace.h index 99798c13..08c85e6c 100644 --- a/AppKit/include/AppKit/NSWorkspace.h +++ b/AppKit/include/AppKit/NSWorkspace.h @@ -35,13 +35,13 @@ APPKIT_EXPORT NSString *const NSWorkspaceLaunchConfigurationArchitecture; APPKIT_EXPORT NSString *const NSWorkspaceActiveSpaceDidChangeNotification; APPKIT_EXPORT const NSNotificationName - NSWorkspaceDidDeactivateApplicationNotification; + NSWorkspaceDidDeactivateApplicationNotification; APPKIT_EXPORT NSString *const NSWorkspaceDidLaunchApplicationNotification; APPKIT_EXPORT NSString *const NSWorkspaceDidTerminateApplicationNotification; APPKIT_EXPORT const NSNotificationName - NSWorkspaceSessionDidBecomeActiveNotification; + NSWorkspaceSessionDidBecomeActiveNotification; APPKIT_EXPORT const NSNotificationName - NSWorkspaceSessionDidResignActiveNotification; + NSWorkspaceSessionDidResignActiveNotification; typedef NSUInteger NSWorkspaceIconCreationOptions; @@ -71,12 +71,12 @@ typedef NSUInteger NSWorkspaceIconCreationOptions; at: (NSPoint) point inView: (NSView *) view; - (BOOL) openFile: (NSString *) path - withApplication: (NSString *) application - andDeactivate: (BOOL) deactivate; + withApplication: (NSString *) application + andDeactivate: (BOOL) deactivate; - (BOOL) openURL: (NSURL *) url; - (BOOL) selectFile: (NSString *) path - inFileViewerRootedAtPath: (NSString *) rootedAtPath; + inFileViewerRootedAtPath: (NSString *) rootedAtPath; - (void) slideImage: (NSImage *) image from: (NSPoint) from to: (NSPoint) to; - (BOOL) performFileOperation: (NSString *) operation source: (NSString *) source @@ -130,7 +130,7 @@ typedef NSUInteger NSWorkspaceIconCreationOptions; options: (NSWorkspaceIconCreationOptions) options; - (void) activateFileViewerSelectingURLs: (NSArray *) fileURLs; - (NSURL *) URLForApplicationWithBundleIdentifier: - (NSString *) bundleIdentifier; + (NSString *) bundleIdentifier; - (NSString *) fullPathForApplication: (NSString *) appName; @end diff --git a/AppKit/nib.subproj/NSButtonImageSource.m b/AppKit/nib.subproj/NSButtonImageSource.m index fffaeb4e..ba46fc67 100644 --- a/AppKit/nib.subproj/NSButtonImageSource.m +++ b/AppKit/nib.subproj/NSButtonImageSource.m @@ -86,7 +86,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSImage *) alternateImage { NSString *name = [@"NSHighlighted" - stringByAppendingString: [_imageName substringFromIndex: 2]]; + stringByAppendingString: [_imageName substringFromIndex: 2]]; return [NSImage imageNamed: name]; } diff --git a/AppKit/nib.subproj/NSClassSwapper.m b/AppKit/nib.subproj/NSClassSwapper.m index 1949d18d..76a2524d 100644 --- a/AppKit/nib.subproj/NSClassSwapper.m +++ b/AppKit/nib.subproj/NSClassSwapper.m @@ -29,14 +29,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (id) initWithCoder: (NSCoder *) coder { _className = [[coder decodeObjectForKey: @"NSClassName"] retain]; _originalClassName = - [[coder decodeObjectForKey: @"NSOriginalClassName"] retain]; + [[coder decodeObjectForKey: @"NSOriginalClassName"] retain]; Class class = NSClassFromString(_className); if (class == Nil) { - [NSException - raise: NSInvalidArgumentException - format: @"NSClassSwapper is unable to find class %@", _className]; + [NSException raise: NSInvalidArgumentException + format: @"NSClassSwapper is unable to find class %@", + _className]; } _object = [class alloc]; diff --git a/AppKit/nib.subproj/NSCustomObject.m b/AppKit/nib.subproj/NSCustomObject.m index d8ec244a..3d30e6ea 100644 --- a/AppKit/nib.subproj/NSCustomObject.m +++ b/AppKit/nib.subproj/NSCustomObject.m @@ -42,22 +42,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (className) { _className = [[NSString alloc] - initWithBytesNoCopy: className - length: strlen(className) - encoding: NSNEXTSTEPStringEncoding - freeWhenDone: TRUE]; + initWithBytesNoCopy: className + length: strlen(className) + encoding: NSNEXTSTEPStringEncoding + freeWhenDone: TRUE]; } else _className = @"NSObject"; - NSString *mapped = - [NSUnarchiver classNameDecodedForArchiveClassName: _className]; + NSString *mapped = [NSUnarchiver + classNameDecodedForArchiveClassName: _className]; if (![mapped isEqualToString: _className]) { [_className release]; _className = [mapped copy]; } } else if (version <= 16 || version > 40) { - [coder - decodeValuesOfObjCTypes: "@@", &_className, &self->extension]; + [coder decodeValuesOfObjCTypes: "@@", &_className, + &self->extension]; } else { _className = [[coder decodeObject] retain]; } diff --git a/AppKit/nib.subproj/NSCustomView.m b/AppKit/nib.subproj/NSCustomView.m index cab76530..5e1b58f6 100644 --- a/AppKit/nib.subproj/NSCustomView.m +++ b/AppKit/nib.subproj/NSCustomView.m @@ -24,8 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (id) initWithCoder: (NSCoder *) coder { if ([coder allowsKeyedCoding]) { - NSString *className = - [(NSKeyedUnarchiver *) coder decodeObjectForKey: @"NSClassName"]; + NSString *className = [(NSKeyedUnarchiver *) coder + decodeObjectForKey: @"NSClassName"]; Class class = NSClassFromString(className); if (class == nil) { NSLog(@"NSCustomView unknown class %@", className); @@ -63,16 +63,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } [newView->_subviews - makeObjectsPerformSelector: @selector(_setSuperview:) - withObject: newView]; + makeObjectsPerformSelector: @selector(_setSuperview:) + withObject: newView]; [_subviews removeAllObjects]; - [newView - setWantsLayer: [coder - decodeBoolForKey: @"NSViewIsLayerTreeHost"]]; + [newView setWantsLayer: [coder decodeBoolForKey: + @"NSViewIsLayerTreeHost"]]; [newView setLayerContentsRedrawPolicy: - [coder decodeIntegerForKey: - @"NSViewLayerContentsRedrawPolicy"]]; + [coder decodeIntegerForKey: @"NSViewLayerContentsR" + @"edrawPolicy"]]; [self release]; return newView; } diff --git a/AppKit/nib.subproj/NSIBObjectData.m b/AppKit/nib.subproj/NSIBObjectData.m index 8c66f516..706e7caa 100644 --- a/AppKit/nib.subproj/NSIBObjectData.m +++ b/AppKit/nib.subproj/NSIBObjectData.m @@ -56,7 +56,7 @@ if ([coder allowsKeyedCoding]) { NSKeyedUnarchiver *keyed = (NSKeyedUnarchiver *) coder; NSMutableDictionary *nameTable = [NSMutableDictionary - dictionaryWithDictionary: [[keyed delegate] externalNameTable]]; + dictionaryWithDictionary: [[keyed delegate] externalNameTable]]; int i, count; id owner; @@ -69,7 +69,7 @@ _namesValues = [[keyed decodeObjectForKey: @"NSNamesValues"] retain]; count = [_namesValues count]; NSMutableArray *namedObjects = - [[keyed decodeObjectForKey: @"NSNamesKeys"] mutableCopy]; + [[keyed decodeObjectForKey: @"NSNamesKeys"] mutableCopy]; for (i = 0; i < count; i++) { NSString *check = [_namesValues objectAtIndex: i]; id external = [nameTable objectForKey: check]; @@ -102,26 +102,26 @@ } } - _accessibilityConnectors = - [[keyed decodeObjectForKey: @"NSAccessibilityConnectors"] retain]; + _accessibilityConnectors = [[keyed + decodeObjectForKey: @"NSAccessibilityConnectors"] retain]; _accessibilityOidsKeys = - [[keyed decodeObjectForKey: @"NSAccessibilityOidsKeys"] retain]; - _accessibilityOidsValues = - [[keyed decodeObjectForKey: @"NSAccessibilityOidsValues"] retain]; + [[keyed decodeObjectForKey: @"NSAccessibilityOidsKeys"] retain]; + _accessibilityOidsValues = [[keyed + decodeObjectForKey: @"NSAccessibilityOidsValues"] retain]; _classesKeys = [[keyed decodeObjectForKey: @"NSClassesKeys"] retain]; _classesValues = - [[keyed decodeObjectForKey: @"NSClassesValues"] retain]; + [[keyed decodeObjectForKey: @"NSClassesValues"] retain]; _connections = [[keyed decodeObjectForKey: @"NSConnections"] retain]; _fontManager = [[keyed decodeObjectForKey: @"NSFontManager"] retain]; _framework = [[keyed decodeObjectForKey: @"NSFramework"] retain]; _nextOid = [keyed decodeIntForKey: @"NSNextOid"]; _objectsKeys = [[keyed decodeObjectForKey: @"NSObjectsKeys"] retain]; _objectsValues = - [[keyed decodeObjectForKey: @"NSObjectsValues"] retain]; + [[keyed decodeObjectForKey: @"NSObjectsValues"] retain]; _oidKeys = [[keyed decodeObjectForKey: @"NSOidsKeys"] retain]; _oidValues = [[keyed decodeObjectForKey: @"NSOidsValues"] retain]; _visibleWindows = - [[keyed decodeObjectForKey: @"NSVisibleWindows"] retain]; + [[keyed decodeObjectForKey: @"NSVisibleWindows"] retain]; // Replace any custom object with the real thing - and update anything // tracking them @@ -142,8 +142,8 @@ _objectsKeys = [_objectsKeys mutableCopy]; } [(NSMutableArray *) _objectsKeys - replaceObjectAtIndex: i - withObject: replacement]; + replaceObjectAtIndex: i + withObject: replacement]; [replacement release]; } } @@ -162,9 +162,9 @@ // read version 0 NSMutableArray *keys = - [[NSMutableArray alloc] initWithCapacity: count]; + [[NSMutableArray alloc] initWithCapacity: count]; NSMutableArray *values = - [[NSMutableArray alloc] initWithCapacity: count]; + [[NSMutableArray alloc] initWithCapacity: count]; NSMutableSet *keySet = [[NSMutableSet alloc] init]; for (int i = 0; i < count; i++) { @@ -208,10 +208,10 @@ [coder decodeValuesOfObjCTypes: "@*", &key, &string]; // The string encoding is a guess - nss = - [[NSString alloc] initWithBytes: string - length: strlen(string) - encoding: NSNEXTSTEPStringEncoding]; + nss = [[NSString alloc] + initWithBytes: string + length: strlen(string) + encoding: NSNEXTSTEPStringEncoding]; [keys addObject: key]; [values addObject: nss]; @@ -244,7 +244,7 @@ [coder decodeValueOfObjCType: @encode(int) at: &count]; NSObject **connections = - (NSObject **) malloc(sizeof(NSObject *) * count); + (NSObject **) malloc(sizeof(NSObject *) * count); [coder decodeArrayOfObjCType: @encode(id) count: count @@ -257,9 +257,9 @@ [coder decodeValueOfObjCType: @encode(id) at: &_fontManager]; } else { NSMutableArray *keys = - [[NSMutableArray alloc] initWithCapacity: count]; + [[NSMutableArray alloc] initWithCapacity: count]; NSMutableArray *values = - [[NSMutableArray alloc] initWithCapacity: count]; + [[NSMutableArray alloc] initWithCapacity: count]; for (int i = 0; i < count; i++) { NSMenuItem *key; @@ -336,7 +336,7 @@ if (![_oidKeys containsObject: _fileOwner]) { [(NSMutableArray *) _oidKeys addObject: _fileOwner]; [(NSMutableArray *) _oidValues - addObject: [NSNumber numberWithInt: _nextOid++]]; + addObject: [NSNumber numberWithInt: _nextOid++]]; } for (NSInteger i = 0; i < [_objectsKeys count]; i++) { @@ -347,7 +347,7 @@ if (![_oidKeys containsObject: key]) { [(NSMutableArray *) _oidKeys addObject: key]; [(NSMutableArray *) _oidValues - addObject: [NSNumber numberWithInt: _nextOid++]]; + addObject: [NSNumber numberWithInt: _nextOid++]]; } } @@ -356,7 +356,7 @@ if (![_oidKeys containsObject: conn]) { [(NSMutableArray *) _oidKeys addObject: conn]; [(NSMutableArray *) _oidValues - addObject: [NSNumber numberWithInt: _nextOid++]]; + addObject: [NSNumber numberWithInt: _nextOid++]]; } } } @@ -436,8 +436,8 @@ id aValue = [_objectsValues objectAtIndex: i]; if (aValue == formerOwner) { [(NSMutableArray *) _objectsValues - replaceObjectAtIndex: i - withObject: _fileOwner]; + replaceObjectAtIndex: i + withObject: _fileOwner]; } } } diff --git a/AppKit/nib.subproj/NSIBUserDefinedRuntimeAttributesConnector.m b/AppKit/nib.subproj/NSIBUserDefinedRuntimeAttributesConnector.m index 12528eb4..e72b6d25 100644 --- a/AppKit/nib.subproj/NSIBUserDefinedRuntimeAttributesConnector.m +++ b/AppKit/nib.subproj/NSIBUserDefinedRuntimeAttributesConnector.m @@ -6,7 +6,7 @@ - (id) initWithCoder: (NSCoder *) decoder { _object = [[decoder decodeObjectForKey: @"NSObject"] retain]; _keyPaths = - [[[decoder decodeObjectForKey: @"NSKeyPaths"] mutableCopy] retain]; + [[[decoder decodeObjectForKey: @"NSKeyPaths"] mutableCopy] retain]; _values = [[[decoder decodeObjectForKey: @"NSValues"] mutableCopy] retain]; return self; } diff --git a/AppKit/nib.subproj/NSNib.m b/AppKit/nib.subproj/NSNib.m index 47f9f88f..c0aaa6dc 100644 --- a/AppKit/nib.subproj/NSNib.m +++ b/AppKit/nib.subproj/NSNib.m @@ -77,13 +77,13 @@ NSString *const NSNibTopLevelObjects = @"NSNibTopLevelObjects"; } if (isDirectory) { objects = [[path stringByAppendingPathComponent: @"keyedobjects"] - stringByAppendingPathExtension: @"nib"]; + stringByAppendingPathExtension: @"nib"]; if ([[NSFileManager defaultManager] fileExistsAtPath: objects]) _flags._isKeyed = TRUE; else objects = [[path stringByAppendingPathComponent: @"objects"] - stringByAppendingPathExtension: @"nib"]; + stringByAppendingPathExtension: @"nib"]; } else { // FIXME: Should we try to infer keyed-ness form the file itself in this // case? @@ -149,8 +149,8 @@ NSString *const NSNibTopLevelObjects = @"NSNibTopLevelObjects"; } - (void) unarchiver: (NSKeyedUnarchiver *) unarchiver - willReplaceObject: object - withObject: replacement + willReplaceObject: object + withObject: replacement { if (object != nil && replacement != nil) { NSUInteger index = [_allObjects indexOfObjectIdenticalTo: object]; @@ -179,7 +179,7 @@ NSString *const NSNibTopLevelObjects = @"NSNibTopLevelObjects"; if (_flags._isKeyed) { NSKeyedUnarchiver *keyed; unarchiver = keyed = [[[NSKeyedUnarchiver alloc] - initForReadingWithData: _data] autorelease]; + initForReadingWithData: _data] autorelease]; [keyed setDelegate: self]; /* @@ -188,15 +188,15 @@ NSString *const NSNibTopLevelObjects = @"NSNibTopLevelObjects"; - misaligned objects in boxes everywhere */ [keyed setClass: [NSTableCornerView class] - forClassName: @"_NSCornerView"]; + forClassName: @"_NSCornerView"]; [keyed setClass: [NSNibHelpConnector class] - forClassName: @"NSIBHelpConnector"]; + forClassName: @"NSIBHelpConnector"]; objectData = [keyed decodeObjectForKey: @"IB.objectdata"]; } else { NSUnarchiver *unkeyed; unarchiver = unkeyed = [[[NSUnarchiver alloc] - initForReadingWithData: _data] autorelease]; + initForReadingWithData: _data] autorelease]; [unkeyed decodeClassName: @"_NSCornerView" asClassName: @"NSTableCornerView"]; @@ -212,7 +212,8 @@ NSString *const NSNibTopLevelObjects = @"NSNibTopLevelObjects"; if ([menu numberOfItems] > 0) { NSMenuItem *firstItem = [menu itemAtIndex: 0]; NSString *appName = [[NSBundle mainBundle] - objectForInfoDictionaryKey: (NSString *) kCFBundleNameKey]; + objectForInfoDictionaryKey: (NSString *) + kCFBundleNameKey]; [firstItem setTitle: appName]; } [NSApp setMainMenu: menu]; @@ -229,7 +230,7 @@ NSString *const NSNibTopLevelObjects = @"NSNibTopLevelObjects"; // objects, if ([_nameTable objectForKey: NSNibTopLevelObjects]) { [[_nameTable objectForKey: NSNibTopLevelObjects] - setArray: topLevelObjects]; + setArray: topLevelObjects]; } // We do not need to add the objects from nameTable to allObjects as @@ -253,8 +254,8 @@ NSString *const NSNibTopLevelObjects = @"NSNibTopLevelObjects"; } [[objectData visibleWindows] - makeObjectsPerformSelector: @selector(makeKeyAndOrderFront:) - withObject: nil]; + makeObjectsPerformSelector: @selector(makeKeyAndOrderFront:) + withObject: nil]; [_nameTable release]; _nameTable = nil; @@ -268,10 +269,10 @@ NSString *const NSNibTopLevelObjects = @"NSNibTopLevelObjects"; NIBDEBUG(@"instantiateNibWithOwner: %@ topLevelObjects: ", owner); NSMutableArray *topLevelObjects = - (objects != NULL ? [[NSMutableArray alloc] init] : nil); + (objects != NULL ? [[NSMutableArray alloc] init] : nil); NSDictionary *nameTable = [NSDictionary - dictionaryWithObjectsAndKeys: owner, NSNibOwner, topLevelObjects, - NSNibTopLevelObjects, nil]; + dictionaryWithObjectsAndKeys: owner, NSNibOwner, topLevelObjects, + NSNibTopLevelObjects, nil]; BOOL result = [self instantiateNibWithExternalNameTable: nameTable]; if (objects != NULL) { diff --git a/AppKit/nib.subproj/NSNibBindingConnector.m b/AppKit/nib.subproj/NSNibBindingConnector.m index 86d261c0..7821bfaf 100644 --- a/AppKit/nib.subproj/NSNibBindingConnector.m +++ b/AppKit/nib.subproj/NSNibBindingConnector.m @@ -51,8 +51,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // _binding, [_destination className], _keyPath,_options); [_source bind: _binding - toObject: _destination - withKeyPath: _keyPath - options: _options]; + toObject: _destination + withKeyPath: _keyPath + options: _options]; } @end diff --git a/AppKit/nib.subproj/NSNibControlConnector.m b/AppKit/nib.subproj/NSNibControlConnector.m index 50a12356..3f284c48 100644 --- a/AppKit/nib.subproj/NSNibControlConnector.m +++ b/AppKit/nib.subproj/NSNibControlConnector.m @@ -34,9 +34,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (selector == NULL) [NSException - raise: NSInvalidArgumentException - format: @"-[%@ %s] selector %@ does not exist:", [self class], - sel_getName(_cmd), selectorName]; + raise: NSInvalidArgumentException + format: @"-[%@ %s] selector %@ does not exist:", [self class], + sel_getName(_cmd), selectorName]; if ([_source respondsToSelector: @selector(setAction:)]) [_source setAction: selector]; diff --git a/AppKit/nib.subproj/NSNibLoading.m b/AppKit/nib.subproj/NSNibLoading.m index 53fe0077..49ff5b18 100644 --- a/AppKit/nib.subproj/NSNibLoading.m +++ b/AppKit/nib.subproj/NSNibLoading.m @@ -59,8 +59,8 @@ static NSMutableArray *_nibPaths(void) { @implementation NSBundle (NSNibLoading) + (BOOL) loadNibFile: (NSString *) path - externalNameTable: (NSDictionary *) nameTable - withZone: (NSZone *) zone + externalNameTable: (NSDictionary *) nameTable + withZone: (NSZone *) zone { NIBDEBUG(@"+ loadNibFile: '%@' externalNameTable: withZone:", path); @@ -69,7 +69,7 @@ static NSMutableArray *_nibPaths(void) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSNib *nib = [[[NSNib allocWithZone: zone] initWithContentsOfFile: path] - autorelease]; + autorelease]; BOOL result = [nib instantiateNibWithExternalNameTable: nameTable]; [pool release]; @@ -91,8 +91,8 @@ static NSMutableArray *_nibPaths(void) { } - (BOOL) loadNibFile: (NSString *) fileName - externalNameTable: (NSDictionary *) nameTable - withZone: (NSZone *) zone + externalNameTable: (NSDictionary *) nameTable + withZone: (NSZone *) zone { NSAutoreleasePool *pool = [NSAutoreleasePool new]; @@ -105,7 +105,7 @@ static NSMutableArray *_nibPaths(void) { name = [name stringByDeletingPathExtension]; NSBundle *bundle = self; NSString *platformName = [name - stringByAppendingFormat: @"-%@", NSPlatformResourceNameSuffix]; + stringByAppendingFormat: @"-%@", NSPlatformResourceNameSuffix]; path = [bundle pathForResource: platformName ofType: @"nib"]; if (path == nil) @@ -127,7 +127,7 @@ static NSMutableArray *_nibPaths(void) { [NSBundle pushNibLoadingBundle: self]; NSNib *nib = [[[NSNib allocWithZone: zone] initWithContentsOfFile: path] - autorelease]; + autorelease]; BOOL result = [nib instantiateNibWithExternalNameTable: nameTable]; [pool release]; @@ -139,8 +139,8 @@ static NSMutableArray *_nibPaths(void) { } - (BOOL) loadNibNamed: (NSString *) name - owner: (id) owner - topLevelObjects: (NSArray **) topLevelObjects + owner: (id) owner + topLevelObjects: (NSArray **) topLevelObjects { [NSBundle pushNibPath: [self pathForResource: name ofType: @"nib"]]; [NSBundle pushNibLoadingBundle: self]; @@ -189,9 +189,9 @@ static NSMutableArray *_nibPaths(void) { } + (BOOL) _loadNibFile: (id) file - externalNameTable: (id) tableName - options: (id) options - withZone: (struct _NSZone *) zone + externalNameTable: (id) tableName + options: (id) options + withZone: (struct _NSZone *) zone { // TODO: work with options return [NSBundle loadNibFile: file @@ -200,9 +200,9 @@ static NSMutableArray *_nibPaths(void) { } - (BOOL) loadNibFile: (id) file - externalNameTable: (id) tableName - options: (id) options - withZone: (struct _NSZone *) zone + externalNameTable: (id) tableName + options: (id) options + withZone: (struct _NSZone *) zone { // TODO: work with options return [self loadNibFile: file externalNameTable: tableName withZone: zone]; diff --git a/AppKit/nib.subproj/NSNibOutletConnector.m b/AppKit/nib.subproj/NSNibOutletConnector.m index 4c03ca70..38da0561 100644 --- a/AppKit/nib.subproj/NSNibOutletConnector.m +++ b/AppKit/nib.subproj/NSNibOutletConnector.m @@ -24,9 +24,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) establishConnection { NSString *methodName = [NSString - stringWithFormat: @"set%@%@:", - [[_label substringToIndex: 1] uppercaseString], - [_label substringFromIndex: 1]]; + stringWithFormat: @"set%@%@:", + [[_label substringToIndex: 1] uppercaseString], + [_label substringFromIndex: 1]]; SEL selector = NSSelectorFromString(methodName); if (selector != NULL) diff --git a/AppKit/nib.subproj/NSWindowTemplate.m b/AppKit/nib.subproj/NSWindowTemplate.m index 2865aab6..929acf5a 100644 --- a/AppKit/nib.subproj/NSWindowTemplate.m +++ b/AppKit/nib.subproj/NSWindowTemplate.m @@ -36,7 +36,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _maxSize = [keyed decodeSizeForKey: @"NSMaxSize"]; _minSize = [keyed decodeSizeForKey: @"NSMinSize"]; _screenRect = - [keyed decodeRectForKey: @"NSScreenRect"]; // screen created on + [keyed decodeRectForKey: @"NSScreenRect"]; // screen created on _viewClass = [[keyed decodeObjectForKey: @"NSViewClass"] retain]; _wtFlags = [keyed decodeIntForKey: @"NSWTFlags"]; _windowBacking = [keyed decodeIntForKey: @"NSWindowBacking"]; @@ -46,15 +46,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _windowTitle = [[keyed decodeObjectForKey: @"NSWindowTitle"] retain]; _windowView = [[keyed decodeObjectForKey: @"NSWindowView"] retain]; _windowAutosave = - [[keyed decodeObjectForKey: @"NSFrameAutosaveName"] retain]; + [[keyed decodeObjectForKey: @"NSFrameAutosaveName"] retain]; if ([NSScreen mainScreen]) _windowRect.origin.y -= _screenRect.size.height - [[NSScreen mainScreen] frame].size.height; if ([NSClassFromString(_windowClass) - hasMainMenuForStyleMask: _windowStyleMask]) + hasMainMenuForStyleMask: _windowStyleMask]) _windowRect.origin.y -= [NSMainMenuView - menuHeight]; // compensation for the additional menu bar + menuHeight]; // compensation for the additional menu bar } else { [NSException raise: NSInvalidArgumentException format: @"%@ can not initWithCoder:%@", [self class], @@ -79,9 +79,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ((class = NSClassFromString(_windowClass)) == Nil) { [NSException - raise: NSInvalidArgumentException - format: @"Unable to locate NSWindow class %@, using NSWindow", - _windowClass]; + raise: NSInvalidArgumentException + format: @"Unable to locate NSWindow class %@, using NSWindow", + _windowClass]; class = [NSWindow class]; } defer = (_wtFlags & 0x20000000) ? YES : NO; diff --git a/CFNetwork/CFHost.m b/CFNetwork/CFHost.m index 14236a53..00412489 100644 --- a/CFNetwork/CFHost.m +++ b/CFNetwork/CFHost.m @@ -96,9 +96,9 @@ static int preXP_getaddrinfo(const char *host, const char *service, addr_list = (uint32_t **) hp->h_addr_list; for (; *addr_list != NULL; addr_list++) { struct addrinfo *node = - NSZoneCalloc(NULL, 1, sizeof(struct addrinfo)); + NSZoneCalloc(NULL, 1, sizeof(struct addrinfo)); struct sockaddr_in *ipv4 = - NSZoneCalloc(NULL, 1, sizeof(struct sockaddr_in)); + NSZoneCalloc(NULL, 1, sizeof(struct sockaddr_in)); node->ai_family = AF_INET; node->ai_addrlen = sizeof(struct sockaddr_in); @@ -136,7 +136,7 @@ static int any_getaddrinfo(const char *host, const char *service, { HANDLE library = LoadLibrary("WS2_32"); typeof(getaddrinfo) *function = - (typeof(getaddrinfo) *) GetProcAddress(library, "getaddrinfo"); + (typeof(getaddrinfo) *) GetProcAddress(library, "getaddrinfo"); if (function == NULL) { return preXP_getaddrinfo(host, service, hints, result); @@ -148,7 +148,7 @@ static int any_getaddrinfo(const char *host, const char *service, static void any_freeaddrinfo(struct addrinfo *info) { HANDLE library = LoadLibrary("WS2_32"); typeof(freeaddrinfo) *function = - (typeof(freeaddrinfo) *) GetProcAddress(library, "freeaddrinfo"); + (typeof(freeaddrinfo) *) GetProcAddress(library, "freeaddrinfo"); if (function == NULL) { return preXP_freeaddrinfo(info); @@ -260,8 +260,8 @@ static __stdcall unsigned addressResolverThread(void *arg) { for (; check != NULL; check = next) { next = check->ai_next; - CFDataRef data = - CFDataCreate(NULL, (void *) check->ai_addr, check->ai_addrlen); + CFDataRef data = CFDataCreate(NULL, (void *) check->ai_addr, + check->ai_addrlen); CFArrayAppendValue(_addressing, data); CFRelease(data); @@ -295,7 +295,7 @@ static CFAddressResolverThreadInfo *startResolverThreadIfNeeded() { asyncInfo->queueCapacity = 1; asyncInfo->queueCount = 0; asyncInfo->queue = NSZoneMalloc(NULL, sizeof(CFHostRequest *) * - asyncInfo->queueCapacity); + asyncInfo->queueCapacity); unsigned threadAddr; _beginthreadex(NULL, 0, addressResolverThread, asyncInfo, 0, @@ -328,9 +328,9 @@ static void queueHostToAddressResolver(CFHostRef host) { EnterCriticalSection(&(info->queueLock)); if (info->queueCount + 1 >= info->queueCapacity) { info->queueCapacity *= 2; - info->queue = - NSZoneRealloc(NULL, info->queue, - sizeof(CFHostRequest *) * info->queueCapacity); + info->queue = NSZoneRealloc(NULL, info->queue, + sizeof(CFHostRequest *) * + info->queueCapacity); } info->queue[info->queueCount++] = host->_request; LeaveCriticalSection(&(info->queueLock)); @@ -461,7 +461,7 @@ Boolean CFHostSetClient(CFHostRef self, CFHostClientCallBack callback, if (self->_callback != NULL) { if (self->_context.info != NULL && self->_context.retain != NULL) self->_context.info = - (void *) self->_context.retain(self->_context.info); + (void *) self->_context.retain(self->_context.info); } return TRUE; @@ -472,7 +472,7 @@ static void CFHostCreateEventIfNeeded(CFHostRef self) { if (self->_event == NULL) { self->_event = CreateEvent(NULL, FALSE, FALSE, NULL); self->_monitor = [[NSHandleMonitor_win32 - handleMonitorWithHandle: self->_event] retain]; + handleMonitorWithHandle: self->_event] retain]; [self->_monitor setDelegate: self]; [self->_monitor setCurrentActivity: Win32HandleSignaled]; } @@ -531,11 +531,10 @@ Boolean CFHostStartInfoResolution(CFHostRef self, CFHostInfoType infoType, return FALSE; default: - [NSException - raise: NSInvalidArgumentException - format: - @"CFHostStartInfoResolution CFHostInfoType is not valid (%d)", - infoType]; + [NSException raise: NSInvalidArgumentException + format: @"CFHostStartInfoResolution CFHostInfoType is not " + @"valid (%d)", + infoType]; return FALSE; } } @@ -556,11 +555,10 @@ void CFHostCancelInfoResolution(CFHostRef self, CFHostInfoType infoType) { break; default: - [NSException - raise: NSInvalidArgumentException - format: - @"CFHostCancelInfoResolution CFHostInfoType is not valid (%d)", - infoType]; + [NSException raise: NSInvalidArgumentException + format: @"CFHostCancelInfoResolution CFHostInfoType is not " + @"valid (%d)", + infoType]; break; } } diff --git a/CFNetwork/CFSocketStream.m b/CFNetwork/CFSocketStream.m index 8a7f7f1f..c50cca88 100644 --- a/CFNetwork/CFSocketStream.m +++ b/CFNetwork/CFSocketStream.m @@ -4,60 +4,60 @@ /************* These values are also in NSStream, keep in sync */ const CFStringRef kCFStreamPropertyShouldCloseNativeSocket = - (CFStringRef) @"kCFStreamPropertyShouldCloseNativeSocket"; + (CFStringRef) @"kCFStreamPropertyShouldCloseNativeSocket"; const CFStringRef kCFStreamPropertySocketSecurityLevel = - (CFStringRef) @"kCFStreamPropertySocketSecurityLevel"; + (CFStringRef) @"kCFStreamPropertySocketSecurityLevel"; const CFStringRef kCFStreamPropertySOCKSProxy = - (CFStringRef) @"kCFStreamPropertySOCKSProxy"; + (CFStringRef) @"kCFStreamPropertySOCKSProxy"; const CFStringRef kCFStreamPropertySSLPeerCertificates = - (CFStringRef) @"kCFStreamPropertySSLPeerCertificates"; + (CFStringRef) @"kCFStreamPropertySSLPeerCertificates"; const CFStringRef kCFStreamPropertySSLPeerTrust = - (CFStringRef) @"kCFStreamPropertySSLPeerTrust"; + (CFStringRef) @"kCFStreamPropertySSLPeerTrust"; const CFStringRef kCFStreamPropertySSLSettings = - (CFStringRef) @"kCFStreamPropertySSLSettings"; + (CFStringRef) @"kCFStreamPropertySSLSettings"; const CFStringRef kCFStreamPropertyProxyLocalByPass = - (CFStringRef) @"kCFStreamPropertyProxyLocalByPass"; + (CFStringRef) @"kCFStreamPropertyProxyLocalByPass"; const CFStringRef kCFStreamPropertySocketRemoteHost = - (CFStringRef) @"kCFStreamPropertySocketRemoteHost"; + (CFStringRef) @"kCFStreamPropertySocketRemoteHost"; const CFStringRef kCFStreamPropertySocketRemoteNetService = - (CFStringRef) @"kCFStreamPropertySocketRemoteNetService"; + (CFStringRef) @"kCFStreamPropertySocketRemoteNetService"; const CFStringRef kCFStreamSSLLevel = (CFStringRef) @"kCFStreamSSLLevel"; const CFStringRef kCFStreamSSLAllowsExpiredCertificates = - (CFStringRef) @"kCFStreamSSLAllowsExpiredCertificates"; + (CFStringRef) @"kCFStreamSSLAllowsExpiredCertificates"; const CFStringRef kCFStreamSSLAllowsExpiredRoots = - (CFStringRef) @"kCFStreamSSLAllowsExpiredRoots"; + (CFStringRef) @"kCFStreamSSLAllowsExpiredRoots"; const CFStringRef kCFStreamSSLAllowsAnyRoot = - (CFStringRef) @"kCFStreamSSLAllowsAnyRoot"; + (CFStringRef) @"kCFStreamSSLAllowsAnyRoot"; const CFStringRef kCFStreamSSLValidatesCertificateChain = - (CFStringRef) @"kCFStreamSSLValidatesCertificateChain"; + (CFStringRef) @"kCFStreamSSLValidatesCertificateChain"; const CFStringRef kCFStreamSSLPeerName = (CFStringRef) @"kCFStreamSSLPeerName"; const CFStringRef kCFStreamSSLCertificates = - (CFStringRef) @"kCFStreamSSLCertificates"; + (CFStringRef) @"kCFStreamSSLCertificates"; const CFStringRef kCFStreamSSLIsServer = (CFStringRef) @"kCFStreamSSLIsServer"; const CFStringRef kCFStreamSocketSecurityLevelNone = - (CFStringRef) @"kCFStreamSocketSecurityLevelNone"; + (CFStringRef) @"kCFStreamSocketSecurityLevelNone"; const CFStringRef kCFStreamSocketSecurityLevelSSLv2 = - (CFStringRef) @"kCFStreamSocketSecurityLevelSSLv2"; + (CFStringRef) @"kCFStreamSocketSecurityLevelSSLv2"; const CFStringRef kCFStreamSocketSecurityLevelSSLv3 = - (CFStringRef) @"kCFStreamSocketSecurityLevelSSLv3"; + (CFStringRef) @"kCFStreamSocketSecurityLevelSSLv3"; const CFStringRef kCFStreamSocketSecurityLevelTLSv1 = - (CFStringRef) @"kCFStreamSocketSecurityLevelTLSv1"; + (CFStringRef) @"kCFStreamSocketSecurityLevelTLSv1"; const CFStringRef kCFStreamSocketSecurityLevelNegotiatedSSL = - (CFStringRef) @"kCFStreamSocketSecurityLevelNegotiatedSSL"; + (CFStringRef) @"kCFStreamSocketSecurityLevelNegotiatedSSL"; const CFStringRef kCFStreamPropertySOCKSProxyHost = - (CFStringRef) @"kCFStreamPropertySOCKSProxyHost"; + (CFStringRef) @"kCFStreamPropertySOCKSProxyHost"; const CFStringRef kCFStreamPropertySOCKSProxyPort = - (CFStringRef) @"kCFStreamPropertySOCKSProxyPort"; + (CFStringRef) @"kCFStreamPropertySOCKSProxyPort"; const CFStringRef kCFStreamPropertySOCKSVersion = - (CFStringRef) @"kCFStreamPropertySOCKSVersion"; + (CFStringRef) @"kCFStreamPropertySOCKSVersion"; const CFStringRef kCFStreamSocketSOCKSVersion4 = - (CFStringRef) @"kCFStreamSocketSOCKSVersion4"; + (CFStringRef) @"kCFStreamSocketSOCKSVersion4"; const CFStringRef kCFStreamSocketSOCKSVersion5 = - (CFStringRef) @"kCFStreamSocketSOCKSVersion5"; + (CFStringRef) @"kCFStreamSocketSOCKSVersion5"; const CFStringRef kCFStreamPropertySOCKSUser = - (CFStringRef) @"kCFStreamPropertySOCKSUser"; + (CFStringRef) @"kCFStreamPropertySOCKSUser"; const CFStringRef kCFStreamPropertySOCKSPassword = - (CFStringRef) @"kCFStreamPropertySOCKSPassword"; + (CFStringRef) @"kCFStreamPropertySOCKSPassword"; diff --git a/CFSSLHandler_openssl/CFSSLHandler_openssl.m b/CFSSLHandler_openssl/CFSSLHandler_openssl.m index 61a132ee..6974e87b 100644 --- a/CFSSLHandler_openssl/CFSSLHandler_openssl.m +++ b/CFSSLHandler_openssl/CFSSLHandler_openssl.m @@ -71,7 +71,7 @@ static threadid_func(CRYPTO_THREADID *id){ _method = SSLv23_client_method(); CFNumberRef validatesCertChain = CFDictionaryGetValue( - _properties, kCFStreamSSLValidatesCertificateChain); + _properties, kCFStreamSSLValidatesCertificateChain); if (validatesCertChain != NULL) { } @@ -274,9 +274,9 @@ static threadid_func(CRYPTO_THREADID *id){ if ((check = [self writeEncrypted: _stableBuffer maxLength: result]) != result) { - NSCLog( - "[sslHandler writeEncrypted:socketBuffer maxLength:%d] failed %d", - result, check); + NSCLog("[sslHandler writeEncrypted:socketBuffer maxLength:%d] failed " + "%d", + result, check); } return result; diff --git a/CoreData/NSAtomicStore.m b/CoreData/NSAtomicStore.m index a01cbc99..8bad3961 100644 --- a/CoreData/NSAtomicStore.m +++ b/CoreData/NSAtomicStore.m @@ -10,7 +10,7 @@ @implementation NSAtomicStore - initWithPersistentStoreCoordinator: - (NSPersistentStoreCoordinator *) coordinator + (NSPersistentStoreCoordinator *) coordinator configurationName: (NSString *) configurationName URL: (NSURL *) url options: (NSDictionary *) options @@ -59,26 +59,26 @@ } - (NSAtomicStoreCacheNode *) cacheNodeForObjectID: - (NSManagedObjectID *) objectID + (NSManagedObjectID *) objectID { NSAtomicStoreCacheNode *result = - [_objectIDToCacheNode objectForKey: objectID]; + [_objectIDToCacheNode objectForKey: objectID]; return result; } - (NSAtomicStoreCacheNode *) newCacheNodeForManagedObject: - (NSManagedObject *) managedObject + (NSManagedObject *) managedObject { return [[NSAtomicStoreCacheNode alloc] - initWithObjectID: [managedObject objectID]]; + initWithObjectID: [managedObject objectID]]; } - (NSManagedObjectID *) objectIDForEntity: (NSEntityDescription *) entity referenceObject: referenceObject { NSMutableDictionary *refTable = - [_objectIDTable objectForKey: [entity name]]; + [_objectIDTable objectForKey: [entity name]]; if (refTable == nil) { refTable = [NSMutableDictionary dictionary]; @@ -88,8 +88,8 @@ NSManagedObjectID *result = [refTable objectForKey: referenceObject]; if (result == nil) { - result = - [[[NSManagedObjectID alloc] initWithEntity: entity] autorelease]; + result = [[[NSManagedObjectID alloc] initWithEntity: entity] + autorelease]; [result setReferenceObject: referenceObject]; [result setStoreIdentifier: [self identifier]]; @@ -104,7 +104,7 @@ - (void) _uniqueObjectID: (NSManagedObjectID *) objectID { NSEntityDescription *entity = [objectID entity]; NSMutableDictionary *refTable = - [_objectIDTable objectForKey: [entity name]]; + [_objectIDTable objectForKey: [entity name]]; if (refTable == nil) { refTable = [NSMutableDictionary dictionary]; @@ -129,7 +129,7 @@ } - (void) updateCacheNode: (NSAtomicStoreCacheNode *) node - fromManagedObject: (NSManagedObject *) managedObject + fromManagedObject: (NSManagedObject *) managedObject { NSInvalidAbstractInvocation(); } diff --git a/CoreData/NSAttributeDescription.m b/CoreData/NSAttributeDescription.m index d92ba4c2..5c35f0c3 100644 --- a/CoreData/NSAttributeDescription.m +++ b/CoreData/NSAttributeDescription.m @@ -32,10 +32,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _attributeType = [coder decodeIntForKey: @"NSAttributeType"]; _valueClassName = - [[coder decodeObjectForKey: @"NSAttributeValueClassName"] retain]; + [[coder decodeObjectForKey: @"NSAttributeValueClassName"] retain]; _defaultValue = [[coder decodeObjectForKey: @"NSDefaultValue"] retain]; _valueTransformerName = - [[coder decodeObjectForKey: @"NSValueTransformerName"] retain]; + [[coder decodeObjectForKey: @"NSValueTransformerName"] retain]; if (_valueTransformerName != nil) NSLog(@"UNIMPLEMENTED _valueTransformerName=%@", _valueTransformerName); diff --git a/CoreData/NSEntityDescription.m b/CoreData/NSEntityDescription.m index 17a30244..c131798c 100644 --- a/CoreData/NSEntityDescription.m +++ b/CoreData/NSEntityDescription.m @@ -35,20 +35,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static id getValue(id self, SEL selector) { NSPropertyDescription *property = - [[self entity] _propertyForSelector: selector]; + [[self entity] _propertyForSelector: selector]; id result = [self valueForKey: [property name]]; return result; } static void setValue(id self, SEL selector, id newValue) { NSPropertyDescription *property = - [[self entity] _propertyForSelector: selector]; + [[self entity] _propertyForSelector: selector]; [self setValue: newValue forKey: [property name]]; } static void addObject(id self, SEL selector, id value) { NSPropertyDescription *property = - [[self entity] _propertyForSelector: selector]; + [[self entity] _propertyForSelector: selector]; NSMutableSet *set = [self mutableSetValueForKey: [property name]]; [set addObject: value]; @@ -56,21 +56,21 @@ static void addObject(id self, SEL selector, id value) { static void removeObject(id self, SEL selector, id value) { NSPropertyDescription *property = - [[self entity] _propertyForSelector: selector]; + [[self entity] _propertyForSelector: selector]; NSMutableSet *set = [self mutableSetValueForKey: [property name]]; [set removeObject: value]; } static void addObjectSet(id self, SEL selector, NSSet *values) { NSPropertyDescription *property = - [[self entity] _propertyForSelector: selector]; + [[self entity] _propertyForSelector: selector]; NSMutableSet *set = [self mutableSetValueForKey: [property name]]; [set unionSet: values]; } static void removeObjectSet(id self, SEL selector, NSSet *values) { NSPropertyDescription *property = - [[self entity] _propertyForSelector: selector]; + [[self entity] _propertyForSelector: selector]; NSMutableSet *set = [self mutableSetValueForKey: [property name]]; [set minusSet: values]; } @@ -106,7 +106,7 @@ static void appendMethodToList(Class class, NSString *selectorName, IMP imp, _superentity = [[coder decodeObjectForKey: @"NSSuperentity"] retain]; _userInfo = [[coder decodeObjectForKey: @"NSUserInfo"] retain]; _versionHashModifier = - [[coder decodeObjectForKey: @"NSVersionHashModifier"] retain]; + [[coder decodeObjectForKey: @"NSVersionHashModifier"] retain]; _selectorPropertyMap = [[NSMutableDictionary alloc] init]; @@ -118,8 +118,9 @@ static void appendMethodToList(Class class, NSString *selectorName, IMP imp, for (NSPropertyDescription *property in [_properties allValues]) { NSString *propertyName = [property name]; NSString *upperName = [[[propertyName substringToIndex: 1] - uppercaseString] - stringByAppendingString: [propertyName substringFromIndex: 1]]; + uppercaseString] + stringByAppendingString: [propertyName + substringFromIndex: 1]]; NSString *selectorName; SEL selector; @@ -129,48 +130,50 @@ static void appendMethodToList(Class class, NSString *selectorName, IMP imp, forKey: keyObjectForSelector(selector)]; appendMethodToList( - class, [NSString stringWithFormat: @"set%@:", upperName], - (IMP) setValue, "v@:@", &selector); + class, [NSString stringWithFormat: @"set%@:", upperName], + (IMP) setValue, "v@:@", &selector); [_selectorPropertyMap setObject: property forKey: keyObjectForSelector(selector)]; if ([property isKindOfClass: [NSRelationshipDescription class]]) { NSRelationshipDescription *relationship = - (NSRelationshipDescription *) property; + (NSRelationshipDescription *) property; if ([relationship isToMany]) { appendMethodToList( - class, - [NSString stringWithFormat: @"add%@Object:", upperName], - (IMP) addObject, "v@:@", &selector); + class, + [NSString stringWithFormat: @"add%@Object:", + upperName], + (IMP) addObject, "v@:@", &selector); [_selectorPropertyMap - setObject: property - forKey: keyObjectForSelector(selector)]; + setObject: property + forKey: keyObjectForSelector(selector)]; appendMethodToList( - class, - [NSString - stringWithFormat: @"remove%@Object:", upperName], - (IMP) removeObject, "v@:@", &selector); + class, + [NSString stringWithFormat: @"remove%@Object:", + upperName], + (IMP) removeObject, "v@:@", &selector); [_selectorPropertyMap - setObject: property - forKey: keyObjectForSelector(selector)]; + setObject: property + forKey: keyObjectForSelector(selector)]; appendMethodToList( - class, - [NSString stringWithFormat: @"add%@:", upperName], - (IMP) addObjectSet, "v@:@", &selector); + class, + [NSString stringWithFormat: @"add%@:", upperName], + (IMP) addObjectSet, "v@:@", &selector); [_selectorPropertyMap - setObject: property - forKey: keyObjectForSelector(selector)]; + setObject: property + forKey: keyObjectForSelector(selector)]; - appendMethodToList( - class, - [NSString stringWithFormat: @"remove%@:", upperName], - (IMP) removeObjectSet, "v@:@", &selector); + appendMethodToList(class, + [NSString stringWithFormat: @"remove%@:", + upperName], + (IMP) removeObjectSet, "v@:@", + &selector); [_selectorPropertyMap - setObject: property - forKey: keyObjectForSelector(selector)]; + setObject: property + forKey: keyObjectForSelector(selector)]; } } } @@ -188,7 +191,7 @@ static void appendMethodToList(Class class, NSString *selectorName, IMP imp, for (entity = self; entity; entity = [entity superentity]) { NSPropertyDescription *result = - [entity->_selectorPropertyMap objectForKey: keyObject]; + [entity->_selectorPropertyMap objectForKey: keyObject]; if (result) return result; @@ -278,7 +281,7 @@ static void appendMethodToList(Class class, NSString *selectorName, IMP imp, inManagedObjectContext: (NSManagedObjectContext *) context { NSDictionary *entities = [[[context persistentStoreCoordinator] - managedObjectModel] entitiesByName]; + managedObjectModel] entitiesByName]; return [entities objectForKey: entityName]; } @@ -301,7 +304,7 @@ static void appendMethodToList(Class class, NSString *selectorName, IMP imp, } return [[class alloc] initWithEntity: entity - insertIntoManagedObjectContext: context]; + insertIntoManagedObjectContext: context]; } - (NSManagedObjectModel *) managedObjectModel { diff --git a/CoreData/NSFetchRequest.m b/CoreData/NSFetchRequest.m index 9052b148..08112b5d 100644 --- a/CoreData/NSFetchRequest.m +++ b/CoreData/NSFetchRequest.m @@ -51,7 +51,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ result->_affectedStores = [_affectedStores copy]; result->_propertiesToFetch = [_propertiesToFetch copy]; result->_relationshipKeyPathsForPrefetching = - [_relationshipKeyPathsForPrefetching copy]; + [_relationshipKeyPathsForPrefetching copy]; return result; } diff --git a/CoreData/NSManagedObject-Private.h b/CoreData/NSManagedObject-Private.h index d8fbc5bf..8c384d3a 100644 --- a/CoreData/NSManagedObject-Private.h +++ b/CoreData/NSManagedObject-Private.h @@ -2,5 +2,5 @@ @interface NSManagedObject (private) - initWithObjectID: (NSManagedObjectID *) objectID - managedObjectContext: (NSManagedObjectContext *) context; + managedObjectContext: (NSManagedObjectContext *) context; @end diff --git a/CoreData/NSManagedObject.m b/CoreData/NSManagedObject.m index fec08ad8..3e9f85fe 100644 --- a/CoreData/NSManagedObject.m +++ b/CoreData/NSManagedObject.m @@ -41,7 +41,7 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; } - initWithObjectID: (NSManagedObjectID *) objectID - managedObjectContext: (NSManagedObjectContext *) context + managedObjectContext: (NSManagedObjectContext *) context { NSEntityDescription *entity = [objectID entity]; NSString *className = [entity managedObjectClassName]; @@ -67,10 +67,10 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; } - initWithEntity: (NSEntityDescription *) entity - insertIntoManagedObjectContext: (NSManagedObjectContext *) context + insertIntoManagedObjectContext: (NSManagedObjectContext *) context { NSManagedObjectID *objectID = - [[[NSManagedObjectID alloc] initWithEntity: entity] autorelease]; + [[[NSManagedObjectID alloc] initWithEntity: entity] autorelease]; if ((self = [self initWithObjectID: objectID managedObjectContext: context]) == nil) @@ -170,7 +170,7 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; if (_committedValues == nil) { NSAtomicStoreCacheNode *node = - [_context _cacheNodeForObjectID: [self objectID]]; + [_context _cacheNodeForObjectID: [self objectID]]; NSDictionary *propertyCache = [node propertyCache]; NSMutableDictionary *storedValues = [[NSMutableDictionary alloc] init]; @@ -185,10 +185,10 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; if (value != nil) { [storedValues setObject: value forKey: name]; } - } else if ([property - isKindOfClass: [NSRelationshipDescription class]]) { + } else if ([property isKindOfClass: [NSRelationshipDescription + class]]) { NSRelationshipDescription *relationship = - (NSRelationshipDescription *) property; + (NSRelationshipDescription *) property; id indirectValue = [propertyCache objectForKey: name]; if (indirectValue != nil) { @@ -252,7 +252,7 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; return [self valueForUndefinedKey: nil]; NSPropertyDescription *property = - [[self entity] _propertyForSelector: NSSelectorFromString(key)]; + [[self entity] _propertyForSelector: NSSelectorFromString(key)]; NSString *propertyName = [property name]; if ([property isKindOfClass: [NSAttributeDescription class]]) { @@ -265,7 +265,7 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; return result; } else if ([property isKindOfClass: [NSRelationshipDescription class]]) { NSRelationshipDescription *relationship = - (NSRelationshipDescription *) property; + (NSRelationshipDescription *) property; [self willAccessValueForKey: propertyName]; @@ -274,8 +274,8 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; if (result != nil) { if ([relationship isToMany]) result = [[[NSManagedObjectSet alloc] - initWithManagedObjectContext: _context - set: result] autorelease]; + initWithManagedObjectContext: _context + set: result] autorelease]; else result = [_context objectWithID: result]; } @@ -290,7 +290,7 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; - (void) setValue: value forKey: (NSString *) key { NSPropertyDescription *property = - [[self entity] _propertyForSelector: NSSelectorFromString(key)]; + [[self entity] _propertyForSelector: NSSelectorFromString(key)]; NSString *propertyName = [property name]; if ([property isKindOfClass: [NSAttributeDescription class]]) { @@ -300,7 +300,7 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; return; } else if ([property isKindOfClass: [NSRelationshipDescription class]]) { NSRelationshipDescription *relationship = - (NSRelationshipDescription *) property; + (NSRelationshipDescription *) property; NSRelationshipDescription *inverse = [relationship inverseRelationship]; NSString *inverseName = [inverse name]; id valueByID; @@ -321,13 +321,13 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; if (primitivePrevious != nil) { NSSet *allPrevious = - [relationship isToMany] - ? primitivePrevious - : [NSSet setWithObject: primitivePrevious]; + [relationship isToMany] + ? primitivePrevious + : [NSSet setWithObject: primitivePrevious]; for (NSManagedObjectID *previousID in allPrevious) { NSManagedObject *previous = - [_context objectWithID: previousID]; + [_context objectWithID: previousID]; // FIXME: should be using set mutation notifications for to // many @@ -335,7 +335,7 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; if ([inverse isToMany]) [[previous primitiveValueForKey: inverseName] - removeObject: [self objectID]]; + removeObject: [self objectID]]; else [previous setPrimitiveValue: nil forKey: inverseName]; @@ -350,8 +350,8 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; if (inverse != nil) { NSSet *allValues = [relationship isToMany] - ? valueByID - : [NSSet setWithObject: valueByID]; + ? valueByID + : [NSSet setWithObject: valueByID]; for (NSManagedObjectID *valueID in allValues) { NSManagedObject *value = [_context objectWithID: valueID]; @@ -361,7 +361,7 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; if ([inverse isToMany]) { NSMutableSet *set = - [value primitiveValueForKey: inverseName]; + [value primitiveValueForKey: inverseName]; if (set == nil) { set = [NSMutableSet set]; @@ -386,7 +386,7 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; - (NSMutableSet *) mutableSetValueForKey: (NSString *) key { return [[[NSManagedObjectMutableSet alloc] initWithManagedObject: self key: key] - autorelease]; + autorelease]; } - primitiveValueForKey: (NSString *) key { @@ -451,14 +451,15 @@ NSString *const NSValidationValueErrorKey = @"NSValidationErrorValue"; } - (NSString *) description { - NSMutableDictionary *values = - [NSMutableDictionary dictionaryWithDictionary: [self _committedValues]]; + NSMutableDictionary *values = [NSMutableDictionary + dictionaryWithDictionary: [self _committedValues]]; [values addEntriesFromDictionary: _changedValues]; return [NSString - stringWithFormat: @"<%@ %x:objectID=%@ entity name=%@, values=%@>", - [self class], self, _objectID, [self entity], values]; + stringWithFormat: @"<%@ %x:objectID=%@ entity name=%@, values=%@>", + [self class], self, _objectID, [self entity], + values]; } @end diff --git a/CoreData/NSManagedObjectContext-Private.h b/CoreData/NSManagedObjectContext-Private.h index 9e243706..8c33e34b 100644 --- a/CoreData/NSManagedObjectContext-Private.h +++ b/CoreData/NSManagedObjectContext-Private.h @@ -4,6 +4,6 @@ @interface NSManagedObjectContext (private) - (NSAtomicStoreCacheNode *) _cacheNodeForObjectID: - (NSManagedObjectID *) objectID; + (NSManagedObjectID *) objectID; - (void) _registerObject: (NSManagedObject *) object; @end diff --git a/CoreData/NSManagedObjectContext.m b/CoreData/NSManagedObjectContext.m index 90b469ce..e513da7e 100644 --- a/CoreData/NSManagedObjectContext.m +++ b/CoreData/NSManagedObjectContext.m @@ -32,9 +32,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSManagedObjectContextWillSaveNotification = - @"NSManagedObjectContextWillSaveNotification"; + @"NSManagedObjectContextWillSaveNotification"; NSString *const NSManagedObjectContextDidSaveNotification = - @"NSManagedObjectContextDidSaveNotification"; + @"NSManagedObjectContextDidSaveNotification"; NSString *const NSInsertedObjectsKey = @"NSInsertedObjectsKey"; NSString *const NSUpdatedObjectsKey = @"NSUpdatedObjectsKey"; @@ -59,8 +59,8 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; _updatedObjects = [[NSMutableSet alloc] init]; _deletedObjects = [[NSMutableSet alloc] init]; - _objectIdToObject = - NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 0); + _objectIdToObject = NSCreateMapTable(NSObjectMapKeyCallBacks, + NSObjectMapValueCallBacks, 0); _requestedProcessPendingChanges = NO; return self; } @@ -100,7 +100,7 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; - (void) persistentStoresDidChange: (NSNotification *) note { NSArray *stores = - [[note userInfo] objectForKey: NSRemovedPersistentStoresKey]; + [[note userInfo] objectForKey: NSRemovedPersistentStoresKey]; for (NSPersistentStore *store in stores) { NSArray *allObjects = NSAllMapTableValues(_objectIdToObject); @@ -129,10 +129,9 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; - (void) setPersistentStoreCoordinator: (NSPersistentStoreCoordinator *) value { if (_storeCoordinator != nil) [[NSNotificationCenter defaultCenter] - removeObserver: self - name: - NSPersistentStoreCoordinatorStoresDidChangeNotification - object: _storeCoordinator]; + removeObserver: self + name: NSPersistentStoreCoordinatorStoresDidChangeNotification + object: _storeCoordinator]; value = [value retain]; [_storeCoordinator release]; @@ -140,10 +139,10 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; if (_storeCoordinator != nil) [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(persistentStoresDidChange:) - name: NSPersistentStoreCoordinatorStoresDidChangeNotification - object: _storeCoordinator]; + addObserver: self + selector: @selector(persistentStoresDidChange:) + name: NSPersistentStoreCoordinatorStoresDidChangeNotification + object: _storeCoordinator]; } - (void) setUndoManager: (NSUndoManager *) value { @@ -225,10 +224,10 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; } - (NSAtomicStoreCacheNode *) _cacheNodeForObjectID: - (NSManagedObjectID *) objectID + (NSManagedObjectID *) objectID { NSAtomicStore *store = (NSAtomicStore *) [_storeCoordinator - _persistentStoreForObjectID: objectID]; + _persistentStoreForObjectID: objectID]; return [store cacheNodeForObjectID: objectID]; } @@ -282,8 +281,8 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; if ([entity _isKindOfEntity: [fetchRequest entity]]) { if (![_deletedObjects containsObject: check]) { - if ([affectedStores - containsObject: [[check objectID] persistentStore]]) { + if ([affectedStores containsObject: [[check objectID] + persistentStore]]) { [resultSet addObject: check]; } } @@ -308,7 +307,7 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; } NSMutableArray *result = - [NSMutableArray arrayWithArray: [resultSet allObjects]]; + [NSMutableArray arrayWithArray: [resultSet allObjects]]; NSPredicate *p = [fetchRequest predicate]; @@ -328,7 +327,7 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; - (void) insertObject: (NSManagedObject *) object { NSPersistentStore *store = - [_storeCoordinator _persistentStoreForObject: object]; + [_storeCoordinator _persistentStoreForObject: object]; [[object objectID] setStoreIdentifier: [store identifier]]; [[object objectID] setPersistentStore: store]; @@ -374,12 +373,12 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; if (!_requestedProcessPendingChanges) { NSRunLoop *runLoop = [NSRunLoop mainRunLoop]; - [runLoop - performSelector: @selector(_processPendingChangesForRequest) - target: self - argument: nil - order: 0 - modes: [NSArray arrayWithObject: NSRunLoopCommonModes]]; + [runLoop performSelector: @selector(_processPendingChangesForRequest) + target: self + argument: nil + order: 0 + modes: [NSArray arrayWithObject: + NSRunLoopCommonModes]]; _requestedProcessPendingChanges = YES; } } @@ -390,10 +389,10 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; - (void) processPendingChanges { if (_requestedProcessPendingChanges) { - [[NSRunLoop mainRunLoop] - cancelPerformSelector: @selector(_processPendingChangesForRequest) - target: self - argument: nil]; + [[NSRunLoop mainRunLoop] cancelPerformSelector: @selector + (_processPendingChangesForRequest) + target: self + argument: nil]; } [self _processPendingChanges]; @@ -434,10 +433,10 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; if (storeIdentifier != nil) store = (NSAtomicStore *) [_storeCoordinator - _persistentStoreWithIdentifier: storeIdentifier]; + _persistentStoreWithIdentifier: storeIdentifier]; else { store = (NSAtomicStore *) [_storeCoordinator - _persistentStoreForObject: check]; + _persistentStoreForObject: check]; [checkID setStoreIdentifier: [store identifier]]; } @@ -446,7 +445,7 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; #endif id referenceObject = - [store newReferenceObjectForManagedObject: check]; + [store newReferenceObjectForManagedObject: check]; [checkID setReferenceObject: referenceObject]; @@ -466,15 +465,15 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; NSMutableSet *affectedStores = [NSMutableSet set]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSManagedObjectContextWillSaveNotification - object: self]; + postNotificationName: NSManagedObjectContextWillSaveNotification + object: self]; // delete cache nodes for (NSManagedObject *deleted in _deletedObjects) { NSAtomicStore *store = (NSAtomicStore *) [_storeCoordinator - _persistentStoreForObject: deleted]; + _persistentStoreForObject: deleted]; NSAtomicStoreCacheNode *node = - [store cacheNodeForObjectID: [deleted objectID]]; + [store cacheNodeForObjectID: [deleted objectID]]; [store willRemoveCacheNodes: [NSSet setWithObject: node]]; @@ -495,19 +494,19 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; forKey: NSLocalizedDescriptionKey]; if (errorp != NULL) - *errorp = - [NSError errorWithDomain: NSCocoaErrorDomain - code: NSPersistentStoreIncompleteSaveError - userInfo: userInfo]; + *errorp = [NSError + errorWithDomain: NSCocoaErrorDomain + code: NSPersistentStoreIncompleteSaveError + userInfo: userInfo]; return NO; } for (NSManagedObject *inserted in _insertedObjects) { NSAtomicStore *store = (NSAtomicStore *) [_storeCoordinator - _persistentStoreForObject: inserted]; + _persistentStoreForObject: inserted]; NSAtomicStoreCacheNode *node = - [store newCacheNodeForManagedObject: inserted]; + [store newCacheNodeForManagedObject: inserted]; [store addCacheNodes: [NSSet setWithObject: node]]; @@ -518,9 +517,9 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; for (NSManagedObject *updated in _updatedObjects) { NSAtomicStore *store = (NSAtomicStore *) [_storeCoordinator - _persistentStoreForObject: updated]; + _persistentStoreForObject: updated]; NSAtomicStoreCacheNode *node = - [store cacheNodeForObjectID: [updated objectID]]; + [store cacheNodeForObjectID: [updated objectID]]; [store updateCacheNode: node fromManagedObject: updated]; @@ -541,8 +540,8 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; } [[NSNotificationCenter defaultCenter] - postNotificationName: NSManagedObjectContextDidSaveNotification - object: self]; + postNotificationName: NSManagedObjectContextDidSaveNotification + object: self]; if ([errors count] == 0) return YES; @@ -563,7 +562,7 @@ NSString *const NSAffectedObjectsErrorKey = @"NSAffectedObjectsErrorKey"; } - (void) mergeChangesFromContextDidSaveNotification: - (NSNotification *) notification + (NSNotification *) notification { NSUnimplementedMethod(); } diff --git a/CoreData/NSManagedObjectID.m b/CoreData/NSManagedObjectID.m index 1e9bc4ac..53214a85 100644 --- a/CoreData/NSManagedObjectID.m +++ b/CoreData/NSManagedObjectID.m @@ -54,7 +54,7 @@ - (NSURL *) URIRepresentation { NSString *path = - [[_entity name] stringByAppendingPathComponent: _referenceObject]; + [[_entity name] stringByAppendingPathComponent: _referenceObject]; NSString *host = _isTemporaryID ? @"" : _storeIdentifier; return [[[NSURL alloc] initWithScheme: @"x-coredata" host: host diff --git a/CoreData/NSManagedObjectModel.m b/CoreData/NSManagedObjectModel.m index 69a7fa7b..00f99f06 100644 --- a/CoreData/NSManagedObjectModel.m +++ b/CoreData/NSManagedObjectModel.m @@ -50,7 +50,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (NSString *path in moms) { NSURL *url = [NSURL fileURLWithPath: path]; NSManagedObjectModel *model = - [[NSManagedObjectModel alloc] initWithContentsOfURL: url]; + [[NSManagedObjectModel alloc] initWithContentsOfURL: url]; if (model == nil) NSLog(@"-[%@ initWithContentsOfURL:] failed. url=%@", self, @@ -82,9 +82,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [_entities setObject: entity forKey: [[entity name] uppercaseString]]; _fetchRequestTemplates = - [[coder decodeObjectForKey: @"NSFetchRequestTemplates"] retain]; + [[coder decodeObjectForKey: @"NSFetchRequestTemplates"] retain]; _versionIdentifiers = - [[coder decodeObjectForKey: @"NSVersionIdentifiers"] retain]; + [[coder decodeObjectForKey: @"NSVersionIdentifiers"] retain]; return self; } @@ -98,7 +98,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return nil; NSKeyedUnarchiver *unarchiver = - [[NSKeyedUnarchiver alloc] initForReadingWithData: data]; + [[NSKeyedUnarchiver alloc] initForReadingWithData: data]; NSManagedObjectModel *result = [unarchiver decodeObjectForKey: @"root"]; [unarchiver release]; @@ -143,7 +143,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) setEntities: (NSArray *) entities - forConfiguration: (NSString *) configuration + forConfiguration: (NSString *) configuration { [_configurations setObject: entities forKey: configuration]; } @@ -154,7 +154,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSFetchRequest *) fetchRequestFromTemplateWithName: (NSString *) name substitutionVariables: - (NSDictionary *) variables + (NSDictionary *) variables { NSUnimplementedMethod(); } diff --git a/CoreData/NSManagedObjectSet.m b/CoreData/NSManagedObjectSet.m index 3c0dd2eb..1c5e1560 100644 --- a/CoreData/NSManagedObjectSet.m +++ b/CoreData/NSManagedObjectSet.m @@ -34,8 +34,8 @@ return nil; return [[[NSManagedObjectSetEnumerator alloc] - initWithManagedObjectContext: _context - objectEnumerator: state] autorelease]; + initWithManagedObjectContext: _context + objectEnumerator: state] autorelease]; } @end diff --git a/CoreData/NSPersistentStore.m b/CoreData/NSPersistentStore.m index 256d91e4..339b047d 100644 --- a/CoreData/NSPersistentStore.m +++ b/CoreData/NSPersistentStore.m @@ -14,8 +14,8 @@ } + (BOOL) setMetadata: (NSDictionary *) metadata - forPersistentStoreWithURL: (NSURL *) url - error: (NSError **) error + forPersistentStoreWithURL: (NSURL *) url + error: (NSError **) error { NSInvalidAbstractInvocation(); return 0; @@ -79,8 +79,8 @@ - (NSDictionary *) metadata { return [NSDictionary - dictionaryWithObjectsAndKeys: [self identifier], NSStoreUUIDKey, - [self type], NSStoreTypeKey, nil]; + dictionaryWithObjectsAndKeys: [self identifier], NSStoreUUIDKey, + [self type], NSStoreTypeKey, nil]; } - (void) setURL: (NSURL *) value { @@ -108,20 +108,20 @@ } - (void) willRemoveFromPersistentStoreCoordinator: - (NSPersistentStoreCoordinator *) coordinator + (NSPersistentStoreCoordinator *) coordinator { // Default implementation does nothing } - (void) didAddToPersistentStoreCoordinator: - (NSPersistentStoreCoordinator *) coordinator + (NSPersistentStoreCoordinator *) coordinator { // Default implementation does nothing } - (NSString *) description { - return [NSString - stringWithFormat: @"<%@ %p URL=%@>", [self class], self, [self URL]]; + return [NSString stringWithFormat: @"<%@ %p URL=%@>", [self class], self, + [self URL]]; } @end diff --git a/CoreData/NSPersistentStoreCoordinator-Private.h b/CoreData/NSPersistentStoreCoordinator-Private.h index 8f9689ef..da83d3c2 100644 --- a/CoreData/NSPersistentStoreCoordinator-Private.h +++ b/CoreData/NSPersistentStoreCoordinator-Private.h @@ -5,6 +5,6 @@ @interface NSPersistentStoreCoordinator (private) - (NSPersistentStore *) _persistentStoreWithIdentifier: (NSString *) identifier; - (NSPersistentStore *) _persistentStoreForObjectID: - (NSManagedObjectID *) object; + (NSManagedObjectID *) object; - (NSPersistentStore *) _persistentStoreForObject: (NSManagedObject *) object; @end diff --git a/CoreData/NSPersistentStoreCoordinator.m b/CoreData/NSPersistentStoreCoordinator.m index 3eb1e37f..438ab3e8 100644 --- a/CoreData/NSPersistentStoreCoordinator.m +++ b/CoreData/NSPersistentStoreCoordinator.m @@ -32,21 +32,21 @@ NSString *const NSInMemoryStoreType = @"Memory"; NSString *const NSSQLiteStoreType = @"SQLite"; NSString *const NSBinaryStoreType = @"Binary"; NSString *const NSMigratePersistentStoresAutomaticallyOption = - @"NSMigratePersistentStoresAutomaticallyOption"; + @"NSMigratePersistentStoresAutomaticallyOption"; NSString *const NSPersistentStoreCoordinatorStoresDidChangeNotification = - @"NSPersistentStoreCoordinatorStoresDidChangeNotification"; + @"NSPersistentStoreCoordinatorStoresDidChangeNotification"; NSString *const NSAddedPersistentStoresKey = @"NSAddedPersistentStoresKey"; NSString *const NSRemovedPersistentStoresKey = @"NSRemovedPersistentStoresKey"; NSString *const NSUUIDChangedPersistentStoresKey = - @"NSUUIDChangedPersistentStoresKey"; + @"NSUUIDChangedPersistentStoresKey"; NSString *const NSPersistentStoreSaveConflictsErrorKey = @"conflictList"; NSString *const NSInferMappingModelAutomaticallyOption = - @"NSInferMappingModelAutomaticallyOption"; + @"NSInferMappingModelAutomaticallyOption"; NSString *const NSReadOnlyPersistentStoreOption = - @"NSReadOnlyPersistentStoreOption"; + @"NSReadOnlyPersistentStoreOption"; @implementation NSPersistentStoreCoordinator @@ -101,7 +101,8 @@ static NSMutableDictionary *_storeTypes = nil; for (Class class in [_storeTypes allValues]) { NSDictionary *metadata = - [class metadataForPersistentStoreWithURL: storeURL error: nil]; + [class metadataForPersistentStoreWithURL: storeURL + error: nil]; if ((storeType = [metadata objectForKey: NSStoreTypeKey]) != nil) break; } @@ -109,10 +110,10 @@ static NSMutableDictionary *_storeTypes = nil; Class class = [[[self class] registeredStoreTypes] objectForKey: storeType]; NSAtomicStore *store = [[[class alloc] - initWithPersistentStoreCoordinator: self - configurationName: configuration - URL: storeURL - options: options] autorelease]; + initWithPersistentStoreCoordinator: self + configurationName: configuration + URL: storeURL + options: options] autorelease]; if (![store load: error]) return nil; @@ -132,16 +133,16 @@ static NSMutableDictionary *_storeTypes = nil; { NSArray *remove = [NSArray arrayWithObject: store]; NSDictionary *userInfo = - [NSDictionary dictionaryWithObject: remove - forKey: NSRemovedPersistentStoresKey]; + [NSDictionary dictionaryWithObject: remove + forKey: NSRemovedPersistentStoresKey]; [store willRemoveFromPersistentStoreCoordinator: self]; [[NSNotificationCenter defaultCenter] - postNotificationName: - NSPersistentStoreCoordinatorStoresDidChangeNotification - object: self - userInfo: userInfo]; + postNotificationName: + NSPersistentStoreCoordinatorStoresDidChangeNotification + object: self + userInfo: userInfo]; [_stores removeObjectIdenticalTo: store]; @@ -194,21 +195,21 @@ static NSMutableDictionary *_storeTypes = nil; } - (void) setMetadata: (NSDictionary *) value - forPersistentStore: (NSPersistentStore *) store + forPersistentStore: (NSPersistentStore *) store { [store setMetadata: value]; } + (BOOL) setMetadata: (NSDictionary *) metadata - forPersistentStoreOfType: (NSString *) storeType - URL: (NSURL *) url - error: (NSError **) error + forPersistentStoreOfType: (NSString *) storeType + URL: (NSURL *) url + error: (NSError **) error { Class check = [[self registeredStoreTypes] objectForKey: storeType]; return [check setMetadata: metadata - forPersistentStoreWithURL: url - error: error]; + forPersistentStoreWithURL: url + error: error]; } + (NSDictionary *) metadataForPersistentStoreOfType: (NSString *) storeType @@ -230,12 +231,12 @@ static NSMutableDictionary *_storeTypes = nil; } - (NSPersistentStore *) _persistentStoreForObjectID: - (NSManagedObjectID *) objectID + (NSManagedObjectID *) objectID { NSEntityDescription *entity = [objectID entity]; NSString *storeIdentifier = [objectID storeIdentifier]; NSPersistentStore *check = - [self _persistentStoreWithIdentifier: storeIdentifier]; + [self _persistentStoreWithIdentifier: storeIdentifier]; if (check != nil) return check; @@ -244,8 +245,8 @@ static NSMutableDictionary *_storeTypes = nil; if ([_stores count] == 0) { [NSException - raise: NSInvalidArgumentException - format: @"-[%@ %s] no persistent stores", [self class], _cmd]; + raise: NSInvalidArgumentException + format: @"-[%@ %s] no persistent stores", [self class], _cmd]; return nil; } @@ -254,7 +255,7 @@ static NSMutableDictionary *_storeTypes = nil; if (configurationName == nil) { NSArray *entities = - [model entitiesForConfiguration: configurationName]; + [model entitiesForConfiguration: configurationName]; if ([entities containsObject: entity]) return check; @@ -274,14 +275,14 @@ static NSMutableDictionary *_storeTypes = nil; NSString *path = [URL path]; NSString *referenceObject = [path lastPathComponent]; NSString *entityName = - [[path stringByDeletingLastPathComponent] lastPathComponent]; + [[path stringByDeletingLastPathComponent] lastPathComponent]; NSManagedObjectModel *model = [self managedObjectModel]; NSEntityDescription *entity = - [[model entitiesByName] objectForKey: entityName]; + [[model entitiesByName] objectForKey: entityName]; return [(NSAtomicStore *) [self _persistentStoreWithIdentifier: host] - objectIDForEntity: entity - referenceObject: referenceObject]; + objectIDForEntity: entity + referenceObject: referenceObject]; } @end diff --git a/CoreData/NSRelationshipDescription.m b/CoreData/NSRelationshipDescription.m index d14e04f6..1d4e72e6 100644 --- a/CoreData/NSRelationshipDescription.m +++ b/CoreData/NSRelationshipDescription.m @@ -38,9 +38,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _minCount = [coder decodeIntForKey: @"NSMinCount"]; _destinationEntityName = - [coder decodeObjectForKey: @"_NSDestinationEntityName"]; + [coder decodeObjectForKey: @"_NSDestinationEntityName"]; _inverseRelationshipName = - [coder decodeObjectForKey: @"_NSInverseRelationshipName"]; + [coder decodeObjectForKey: @"_NSInverseRelationshipName"]; return self; } diff --git a/CoreData/NSXMLPersistentStore.m b/CoreData/NSXMLPersistentStore.m index b1871124..130dfa67 100644 --- a/CoreData/NSXMLPersistentStore.m +++ b/CoreData/NSXMLPersistentStore.m @@ -26,15 +26,15 @@ options: 0 error: error]; NSInteger options = - NSXMLNodePreserveCharacterReferences | NSXMLNodePreserveWhitespace; + NSXMLNodePreserveCharacterReferences | NSXMLNodePreserveWhitespace; if ([data length] == 0) return nil; NSXMLDocument *xml = - [[[NSXMLDocument alloc] initWithContentsOfURL: url - options: options - error: error] autorelease]; + [[[NSXMLDocument alloc] initWithContentsOfURL: url + options: options + error: error] autorelease]; if (xml == nil) return nil; @@ -42,12 +42,12 @@ NSXMLElement *database = [[xml nodesForXPath: @"database" error: nil] lastObject]; NSXMLElement *databaseInfo = - [[database elementsForName: @"databaseInfo"] lastObject]; + [[database elementsForName: @"databaseInfo"] lastObject]; NSXMLElement *uuid = [[databaseInfo elementsForName: @"UUID"] lastObject]; return [NSDictionary - dictionaryWithObjectsAndKeys: [uuid stringValue], NSStoreUUIDKey, - NSXMLStoreType, NSStoreTypeKey, nil]; + dictionaryWithObjectsAndKeys: [uuid stringValue], NSStoreUUIDKey, + NSXMLStoreType, NSStoreTypeKey, nil]; } - (NSString *) type { @@ -59,8 +59,8 @@ } - (NSXMLElement *) databaseInfoElement { - return - [[[self databaseElement] elementsForName: @"databaseInfo"] lastObject]; + return [[[self databaseElement] elementsForName: @"databaseInfo"] + lastObject]; } - (NSXMLElement *) metadataElement { @@ -73,11 +73,11 @@ - (NSXMLElement *) nextObjectIDElement { return [[[self databaseInfoElement] elementsForName: @"nextObjectID"] - lastObject]; + lastObject]; } - initWithPersistentStoreCoordinator: - (NSPersistentStoreCoordinator *) coordinator + (NSPersistentStoreCoordinator *) coordinator configurationName: (NSString *) configurationName URL: (NSURL *) url options: (NSDictionary *) options @@ -92,7 +92,7 @@ options: 0 error: NULL]; NSInteger xmlOptions = - NSXMLNodePreserveCharacterReferences | NSXMLNodePreserveWhitespace; + NSXMLNodePreserveCharacterReferences | NSXMLNodePreserveWhitespace; // A valid load can be from a non-existent file or a zero file, zero length // checks for both @@ -109,19 +109,20 @@ options: xmlOptions]; NSXMLElement *database = - [[NSXMLElement alloc] initWithName: @"database"]; + [[NSXMLElement alloc] initWithName: @"database"]; NSXMLElement *databaseInfo = - [[NSXMLElement alloc] initWithName: @"databaseInfo"]; + [[NSXMLElement alloc] initWithName: @"databaseInfo"]; NSXMLElement *versionElement = - [[NSXMLElement alloc] initWithName: @"version" stringValue: @"1"]; + [[NSXMLElement alloc] initWithName: @"version" + stringValue: @"1"]; NSXMLElement *uuidElement = - [[NSXMLElement alloc] initWithName: @"UUID" - stringValue: [self identifier]]; + [[NSXMLElement alloc] initWithName: @"UUID" + stringValue: [self identifier]]; NSXMLElement *nextObjectID = - [[NSXMLElement alloc] initWithName: @"nextObjectID" - stringValue: @"1"]; + [[NSXMLElement alloc] initWithName: @"nextObjectID" + stringValue: @"1"]; NSXMLElement *metadata = - [[NSXMLElement alloc] initWithName: @"metadata"]; + [[NSXMLElement alloc] initWithName: @"metadata"]; [_document addChild: database]; [database addChild: databaseInfo]; @@ -140,10 +141,11 @@ [super setIdentifier: [[self identifierElement] stringValue]]; [self setMetadata: [NSDictionary - dictionaryWithObjectsAndKeys: [self identifier], - NSStoreUUIDKey, - [self type], - NSStoreTypeKey, nil]]; + dictionaryWithObjectsAndKeys: [self identifier], + NSStoreUUIDKey, + [self type], + NSStoreTypeKey, + nil]]; _referenceToCacheNode = [[NSMutableDictionary alloc] init]; _referenceToElement = [[NSMutableDictionary alloc] init]; @@ -169,7 +171,7 @@ referenceObject: reference { NSAtomicStoreCacheNode *result = - [_referenceToCacheNode objectForKey: reference]; + [_referenceToCacheNode objectForKey: reference]; if (result == nil) { NSManagedObjectID *objectID = [self objectIDForEntity: entity @@ -189,15 +191,15 @@ model: (NSManagedObjectModel *) model { NSString *entityName = - [[entityElement attributeForName: @"type"] stringValue]; + [[entityElement attributeForName: @"type"] stringValue]; NSString *entityReference = - [[entityElement attributeForName: @"id"] stringValue]; + [[entityElement attributeForName: @"id"] stringValue]; NSArray *attributeElements = [entityElement elementsForName: @"attribute"]; NSArray *relationshipElements = - [entityElement elementsForName: @"relationship"]; + [entityElement elementsForName: @"relationship"]; NSEntityDescription *entity = - [[model entitiesByName] objectForKey: entityName]; + [[model entitiesByName] objectForKey: entityName]; if (entity == nil) { NSLog(@"Unable to find entity %@ in model", entityName); @@ -207,14 +209,14 @@ [_referenceToElement setObject: entityElement forKey: entityReference]; NSAtomicStoreCacheNode *cacheNode = - [self cacheNodeForEntity: entity referenceObject: entityReference]; + [self cacheNodeForEntity: entity referenceObject: entityReference]; NSDictionary *attributesByName = [entity attributesByName]; for (NSXMLElement *attribute in attributeElements) { NSString *name = [[attribute attributeForName: @"name"] stringValue]; NSAttributeDescription *description = - [attributesByName objectForKey: name]; + [attributesByName objectForKey: name]; if (description == nil) { NSLog(@"Unable to find attribute named %@ for entity named %@", @@ -234,30 +236,30 @@ case NSInteger16AttributeType: objectValue = - [NSNumber numberWithInteger: [stringValue integerValue]]; + [NSNumber numberWithInteger: [stringValue integerValue]]; break; case NSInteger32AttributeType: objectValue = - [NSNumber numberWithInteger: [stringValue integerValue]]; + [NSNumber numberWithInteger: [stringValue integerValue]]; break; case NSInteger64AttributeType: objectValue = - [NSNumber numberWithInteger: [stringValue integerValue]]; + [NSNumber numberWithInteger: [stringValue integerValue]]; break; case NSDecimalAttributeType: // decimal types not supported right now, use double objectValue = - [NSNumber numberWithDouble: [stringValue doubleValue]]; + [NSNumber numberWithDouble: [stringValue doubleValue]]; // objectValue=[NSDecimalNumber // decimalNumberWithString:stringValue]; break; case NSDoubleAttributeType: objectValue = - [NSNumber numberWithDouble: [stringValue doubleValue]]; + [NSNumber numberWithDouble: [stringValue doubleValue]]; break; case NSFloatAttributeType: @@ -297,7 +299,7 @@ for (NSXMLElement *relationship in relationshipElements) { NSString *name = [[relationship attributeForName: @"name"] stringValue]; NSRelationshipDescription *description = - [relationshipsByName objectForKey: name]; + [relationshipsByName objectForKey: name]; if (description == nil) { NSLog(@"No description for relationship name %@ in %@", name, @@ -306,21 +308,22 @@ } NSString *destinationEntityName = - [[relationship attributeForName: @"destination"] stringValue]; + [[relationship attributeForName: @"destination"] stringValue]; NSEntityDescription *destinationEntity = - [[model entitiesByName] objectForKey: destinationEntityName]; + [[model entitiesByName] objectForKey: destinationEntityName]; NSString *type = [[relationship attributeForName: @"type"] stringValue]; NSString *idrefsString = - [[relationship attributeForName: @"idrefs"] stringValue]; - NSArray *idrefs = [idrefsString length] - ? [idrefsString componentsSeparatedByString: @" "] - : nil; + [[relationship attributeForName: @"idrefs"] stringValue]; + NSArray *idrefs = + [idrefsString length] + ? [idrefsString componentsSeparatedByString: @" "] + : nil; id objectValue = [NSMutableSet set]; for (NSString *ref in idrefs) { NSAtomicStoreCacheNode *cacheNode = - [self cacheNodeForEntity: destinationEntity - referenceObject: ref]; + [self cacheNodeForEntity: destinationEntity + referenceObject: ref]; [objectValue addObject: cacheNode]; } @@ -345,7 +348,7 @@ - (BOOL) load: (NSError **) errorp { NSManagedObjectModel *model = - [[self persistentStoreCoordinator] managedObjectModel]; + [[self persistentStoreCoordinator] managedObjectModel]; NSXMLElement *database = [self databaseElement]; NSArray *objects = [database elementsForName: @"object"]; @@ -380,19 +383,19 @@ } - (void) updateCacheNode: (NSAtomicStoreCacheNode *) node - fromManagedObject: (NSManagedObject *) managedObject + fromManagedObject: (NSManagedObject *) managedObject { NSXMLElement *entityElement = - [self entityElementForObjectID: [managedObject objectID]]; + [self entityElementForObjectID: [managedObject objectID]]; NSDictionary *attributesByName = [[managedObject entity] attributesByName]; NSArray *attributeKeys = [attributesByName allKeys]; NSMutableArray *children = [NSMutableArray array]; for (NSString *attributeName in attributeKeys) { NSAttributeDescription *attributeDescription = - [attributesByName objectForKey: attributeName]; + [attributesByName objectForKey: attributeName]; NSXMLElement *attributeElement = - [NSXMLNode elementWithName: @"attribute"]; + [NSXMLNode elementWithName: @"attribute"]; id value = [managedObject primitiveValueForKey: attributeName]; NSString *type = nil; NSString *stringValue = nil; @@ -459,8 +462,8 @@ [attributeElement setStringValue: stringValue]; [attributeElement - addAttribute: [NSXMLNode attributeWithName: @"name" - stringValue: attributeName]]; + addAttribute: [NSXMLNode attributeWithName: @"name" + stringValue: attributeName]]; [attributeElement addAttribute: [NSXMLNode attributeWithName: @"type" stringValue: type]]; @@ -470,19 +473,19 @@ } NSDictionary *relationshipsByName = - [[managedObject entity] relationshipsByName]; + [[managedObject entity] relationshipsByName]; NSArray *relationshipKeys = [relationshipsByName allKeys]; for (NSString *relationshipName in relationshipKeys) { NSRelationshipDescription *relationshipDescription = - [relationshipsByName objectForKey: relationshipName]; + [relationshipsByName objectForKey: relationshipName]; NSXMLElement *relationshipElement = - [NSXMLNode elementWithName: @"relationship"]; + [NSXMLNode elementWithName: @"relationship"]; NSString *relationshipType = [NSString - stringWithFormat: @"%d/%d", [relationshipDescription minCount], - [relationshipDescription maxCount]]; + stringWithFormat: @"%d/%d", [relationshipDescription minCount], + [relationshipDescription maxCount]]; NSEntityDescription *destinationEntity = - [relationshipDescription destinationEntity]; + [relationshipDescription destinationEntity]; id value = [managedObject primitiveValueForKey: relationshipName]; NSSet *valueSet; NSMutableSet *cacheNodeSet = [NSMutableSet set]; @@ -498,15 +501,15 @@ } [relationshipElement - addAttribute: [NSXMLNode attributeWithName: @"name" - stringValue: relationshipName]]; + addAttribute: [NSXMLNode attributeWithName: @"name" + stringValue: relationshipName]]; [relationshipElement - addAttribute: [NSXMLNode attributeWithName: @"type" - stringValue: relationshipType]]; + addAttribute: [NSXMLNode attributeWithName: @"type" + stringValue: relationshipType]]; [relationshipElement - addAttribute: [NSXMLNode - attributeWithName: @"destination" - stringValue: [destinationEntity name]]]; + addAttribute: [NSXMLNode attributeWithName: @"destination" + stringValue: [destinationEntity + name]]]; NSMutableArray *idrefArray = [NSMutableArray array]; @@ -516,18 +519,20 @@ [idrefArray addObject: referenceObject]; NSAtomicStoreCacheNode *relNode = - [self cacheNodeForEntity: destinationEntity - referenceObject: referenceObject]; + [self cacheNodeForEntity: destinationEntity + referenceObject: referenceObject]; [cacheNodeSet addObject: relNode]; } [relationshipElement - addAttribute: - [NSXMLNode - attributeWithName: @"idrefs" - stringValue: [idrefArray - componentsJoinedByString: @" "]]]; + addAttribute: + [NSXMLNode + attributeWithName: @"idrefs" + stringValue: + [idrefArray + componentsJoinedByString: + @" "]]]; [children addObject: relationshipElement]; @@ -535,9 +540,9 @@ [node setValue: cacheNodeSet forKey: relationshipName]; } else { if ([cacheNodeSet count] > 1) { - NSLog( - @"relationship is one to one, yet cacheNodeSet count is %d", - [cacheNodeSet count]); + NSLog(@"relationship is one to one, yet cacheNodeSet count is " + @"%d", + [cacheNodeSet count]); continue; } @@ -553,16 +558,16 @@ } - (NSAtomicStoreCacheNode *) newCacheNodeForManagedObject: - (NSManagedObject *) managedObject + (NSManagedObject *) managedObject { NSEntityDescription *entity = [managedObject entity]; NSManagedObjectID *objectID = [managedObject objectID]; id reference = [self referenceObjectForObjectID: objectID]; NSAtomicStoreCacheNode *cacheNode = - [[NSAtomicStoreCacheNode alloc] initWithObjectID: objectID]; + [[NSAtomicStoreCacheNode alloc] initWithObjectID: objectID]; NSXMLElement *entityElement = - [[NSXMLElement alloc] initWithName: @"object"]; + [[NSXMLElement alloc] initWithName: @"object"]; NSXMLNode *nameAttribute = [NSXMLNode attributeWithName: @"type" stringValue: [entity name]]; NSXMLNode *idAttribute = [NSXMLNode attributeWithName: @"id" @@ -602,7 +607,8 @@ [check release]; [nextObjectIDElement - setStringValue: [NSString stringWithFormat: @"%d", nextInteger + 1]]; + setStringValue: [NSString + stringWithFormat: @"%d", nextInteger + 1]]; return [[NSString alloc] initWithFormat: @"r%d", nextInteger]; } @@ -616,7 +622,7 @@ NSXMLElement *entityElement = [self entityElementForObjectID: objectID]; id entityReference = [self referenceObjectForObjectID: objectID]; NSInteger index = - [[database children] indexOfObjectIdenticalTo: entityElement]; + [[database children] indexOfObjectIdenticalTo: entityElement]; if (index == NSNotFound) NSLog(@"unable to remove object %@ from database - not found", @@ -632,7 +638,7 @@ } - (void) willRemoveFromPersistentStoreCoordinator: - (NSPersistentStoreCoordinator *) coordinator + (NSPersistentStoreCoordinator *) coordinator { [_document release]; _document = nil; diff --git a/CoreData/include/CoreData/NSAtomicStore.h b/CoreData/include/CoreData/NSAtomicStore.h index 99741f6d..b196d934 100644 --- a/CoreData/include/CoreData/NSAtomicStore.h +++ b/CoreData/include/CoreData/NSAtomicStore.h @@ -1,7 +1,7 @@ #import @class NSMutableSet, NSSet, NSAtomicStoreCacheNode, NSManagedObjectID, - NSManagedObject, NSEntityDescription, NSMutableDictionary, NSDictionary; + NSManagedObject, NSEntityDescription, NSMutableDictionary, NSDictionary; @interface NSAtomicStore : NSPersistentStore { NSDictionary *_metadata; @@ -11,7 +11,7 @@ } - initWithPersistentStoreCoordinator: - (NSPersistentStoreCoordinator *) coordinator + (NSPersistentStoreCoordinator *) coordinator configurationName: (NSString *) configurationName URL: (NSURL *) url options: (NSDictionary *) options; @@ -24,9 +24,9 @@ - (void) addCacheNodes: (NSSet *) value; - (NSAtomicStoreCacheNode *) cacheNodeForObjectID: - (NSManagedObjectID *) objectID; + (NSManagedObjectID *) objectID; - (NSAtomicStoreCacheNode *) newCacheNodeForManagedObject: - (NSManagedObject *) managedObject; + (NSManagedObject *) managedObject; - newReferenceObjectForManagedObject: (NSManagedObject *) managedObject; @@ -36,7 +36,7 @@ - referenceObjectForObjectID: (NSManagedObjectID *) objectID; - (void) updateCacheNode: (NSAtomicStoreCacheNode *) node - fromManagedObject: (NSManagedObject *) managedObject; + fromManagedObject: (NSManagedObject *) managedObject; - (void) willRemoveCacheNodes: (NSSet *) cacheNodes; diff --git a/CoreData/include/CoreData/NSEntityDescription.h b/CoreData/include/CoreData/NSEntityDescription.h index 4468bbff..fdce63b5 100644 --- a/CoreData/include/CoreData/NSEntityDescription.h +++ b/CoreData/include/CoreData/NSEntityDescription.h @@ -19,7 +19,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSManagedObject, NSManagedObjectContext, NSManagedObjectModel, - NSPropertyDescription, NSAttributeDescription; + NSPropertyDescription, NSAttributeDescription; @interface NSEntityDescription : NSObject { NSString *_className; @@ -65,6 +65,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSDictionary *) propertiesByName; - (NSDictionary *) relationshipsByName; - (NSArray *) relationshipsWithDestinationEntity: - (NSEntityDescription *) entity; + (NSEntityDescription *) entity; @end diff --git a/CoreData/include/CoreData/NSManagedObject.h b/CoreData/include/CoreData/NSManagedObject.h index 2f41ac03..fbc1187b 100644 --- a/CoreData/include/CoreData/NSManagedObject.h +++ b/CoreData/include/CoreData/NSManagedObject.h @@ -20,8 +20,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSManagedObjectID, NSEntityDescription, NSManagedObjectContext, - NSPropertyDescription, NSMutableDictionary, NSDictionary, NSError, NSArray, - NSMutableSet; + NSPropertyDescription, NSMutableDictionary, NSDictionary, NSError, + NSArray, NSMutableSet; COREDATA_EXPORT NSString *const NSValidationKeyErrorKey; COREDATA_EXPORT NSString *const NSValidationObjectErrorKey; @@ -38,7 +38,7 @@ COREDATA_EXPORT NSString *const NSValidationValueErrorKey; } - initWithEntity: (NSEntityDescription *) entity - insertIntoManagedObjectContext: (NSManagedObjectContext *) context; + insertIntoManagedObjectContext: (NSManagedObjectContext *) context; - (NSEntityDescription *) entity; - (NSManagedObjectID *) objectID; diff --git a/CoreData/include/CoreData/NSManagedObjectContext.h b/CoreData/include/CoreData/NSManagedObjectContext.h index 101e49ac..f9f1469b 100644 --- a/CoreData/include/CoreData/NSManagedObjectContext.h +++ b/CoreData/include/CoreData/NSManagedObjectContext.h @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @class NSSet, NSMutableSet, NSNotification, NSUndoManager, NSMapTable; @class NSManagedObject, NSManagedObjectID, NSFetchRequest, NSPersistentStore, - NSPersistentStoreCoordinator; + NSPersistentStoreCoordinator; COREDATA_EXPORT NSString *const NSManagedObjectContextWillSaveNotification; COREDATA_EXPORT NSString *const NSManagedObjectContextDidSaveNotification; @@ -114,7 +114,7 @@ COREDATA_EXPORT NSString *const NSPersistentStoreSaveConflictsErrorKey; error: (NSError **) error; - (BOOL) save: (NSError **) error; - (void) mergeChangesFromContextDidSaveNotification: - (NSNotification *) notification; + (NSNotification *) notification; - (BOOL) commitEditing; - (void) commitEditingWithDelegate: (id) delegate diff --git a/CoreData/include/CoreData/NSManagedObjectModel.h b/CoreData/include/CoreData/NSManagedObjectModel.h index 51573d43..2e3fcc3c 100644 --- a/CoreData/include/CoreData/NSManagedObjectModel.h +++ b/CoreData/include/CoreData/NSManagedObjectModel.h @@ -44,12 +44,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSArray *) configurations; - (NSArray *) entitiesForConfiguration: (NSString *) configuration; - (void) setEntities: (NSArray *) entities - forConfiguration: (NSString *) configuration; + forConfiguration: (NSString *) configuration; - (NSFetchRequest *) fetchRequestTemplateForName: (NSString *) name; - (NSFetchRequest *) fetchRequestFromTemplateWithName: (NSString *) name substitutionVariables: - (NSDictionary *) variables; + (NSDictionary *) variables; - (void) setFetchRequestTemplate: (NSFetchRequest *) fetchRequest forName: (NSString *) name; diff --git a/CoreData/include/CoreData/NSPersistentStore.h b/CoreData/include/CoreData/NSPersistentStore.h index 342343a3..e6d541c9 100644 --- a/CoreData/include/CoreData/NSPersistentStore.h +++ b/CoreData/include/CoreData/NSPersistentStore.h @@ -14,8 +14,8 @@ + (NSDictionary *) metadataForPersistentStoreWithURL: (NSURL *) url error: (NSError **) error; + (BOOL) setMetadata: (NSDictionary *) metadata - forPersistentStoreWithURL: (NSURL *) url - error: (NSError **) error; + forPersistentStoreWithURL: (NSURL *) url + error: (NSError **) error; + (Class) migrationManagerClass; @@ -42,8 +42,8 @@ - (BOOL) loadMetadata: (NSError **) error; - (void) willRemoveFromPersistentStoreCoordinator: - (NSPersistentStoreCoordinator *) coordinator; + (NSPersistentStoreCoordinator *) coordinator; - (void) didAddToPersistentStoreCoordinator: - (NSPersistentStoreCoordinator *) coordinator; + (NSPersistentStoreCoordinator *) coordinator; @end diff --git a/CoreData/include/CoreData/NSPersistentStoreCoordinator.h b/CoreData/include/CoreData/NSPersistentStoreCoordinator.h index b8fc2cb4..53e89308 100644 --- a/CoreData/include/CoreData/NSPersistentStoreCoordinator.h +++ b/CoreData/include/CoreData/NSPersistentStoreCoordinator.h @@ -33,7 +33,7 @@ COREDATA_EXPORT NSString *const NSBinaryStoreType; COREDATA_EXPORT NSString *const NSMigratePersistentStoresAutomaticallyOption; COREDATA_EXPORT NSString - *const NSPersistentStoreCoordinatorStoresDidChangeNotification; + *const NSPersistentStoreCoordinatorStoresDidChangeNotification; COREDATA_EXPORT NSString *const NSAddedPersistentStoresKey; COREDATA_EXPORT NSString *const NSRemovedPersistentStoresKey; COREDATA_EXPORT NSString *const NSUUIDChangedPersistentStoresKey; @@ -83,11 +83,11 @@ COREDATA_EXPORT NSString *const NSReadOnlyPersistentStoreOption; - (NSDictionary *) metadataForPersistentStore: (NSPersistentStore *) store; - (void) setMetadata: (NSDictionary *) metadata - forPersistentStore: (NSPersistentStore *) store; + forPersistentStore: (NSPersistentStore *) store; + (BOOL) setMetadata: (NSDictionary *) metadata - forPersistentStoreOfType: (NSString *) storeType - URL: (NSURL *) url - error: (NSError **) error; + forPersistentStoreOfType: (NSString *) storeType + URL: (NSURL *) url + error: (NSError **) error; + (NSDictionary *) metadataForPersistentStoreOfType: (NSString *) storeType URL: (NSURL *) url error: (NSError **) error; diff --git a/CoreGraphics/CGAffineTransform.m b/CoreGraphics/CGAffineTransform.m index 76ee9b08..3acfe7fc 100644 --- a/CoreGraphics/CGAffineTransform.m +++ b/CoreGraphics/CGAffineTransform.m @@ -37,7 +37,7 @@ CGAffineTransform CGAffineTransformMake(CGFloat a, CGFloat b, CGFloat c, CGAffineTransform CGAffineTransformMakeRotation(CGFloat radians) { CGAffineTransform xform = { - cos(radians), sin(radians), -sin(radians), cos(radians), 0, 0}; + cos(radians), sin(radians), -sin(radians), cos(radians), 0, 0}; return xform; } diff --git a/CoreGraphics/CGColorSpace.m b/CoreGraphics/CGColorSpace.m index 76a54a77..fece92e7 100644 --- a/CoreGraphics/CGColorSpace.m +++ b/CoreGraphics/CGColorSpace.m @@ -25,30 +25,30 @@ const CFStringRef kCGColorSpaceGenericGray = CFSTR("kCGColorSpaceGenericGray"); const CFStringRef kCGColorSpaceGenericRGB = CFSTR("kCGColorSpaceGenericRGB"); const CFStringRef kCGColorSpaceGenericCMYK = CFSTR("kCGColorSpaceGenericCMYK"); const CFStringRef kCGColorSpaceGenericRGBLinear = - CFSTR("kCGColorSpaceGenericRGBLinear"); + CFSTR("kCGColorSpaceGenericRGBLinear"); const CFStringRef kCGColorSpaceAdobeRGB1998 = - CFSTR("kCGColorSpaceAdobeRGB1998"); + CFSTR("kCGColorSpaceAdobeRGB1998"); const CFStringRef kCGColorSpaceSRGB = CFSTR("kCGColorSpaceSRGB"); const CFStringRef kCGColorSpaceGenericGrayGamma2_2 = - CFSTR("kCGColorSpaceGenericGrayGamma2_2"); + CFSTR("kCGColorSpaceGenericGrayGamma2_2"); const CFStringRef kCGColorSpaceGenericXYZ = CFSTR("kCGColorSpaceGenericXYZ"); const CFStringRef kCGColorSpaceGenericLab = CFSTR("kCGColorSpaceGenericLab"); const CFStringRef kCGColorSpaceACESCGLinear = - CFSTR("kCGColorSpaceACESCGLinear"); + CFSTR("kCGColorSpaceACESCGLinear"); const CFStringRef kCGColorSpaceITUR_709 = CFSTR("kCGColorSpaceITUR_709"); const CFStringRef kCGColorSpaceITUR_2020 = CFSTR("kCGColorSpaceITUR_2020"); const CFStringRef kCGColorSpaceROMMRGB = CFSTR("kCGColorSpaceROMMRGB"); const CFStringRef kCGColorSpaceDCIP3 = CFSTR("kCGColorSpaceDCIP3"); const CFStringRef kCGColorSpaceExtendedSRGB = - CFSTR("kCGColorSpaceExtendedSRGB"); + CFSTR("kCGColorSpaceExtendedSRGB"); const CFStringRef kCGColorSpaceLinearSRGB = CFSTR("kCGColorSpaceLinearSRGB"); const CFStringRef kCGColorSpaceExtendedLinearSRGB = - CFSTR("kCGColorSpaceExtendedLinearSRGB"); + CFSTR("kCGColorSpaceExtendedLinearSRGB"); const CFStringRef kCGColorSpaceExtendedGray = - CFSTR("kCGColorSpaceExtendedGray"); + CFSTR("kCGColorSpaceExtendedGray"); const CFStringRef kCGColorSpaceLinearGray = CFSTR("kCGColorSpaceLinearGray"); const CFStringRef kCGColorSpaceExtendedLinearGray = - CFSTR("kCGColorSpaceExtendedLinearGray"); + CFSTR("kCGColorSpaceExtendedLinearGray"); CGColorSpaceRef CGColorSpaceRetain(CGColorSpaceRef colorSpace) { return O2ColorSpaceRetain(colorSpace); diff --git a/CoreGraphics/CGContext.m b/CoreGraphics/CGContext.m index 8a211105..ead1f108 100644 --- a/CoreGraphics/CGContext.m +++ b/CoreGraphics/CGContext.m @@ -154,7 +154,7 @@ CGAffineTransform CGContextGetUserSpaceToDeviceSpaceTransform(CGContextRef context) { return CGAffineTransformFromO2( - O2ContextGetUserSpaceToDeviceSpaceTransform(context)); + O2ContextGetUserSpaceToDeviceSpaceTransform(context)); } CGAffineTransform CGContextGetCTM(CGContextRef context) { @@ -567,7 +567,7 @@ void CGContextSetAllowsFontSmoothing(CGContextRef context, } void CGContextSetAllowsFontSubpixelQuantization( - CGContextRef context, bool allowsFontSubpixelQuantization) + CGContextRef context, bool allowsFontSubpixelQuantization) { O2ContextSetAllowsFontSubpixelQuantization((O2ContextRef) context, allowsFontSubpixelQuantization); @@ -581,7 +581,7 @@ void CGContextSetShouldSubpixelQuantizeFonts(CGContextRef context, } void CGContextSetAllowsFontSubpixelPositioning( - CGContextRef context, bool allowsFontSubpixelPositioning) + CGContextRef context, bool allowsFontSubpixelPositioning) { O2ContextSetAllowsFontSubpixelPositioning((O2ContextRef) context, allowsFontSubpixelPositioning); diff --git a/CoreGraphics/CGDirectDisplay.m b/CoreGraphics/CGDirectDisplay.m index eb843f76..c14ed5a4 100644 --- a/CoreGraphics/CGDirectDisplay.m +++ b/CoreGraphics/CGDirectDisplay.m @@ -38,9 +38,9 @@ static NSDisplay *currentDisplay(void) { Class cls = NSClassFromString(@"NSDisplay"); if (!cls) { - if (dlopen( - "/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit", - RTLD_LAZY | RTLD_GLOBAL) != NULL) + if (dlopen("/System/Library/Frameworks/AppKit.framework/Versions/C/" + "AppKit", + RTLD_LAZY | RTLD_GLOBAL) != NULL) cls = NSClassFromString(@"NSDisplay"); } @@ -379,7 +379,7 @@ io_service_t CGDisplayIOServicePort(CGDirectDisplayID displayID) { // releases matching for us kern_return_t err = - IOServiceGetMatchingServices(kIOMasterPortDefault, matching, &iter); + IOServiceGetMatchingServices(kIOMasterPortDefault, matching, &iter); if (err) return 0; @@ -394,7 +394,7 @@ io_service_t CGDisplayIOServicePort(CGDirectDisplayID displayID) { vendorIDRef = CFDictionaryGetValue(info, CFSTR(kDisplayVendorID)); productIDRef = CFDictionaryGetValue(info, CFSTR(kDisplayProductID)); serialNumberRef = - CFDictionaryGetValue(info, CFSTR(kDisplaySerialNumber)); + CFDictionaryGetValue(info, CFSTR(kDisplaySerialNumber)); if (!vendorIDRef || !productIDRef || !serialNumberRef) { CFRelease(info); @@ -402,9 +402,9 @@ io_service_t CGDisplayIOServicePort(CGDirectDisplayID displayID) { } success = - CFNumberGetValue(vendorIDRef, kCFNumberCFIndexType, &vendorID); - success &= - CFNumberGetValue(productIDRef, kCFNumberCFIndexType, &productID); + CFNumberGetValue(vendorIDRef, kCFNumberCFIndexType, &vendorID); + success &= CFNumberGetValue(productIDRef, kCFNumberCFIndexType, + &productID); success &= CFNumberGetValue(serialNumberRef, kCFNumberCFIndexType, &serialNumber); @@ -453,8 +453,8 @@ CGError CGAssociateMouseAndMouseCursorPosition(boolean_t connected) { } CFDictionaryRef CGDisplayBestModeForParametersAndRefreshRate( - CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, - CGRefreshRate refreshRate, boolean_t *exactMatch) + CGDirectDisplayID display, size_t bitsPerPixel, size_t width, + size_t height, CGRefreshRate refreshRate, boolean_t *exactMatch) { return nil; } diff --git a/CoreGraphics/CGGeometry.m b/CoreGraphics/CGGeometry.m index 4a7b6343..bfd90c10 100644 --- a/CoreGraphics/CGGeometry.m +++ b/CoreGraphics/CGGeometry.m @@ -60,9 +60,9 @@ CGRect CGRectIntersection(CGRect rect0, CGRect rect1) { result.origin.x = MAX(CGRectGetMinX(rect0), CGRectGetMinX(rect1)); result.origin.y = MAX(CGRectGetMinY(rect0), CGRectGetMinY(rect1)); result.size.width = - MIN(CGRectGetMaxX(rect0), CGRectGetMaxX(rect1)) - result.origin.x; + MIN(CGRectGetMaxX(rect0), CGRectGetMaxX(rect1)) - result.origin.x; result.size.height = - MIN(CGRectGetMaxY(rect0), CGRectGetMaxY(rect1)) - result.origin.y; + MIN(CGRectGetMaxY(rect0), CGRectGetMaxY(rect1)) - result.origin.y; return result; } @@ -105,8 +105,8 @@ CFDictionaryRef CGPointCreateDictionaryRepresentation(CGPoint point) { values[1] = CFNumberCreate(NULL, kCFNumberCGFloatType, &point.y); dict = CFDictionaryCreate( - NULL, (const void **) keys, (const void **) values, 2, - &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + NULL, (const void **) keys, (const void **) values, 2, + &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFRelease(values[0]); CFRelease(values[1]); @@ -148,8 +148,8 @@ CFDictionaryRef CGSizeCreateDictionaryRepresentation(CGSize size) { values[1] = CFNumberCreate(NULL, kCFNumberCGFloatType, &size.height); dict = CFDictionaryCreate( - NULL, (const void **) keys, (const void **) values, 2, - &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + NULL, (const void **) keys, (const void **) values, 2, + &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFRelease(values[0]); CFRelease(values[1]); @@ -193,8 +193,8 @@ CFDictionaryRef CGRectCreateDictionaryRepresentation(CGRect rect) { values[3] = CFNumberCreate(NULL, kCFNumberCGFloatType, &rect.size.height); dict = CFDictionaryCreate( - NULL, (const void **) keys, (const void **) values, 4, - &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + NULL, (const void **) keys, (const void **) values, 4, + &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFRelease(values[0]); CFRelease(values[1]); diff --git a/CoreGraphics/CGGradient.m b/CoreGraphics/CGGradient.m index 8ec3d2cd..60af5a4e 100644 --- a/CoreGraphics/CGGradient.m +++ b/CoreGraphics/CGGradient.m @@ -16,7 +16,7 @@ CGGradientRef CGGradientCreateWithColors(CGColorSpaceRef colorSpace, { CFIndex i, count = CFArrayGetCount(colors); size_t numberOfComponents = - CGColorSpaceGetNumberOfComponents(colorSpace) + 1; + CGColorSpaceGetNumberOfComponents(colorSpace) + 1; CGFloat components[count * numberOfComponents]; for (i = 0; i < count; i++) { diff --git a/CoreGraphics/CGLPixelSurface.m b/CoreGraphics/CGLPixelSurface.m index f9308016..30f808c6 100644 --- a/CoreGraphics/CGLPixelSurface.m +++ b/CoreGraphics/CGLPixelSurface.m @@ -76,14 +76,14 @@ #else O2ColorSpaceRef colorSpace = O2ColorSpaceCreateDeviceRGB(); _surface = - [[O2Surface alloc] initWithBytes: NULL - width: _width - height: -_height - bitsPerComponent: 8 - bytesPerRow: 0 - colorSpace: colorSpace - bitmapInfo: kO2ImageAlphaPremultipliedFirst | - kO2BitmapByteOrder32Little]; + [[O2Surface alloc] initWithBytes: NULL + width: _width + height: -_height + bitsPerComponent: 8 + bytesPerRow: 0 + colorSpace: colorSpace + bitmapInfo: kO2ImageAlphaPremultipliedFirst | + kO2BitmapByteOrder32Little]; O2ColorSpaceRelease(colorSpace); #endif @@ -99,7 +99,7 @@ for (i = 0; i < _numberOfBuffers; i++) { _staticPixels[i] = - ((uint8_t *) [_surface pixelBytes]) + row * bytesPerRow; + ((uint8_t *) [_surface pixelBytes]) + row * bytesPerRow; if (_bufferObjects[i] == 0) { _readPixels[i] = _staticPixels[i]; @@ -224,7 +224,7 @@ static inline uint32_t premultiplyPixel(uint32_t value) { unbind = YES; glBindBuffer(GL_PIXEL_PACK_BUFFER, _bufferObjects[i]); inputRow = - (GLubyte *) glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); + (GLubyte *) glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); } if (_isOpaque) { diff --git a/CoreGraphics/CGPDFContext.m b/CoreGraphics/CGPDFContext.m index 13627807..2b2069d0 100644 --- a/CoreGraphics/CGPDFContext.m +++ b/CoreGraphics/CGPDFContext.m @@ -29,10 +29,10 @@ CGContextRef CGPDFContextCreate(CGDataConsumerRef consumer, const CGRect *mediaBox, CFDictionaryRef auxiliaryInfo) { - return - [[O2PDFContext alloc] initWithConsumer: consumer - mediaBox: mediaBox - auxiliaryInfo: (NSDictionary *) auxiliaryInfo]; + return [[O2PDFContext alloc] + initWithConsumer: consumer + mediaBox: mediaBox + auxiliaryInfo: (NSDictionary *) auxiliaryInfo]; } COREGRAPHICS_EXPORT void CGPDFContextClose(CGContextRef self) { diff --git a/CoreGraphics/CGPDFPage.m b/CoreGraphics/CGPDFPage.m index b64afaaa..fd66e406 100644 --- a/CoreGraphics/CGPDFPage.m +++ b/CoreGraphics/CGPDFPage.m @@ -44,5 +44,5 @@ CGAffineTransform CGPDFPageGetDrawingTransform(CGPDFPageRef self, CGPDFBox box, bool preserveAspectRatio) { return CGAffineTransformFromO2(O2PDFPageGetDrawingTransform( - self, box, rect, clockwiseDegrees, preserveAspectRatio)); + self, box, rect, clockwiseDegrees, preserveAspectRatio)); } diff --git a/CoreGraphics/CGPath.m b/CoreGraphics/CGPath.m index 6790aa2a..4fa024ad 100644 --- a/CoreGraphics/CGPath.m +++ b/CoreGraphics/CGPath.m @@ -159,7 +159,7 @@ CGPathRef CGPathCreateWithEllipseInRect(CGRect rect, const CGAffineTransform *transform) { return (CGPathRef) O2PathCreateWithEllipseInRect( - rect, (O2AffineTransform *) transform); + rect, (O2AffineTransform *) transform); } CGPathRef CGPathCreateWithRect(CGRect rect, const CGAffineTransform *transform) diff --git a/CoreGraphics/KTFont+PDF.m b/CoreGraphics/KTFont+PDF.m index d60041f6..470e2592 100644 --- a/CoreGraphics/KTFont+PDF.m +++ b/CoreGraphics/KTFont+PDF.m @@ -51,7 +51,7 @@ - (const char *) pdfFontName { return [[[[self name] componentsSeparatedByString: @" "] - componentsJoinedByString: @","] cString]; + componentsJoinedByString: @","] cString]; } - (KGPDFDictionary *) _pdfFontDescriptor { @@ -92,20 +92,19 @@ [result setNameForKey: "BaseFont" value: [self pdfFontName]]; [result setIntegerForKey: "FirstChar" value: 0]; [result setIntegerForKey: "LastChar" value: 255]; - [result - setObjectForKey: "Widths" - value: [context - encodeIndirectPDFObject: [self _pdfWidths]]]; + [result setObjectForKey: "Widths" + value: [context encodeIndirectPDFObject: + [self _pdfWidths]]]; [result setObjectForKey: "FontDescriptor" value: [context encodeIndirectPDFObject: - [self _pdfFontDescriptor]]]; + [self _pdfFontDescriptor]]]; [result setNameForKey: "Encoding" value: "WinAnsiEncoding"]; reference = [context encodeIndirectPDFObject: result]; [context setReference: reference - forFontWithName: [self name] - size: _size]; + forFontWithName: [self name] + size: _size]; } return reference; diff --git a/CoreGraphics/include/CoreGraphics/CGAffineTransform.h b/CoreGraphics/include/CoreGraphics/CGAffineTransform.h index e2bbe09a..fc6d888e 100644 --- a/CoreGraphics/include/CoreGraphics/CGAffineTransform.h +++ b/CoreGraphics/include/CoreGraphics/CGAffineTransform.h @@ -34,7 +34,7 @@ COREGRAPHICS_EXPORT const CGAffineTransform CGAffineTransformIdentity; COREGRAPHICS_EXPORT bool CGAffineTransformIsIdentity(CGAffineTransform xform); COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformMake( - CGFloat a, CGFloat b, CGFloat c, CGFloat d, CGFloat tx, CGFloat ty); + CGFloat a, CGFloat b, CGFloat c, CGFloat d, CGFloat tx, CGFloat ty); COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformMakeRotation(CGFloat radians); COREGRAPHICS_EXPORT CGAffineTransform diff --git a/CoreGraphics/include/CoreGraphics/CGDirectDisplay.h b/CoreGraphics/include/CoreGraphics/CGDirectDisplay.h index dd9ce33a..13d79fb1 100644 --- a/CoreGraphics/include/CoreGraphics/CGDirectDisplay.h +++ b/CoreGraphics/include/CoreGraphics/CGDirectDisplay.h @@ -34,19 +34,19 @@ CGGetActiveDisplayList(uint32_t maxDisplays, CGDirectDisplayID *activeDisplays, uint32_t *displayCount); COREGRAPHICS_EXPORT CGError CGGetDisplaysWithOpenGLDisplayMask( - CGOpenGLDisplayMask mask, uint32_t maxDisplays, CGDirectDisplayID *displays, - uint32_t *matchingDisplayCount); + CGOpenGLDisplayMask mask, uint32_t maxDisplays, + CGDirectDisplayID *displays, uint32_t *matchingDisplayCount); COREGRAPHICS_EXPORT CGDirectDisplayID CGOpenGLDisplayMaskToDisplayID(CGOpenGLDisplayMask mask); COREGRAPHICS_EXPORT CGError CGGetDisplaysWithPoint( - CGPoint point, uint32_t maxDisplays, CGDirectDisplayID *displays, - uint32_t *matchingDisplayCount); + CGPoint point, uint32_t maxDisplays, CGDirectDisplayID *displays, + uint32_t *matchingDisplayCount); COREGRAPHICS_EXPORT CGError CGGetDisplaysWithRect( - CGRect rect, uint32_t maxDisplays, CGDirectDisplayID *displays, - uint32_t *matchingDisplayCount); + CGRect rect, uint32_t maxDisplays, CGDirectDisplayID *displays, + uint32_t *matchingDisplayCount); COREGRAPHICS_EXPORT size_t CGDisplayPixelsHigh(CGDirectDisplayID display); COREGRAPHICS_EXPORT size_t CGDisplayPixelsWide(CGDirectDisplayID display); diff --git a/CoreGraphics/include/CoreGraphics/CGImage.h b/CoreGraphics/include/CoreGraphics/CGImage.h index 35cf2a1f..d4b57787 100644 --- a/CoreGraphics/include/CoreGraphics/CGImage.h +++ b/CoreGraphics/include/CoreGraphics/CGImage.h @@ -68,15 +68,16 @@ CF_IMPLICIT_BRIDGING_ENABLED COREGRAPHICS_EXPORT CGImageRef CGImageRetain(CGImageRef image); COREGRAPHICS_EXPORT void CGImageRelease(CGImageRef image); -COREGRAPHICS_EXPORT CGImageRef CGImageCreate( - size_t width, size_t height, size_t bitsPerComponent, size_t bitsPerPixel, - size_t bytesPerRow, CGColorSpaceRef colorSpace, CGBitmapInfo bitmapInfo, - CGDataProviderRef dataProvider, const CGFloat *decode, bool interpolate, - CGColorRenderingIntent renderingIntent); +COREGRAPHICS_EXPORT CGImageRef +CGImageCreate(size_t width, size_t height, size_t bitsPerComponent, + size_t bitsPerPixel, size_t bytesPerRow, + CGColorSpaceRef colorSpace, CGBitmapInfo bitmapInfo, + CGDataProviderRef dataProvider, const CGFloat *decode, + bool interpolate, CGColorRenderingIntent renderingIntent); COREGRAPHICS_EXPORT CGImageRef CGImageMaskCreate( - size_t width, size_t height, size_t bitsPerComponent, size_t bitsPerPixel, - size_t bytesPerRow, CGDataProviderRef dataProvider, const CGFloat *decode, - bool interpolate); + size_t width, size_t height, size_t bitsPerComponent, + size_t bitsPerPixel, size_t bytesPerRow, CGDataProviderRef dataProvider, + const CGFloat *decode, bool interpolate); COREGRAPHICS_EXPORT CGImageRef CGImageCreateCopy(CGImageRef self); COREGRAPHICS_EXPORT CGImageRef @@ -86,11 +87,11 @@ COREGRAPHICS_EXPORT CGImageRef CGImageCreateWithImageInRect(CGImageRef self, CGRect rect); COREGRAPHICS_EXPORT CGImageRef CGImageCreateWithJPEGDataProvider( - CGDataProviderRef jpegProvider, const CGFloat *decode, bool interpolate, - CGColorRenderingIntent renderingIntent); + CGDataProviderRef jpegProvider, const CGFloat *decode, bool interpolate, + CGColorRenderingIntent renderingIntent); COREGRAPHICS_EXPORT CGImageRef CGImageCreateWithPNGDataProvider( - CGDataProviderRef pngProvider, const CGFloat *decode, bool interpolate, - CGColorRenderingIntent renderingIntent); + CGDataProviderRef pngProvider, const CGFloat *decode, bool interpolate, + CGColorRenderingIntent renderingIntent); COREGRAPHICS_EXPORT CGImageRef CGImageCreateWithMask(CGImageRef self, CGImageRef mask); diff --git a/CoreGraphics/include/CoreGraphics/CGPath.h b/CoreGraphics/include/CoreGraphics/CGPath.h index fba727bc..3c979fc3 100644 --- a/CoreGraphics/include/CoreGraphics/CGPath.h +++ b/CoreGraphics/include/CoreGraphics/CGPath.h @@ -113,6 +113,6 @@ CGPathCreateWithRect(CGRect rect, const CGAffineTransform *transform); COREGRAPHICS_EXPORT CGRect CGPathGetPathBoundingBox(CGPathRef path); COREGRAPHICS_EXPORT CGPathRef CGPathCreateCopyByTransformingPath( - CGPathRef path, CGAffineTransform *transform); + CGPathRef path, CGAffineTransform *transform); CF_IMPLICIT_BRIDGING_DISABLED diff --git a/CoreGraphics/include/CoreGraphics/CGShading.h b/CoreGraphics/include/CoreGraphics/CGShading.h index c79cabc3..83d6c829 100644 --- a/CoreGraphics/include/CoreGraphics/CGShading.h +++ b/CoreGraphics/include/CoreGraphics/CGShading.h @@ -30,8 +30,8 @@ COREGRAPHICS_EXPORT CGShadingRef CGShadingRetain(CGShadingRef self); COREGRAPHICS_EXPORT void CGShadingRelease(CGShadingRef self); COREGRAPHICS_EXPORT CGShadingRef CGShadingCreateAxial( - CGColorSpaceRef colorSpace, CGPoint startPoint, CGPoint endPoint, - CGFunctionRef function, bool extendStart, bool extendEnd); + CGColorSpaceRef colorSpace, CGPoint startPoint, CGPoint endPoint, + CGFunctionRef function, bool extendStart, bool extendEnd); COREGRAPHICS_EXPORT CGShadingRef CGShadingCreateRadial(CGColorSpaceRef colorSpace, CGPoint startPoint, CGFloat startRadius, CGPoint endPoint, CGFloat endRadius, diff --git a/CoreGraphics/include/CoreGraphics/CGWindow.h b/CoreGraphics/include/CoreGraphics/CGWindow.h index 562e93a5..a94423ba 100644 --- a/CoreGraphics/include/CoreGraphics/CGWindow.h +++ b/CoreGraphics/include/CoreGraphics/CGWindow.h @@ -108,7 +108,7 @@ typedef enum { frameChanged: (NSRect) frame didSize: (BOOL) didSize; - (NSSize) platformWindow: (CGWindow *) window - frameSizeWillChange: (NSSize) size; + frameSizeWillChange: (NSSize) size; - (void) platformWindowWillBeginSizing: (CGWindow *) window; - (void) platformWindowDidEndSizing: (CGWindow *) window; - (void) platformWindowExitMove: (CGWindow *) window; diff --git a/CoreText/KTFont.m b/CoreText/KTFont.m index 96199008..bcf32460 100644 --- a/CoreText/KTFont.m +++ b/CoreText/KTFont.m @@ -123,8 +123,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) getGlyphs: (CGGlyph *) glyphs - forCharacters: (const unichar *) characters - length: (NSUInteger) length + forCharacters: (const unichar *) characters + length: (NSUInteger) length { int i; @@ -149,7 +149,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ CGFontGetGlyphAdvances(_font, glyphs, count, advances); for (int i = 0; i < count; i++) { advancements[i].width = - ((CGFloat) advances[i] / (CGFloat) _unitsPerEm) * _size; + ((CGFloat) advances[i] / (CGFloat) _unitsPerEm) * _size; advancements[i].height = 0; } } diff --git a/CoreText/KTFont_FT.m b/CoreText/KTFont_FT.m index f20a218a..bfdbd965 100644 --- a/CoreText/KTFont_FT.m +++ b/CoreText/KTFont_FT.m @@ -56,8 +56,8 @@ } - (void) getGlyphs: (CGGlyph *) glyphs - forCharacters: (const unichar *) characters - length: (NSUInteger) length + forCharacters: (const unichar *) characters + length: (NSUInteger) length { O2Font_freetype *o2Font = (O2Font_freetype *) _font; FT_Face face = [o2Font face]; diff --git a/CoreText/include/CoreText/CTFont.h b/CoreText/include/CoreText/CTFont.h index aa670eb9..cd322722 100644 --- a/CoreText/include/CoreText/CTFont.h +++ b/CoreText/include/CoreText/CTFont.h @@ -54,10 +54,10 @@ typedef enum { CF_IMPLICIT_BRIDGING_ENABLED CORETEXT_EXPORT CTFontRef CTFontCreateWithGraphicsFont( - CGFontRef cgFont, CGFloat size, CGAffineTransform *xform, - /* CTFontDescriptorRef */ void *attributes); + CGFontRef cgFont, CGFloat size, CGAffineTransform *xform, + /* CTFontDescriptorRef */ void *attributes); CORETEXT_EXPORT CTFontRef CTFontCreateUIFontForLanguage( - CTFontUIFontType uiFontType, CGFloat size, CFStringRef language); + CTFontUIFontType uiFontType, CGFloat size, CFStringRef language); CORETEXT_EXPORT CFStringRef CTFontCopyFullName(CTFontRef self); CORETEXT_EXPORT CGFloat CTFontGetSize(CTFontRef self); CORETEXT_EXPORT size_t CTFontGetGlyphCount(CTFontRef self); diff --git a/CoreText/include/CoreText/KTFont.h b/CoreText/include/CoreText/KTFont.h index 4ae552f8..46a5bab0 100644 --- a/CoreText/include/CoreText/KTFont.h +++ b/CoreText/include/CoreText/KTFont.h @@ -56,8 +56,8 @@ enum { CGNullGlyph = 0x0 }; isNominal: (BOOL *) isNominalp; - (void) getGlyphs: (CGGlyph *) glyphs - forCharacters: (const unichar *) characters - length: (NSUInteger) length; + forCharacters: (const unichar *) characters + length: (NSUInteger) length; - (void) getAdvancements: (CGSize *) advancements forGlyphs: (const CGGlyph *) glyphs diff --git a/Examples/CGShadingCreate/GradientView.m b/Examples/CGShadingCreate/GradientView.m index 78681950..2ca422bb 100644 --- a/Examples/CGShadingCreate/GradientView.m +++ b/Examples/CGShadingCreate/GradientView.m @@ -67,16 +67,16 @@ void evaluate(void *info, const CGFloat *in, CGFloat *output) { if ([_shadingType selectedTag] == 0) shading = - CGShadingCreateAxial(CGColorSpaceCreateDeviceRGB(), - CGPointMake(_startPoint.x, _startPoint.y), - CGPointMake(_endPoint.x, _endPoint.y), - function, _extendStart, _extendEnd); + CGShadingCreateAxial(CGColorSpaceCreateDeviceRGB(), + CGPointMake(_startPoint.x, _startPoint.y), + CGPointMake(_endPoint.x, _endPoint.y), + function, _extendStart, _extendEnd); else shading = CGShadingCreateRadial( - CGColorSpaceCreateDeviceRGB(), - CGPointMake(_startPoint.x, _startPoint.y), _startRadius, - CGPointMake(_endPoint.x, _endPoint.y), _endRadius, function, - _extendStart, _extendEnd); + CGColorSpaceCreateDeviceRGB(), + CGPointMake(_startPoint.x, _startPoint.y), _startRadius, + CGPointMake(_endPoint.x, _endPoint.y), _endRadius, function, + _extendStart, _extendEnd); CGContextDrawShading(context, shading); @@ -95,8 +95,8 @@ void evaluate(void *info, const CGFloat *in, CGFloat *output) { [self updatePointFields]; [self setNeedsDisplay: YES]; - event = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while ([event type] != NSLeftMouseUp); _mouseFirst = !_mouseFirst; @@ -127,16 +127,16 @@ void evaluate(void *info, const CGFloat *in, CGFloat *output) { } - (IBAction) takeStartColorFromSender: sender { - NSColor *color = - [[sender color] colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + NSColor *color = [[sender color] + colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [color getRed: _C0 green: _C0 + 1 blue: _C0 + 2 alpha: _C0 + 3]; [self setNeedsDisplay: YES]; } - (IBAction) takeEndColorFromSender: sender { - NSColor *color = - [[sender color] colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + NSColor *color = [[sender color] + colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [color getRed: _C1 green: _C1 + 1 blue: _C1 + 2 alpha: _C1 + 3]; [self setNeedsDisplay: YES]; diff --git a/Examples/NSOpenGLView/MyOpenGLView.m b/Examples/NSOpenGLView/MyOpenGLView.m index 51b9c952..0be3ae52 100644 --- a/Examples/NSOpenGLView/MyOpenGLView.m +++ b/Examples/NSOpenGLView/MyOpenGLView.m @@ -20,7 +20,7 @@ static void drawArcWithDepth(float beginAngle, float endAngle, { for (; beginAngle <= endAngle; beginAngle += 1) { CGAffineTransform matrix = - CGAffineTransformMakeRotation(M_PI * beginAngle / 180.0); + CGAffineTransformMakeRotation(M_PI * beginAngle / 180.0); CGPoint innerPoint = CGPointMake(innerRadius, 0); CGPoint outerPoint = CGPointMake(outerRadius, 0); @@ -37,7 +37,7 @@ static void drawEdge(float beginAngle, float endAngle, float radius, { for (; beginAngle <= endAngle; beginAngle += 1) { CGAffineTransform matrix = - CGAffineTransformMakeRotation(M_PI * beginAngle / 180.0); + CGAffineTransformMakeRotation(M_PI * beginAngle / 180.0); CGPoint point = CGPointMake(radius, 0); CGPoint normal = CGPointMake(1, 0); @@ -54,7 +54,7 @@ static void capAtAngle(float angle, float innerRadius, float outerRadius, float depth) { CGAffineTransform matrix = - CGAffineTransformMakeRotation(M_PI * angle / 180.0); + CGAffineTransformMakeRotation(M_PI * angle / 180.0); CGPoint innerPoint = CGPointMake(innerRadius, 0); CGPoint outerPoint = CGPointMake(outerRadius, 0); CGPoint normal = CGPointMake(1, 0); diff --git a/Examples/TextEditor/MyDocument.m b/Examples/TextEditor/MyDocument.m index c1146f0a..6efdecaa 100644 --- a/Examples/TextEditor/MyDocument.m +++ b/Examples/TextEditor/MyDocument.m @@ -40,7 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSData *) dataRepresentationOfType: (NSString *) aType { return [[[_textView textStorage] string] - dataUsingEncoding: NSISOLatin1StringEncoding]; + dataUsingEncoding: NSISOLatin1StringEncoding]; } - (BOOL) loadDataRepresentation: (NSData *) data ofType: (NSString *) aType { diff --git a/Foundation/NSAffineTransform.m b/Foundation/NSAffineTransform.m index 319ad975..966ae5c5 100644 --- a/Foundation/NSAffineTransform.m +++ b/Foundation/NSAffineTransform.m @@ -60,7 +60,7 @@ invertStruct(NSAffineTransformStruct matrix) result.m21 = -matrix.m21 / determinant; result.m22 = matrix.m11 / determinant; result.tX = - (-matrix.m22 * matrix.tX + matrix.m21 * matrix.tY) / determinant; + (-matrix.m22 * matrix.tX + matrix.m21 * matrix.tY) / determinant; result.tY = (matrix.m12 * matrix.tX - matrix.m11 * matrix.tY) / determinant; return result; @@ -176,7 +176,7 @@ invertStruct(NSAffineTransformStruct matrix) - (void) rotateByRadians: (CGFloat) radians { NSAffineTransformStruct rotate = { - cos(radians), sin(radians), -sin(radians), cos(radians), 0, 0}; + cos(radians), sin(radians), -sin(radians), cos(radians), 0, 0}; _matrix = multiplyStruct(_matrix, rotate); } diff --git a/Foundation/NSArray/NSArray.m b/Foundation/NSArray/NSArray.m index 0c1016ae..759af53e 100644 --- a/Foundation/NSArray/NSArray.m +++ b/Foundation/NSArray/NSArray.m @@ -180,13 +180,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + arrayWithContentsOfFile: (NSString *) path { - return - [[[self allocWithZone: NULL] initWithContentsOfFile: path] autorelease]; + return [[[self allocWithZone: NULL] initWithContentsOfFile: path] + autorelease]; } + arrayWithContentsOfURL: (NSURL *) url { - return - [[[self allocWithZone: NULL] initWithContentsOfURL: url] autorelease]; + return [[[self allocWithZone: NULL] initWithContentsOfURL: url] + autorelease]; } + arrayWithObject: object { @@ -545,11 +545,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @end void objc_enumerationMutation(id collection) { - [NSException - raise: NSInternalInconsistencyException - format: @"Collection %p of class %@ was mutated during enumeration. " - @"Break on objc_enumerationMutation to debug.", - collection, [collection className]]; + [NSException raise: NSInternalInconsistencyException + format: @"Collection %p of class %@ was mutated during " + @"enumeration. " + @"Break on objc_enumerationMutation to debug.", + collection, [collection className]]; } #import diff --git a/Foundation/NSArray/NSEnumerator_array.m b/Foundation/NSArray/NSEnumerator_array.m index 6de2b08f..ebf22973 100644 --- a/Foundation/NSArray/NSEnumerator_array.m +++ b/Foundation/NSArray/NSEnumerator_array.m @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSEnumerator *NSEnumerator_arrayNew(NSArray *array) { NSEnumerator_array *self = - NSAllocateObject([NSEnumerator_array class], 0, NULL); + NSAllocateObject([NSEnumerator_array class], 0, NULL); if (self) { self->_index = 0; self->_array = [array retain]; diff --git a/Foundation/NSArray/NSEnumerator_arrayReverse.m b/Foundation/NSArray/NSEnumerator_arrayReverse.m index f6525f73..7724e345 100644 --- a/Foundation/NSArray/NSEnumerator_arrayReverse.m +++ b/Foundation/NSArray/NSEnumerator_arrayReverse.m @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSEnumerator *NSEnumerator_arrayReverseNew(NSArray *array) { NSEnumerator_arrayReverse *self = - NSAllocateObject([NSEnumerator_arrayReverse class], 0, NULL); + NSAllocateObject([NSEnumerator_arrayReverse class], 0, NULL); if (self) { self->_index = [array count]; self->_array = [array retain]; diff --git a/Foundation/NSArray/NSMutableArray.m b/Foundation/NSArray/NSMutableArray.m index fb3f66b4..a73d25e5 100644 --- a/Foundation/NSArray/NSMutableArray.m +++ b/Foundation/NSArray/NSMutableArray.m @@ -90,10 +90,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + arrayWithCapacity: (NSUInteger) capacity { if (self == [NSMutableArray class]) return NSAutorelease( - NSMutableArray_concreteNewWithCapacity(NULL, capacity)); + NSMutableArray_concreteNewWithCapacity(NULL, capacity)); - return - [[[self allocWithZone: NULL] initWithCapacity: capacity] autorelease]; + return [[[self allocWithZone: NULL] initWithCapacity: capacity] + autorelease]; } + arrayWithObjects: first, ... { @@ -374,8 +374,8 @@ static int _nsmutablearraycompareindices(const void *v1, const void *v2) { withObjectsFromArray: (NSArray *) array { [self replaceObjectsInRange: range - withObjectsFromArray: array - range: NSMakeRange(0, [array count])]; + withObjectsFromArray: array + range: NSMakeRange(0, [array count])]; } - (void) replaceObjectsInRange: (NSRange) range @@ -501,7 +501,7 @@ static NSComparisonResult compareObjectsUsingDescriptors(id A, id B, } - (NSUInteger) _insertObject: (id) obj - inArraySortedByDescriptors: (NSArray *) descriptors + inArraySortedByDescriptors: (NSArray *) descriptors { NSUInteger start = 0; NSUInteger end = [self count]; @@ -511,7 +511,7 @@ static NSComparisonResult compareObjectsUsingDescriptors(id A, id B, while (mid = (start + end) / 2, start < end) { id other = [self objectAtIndex: mid]; NSComparisonResult res = - compareObjectsUsingDescriptors(obj, other, descriptors); + compareObjectsUsingDescriptors(obj, other, descriptors); if (res == NSOrderedAscending) { end = mid; diff --git a/Foundation/NSArray/NSMutableArray_concrete.m b/Foundation/NSArray/NSMutableArray_concrete.m index 32ed60ec..a0c34642 100644 --- a/Foundation/NSArray/NSMutableArray_concrete.m +++ b/Foundation/NSArray/NSMutableArray_concrete.m @@ -58,7 +58,7 @@ NSMutableArray_concreteInitWithCapacity(NSMutableArray_concrete *self, NSArray *NSMutableArray_concreteNew(NSZone *zone, id *objects, NSUInteger count) { NSMutableArray_concrete *self = - NSAllocateObject([NSMutableArray_concrete class], 0, zone); + NSAllocateObject([NSMutableArray_concrete class], 0, zone); if (self) { self = NSMutableArray_concreteInit(self, objects, count, zone); } @@ -69,7 +69,7 @@ NSArray *NSMutableArray_concreteNewWithCapacity(NSZone *zone, NSUInteger capacity) { NSMutableArray_concrete *self = - NSAllocateObject([NSMutableArray_concrete class], 0, zone); + NSAllocateObject([NSMutableArray_concrete class], 0, zone); if (self) { self = NSMutableArray_concreteInitWithCapacity(self, capacity, zone); } @@ -242,8 +242,8 @@ static void removeObjectAtIndex(NSMutableArray_concrete *self, NSUInteger index) if (self->_capacity > self->_count * 2) { self->_capacity = self->_count; self->_objects = - NSZoneRealloc(NSZoneFromPointer(self->_objects), self->_objects, - sizeof(id) * self->_capacity); + NSZoneRealloc(NSZoneFromPointer(self->_objects), self->_objects, + sizeof(id) * self->_capacity); } } @@ -276,8 +276,8 @@ static void removeObjectAtIndex(NSMutableArray_concrete *self, NSUInteger index) if (self->_capacity > 8) { self->_capacity = 8; self->_objects = - NSZoneRealloc(NSZoneFromPointer(self->_objects), self->_objects, - sizeof(id) * self->_capacity); + NSZoneRealloc(NSZoneFromPointer(self->_objects), self->_objects, + sizeof(id) * self->_capacity); } } @@ -342,7 +342,7 @@ static inline NSUInteger indexOfObject(NSMutableArray_concrete *self, id object) for (j = iLeft; j < iEnd; j++) { /* If left list head exists and is <= existing right list head */ if (i0 < iRight && (i1 >= iEnd || compare(A[i0], A[i1], context) != - NSOrderedDescending)) { + NSOrderedDescending)) { B[j] = A[i0++]; } else { B[j] = A[i1++]; diff --git a/Foundation/NSAssertionHandler.h b/Foundation/NSAssertionHandler.h index 3e858386..c6a1d194 100644 --- a/Foundation/NSAssertionHandler.h +++ b/Foundation/NSAssertionHandler.h @@ -27,24 +27,25 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ do { \ if (!(condition)) { \ [[NSAssertionHandler currentHandler] \ - handleFailureInMethod: _cmd \ - object: self \ - file: [NSString \ - stringWithUTF8String: __FILE__] \ - lineNumber: __LINE__ \ - description: (desc), ##__VA_ARGS__]; \ + handleFailureInMethod: _cmd \ + object: self \ + file: [NSString stringWithUTF8String: \ + __FILE__] \ + lineNumber: __LINE__ \ + description: (desc), ##__VA_ARGS__]; \ } \ } while (0) #define _NSCAssertBody(condition, desc, ...) \ do { \ if (!(condition)) { \ [[NSAssertionHandler currentHandler] \ - handleFailureInFunction: \ - [NSString stringWithUTF8String: __PRETTY_FUNCTION__] \ - file: [NSString \ - stringWithUTF8String: __FILE__] \ - lineNumber: __LINE__ \ - description: (desc), ##__VA_ARGS__]; \ + handleFailureInFunction: \ + [NSString \ + stringWithUTF8String: __PRETTY_FUNCTION__] \ + file: [NSString stringWithUTF8String: \ + __FILE__] \ + lineNumber: __LINE__ \ + description: (desc), ##__VA_ARGS__]; \ } \ } while (0) #endif // NS_BLOCK_ASSERTIONS diff --git a/Foundation/NSAssertionHandler.m b/Foundation/NSAssertionHandler.m index 08226c86..71f65cec 100644 --- a/Foundation/NSAssertionHandler.m +++ b/Foundation/NSAssertionHandler.m @@ -27,13 +27,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSAssertionHandler *) currentHandler { id currentHandlerForThread = [[[NSThread currentThread] threadDictionary] - objectForKey: [self className]]; + objectForKey: [self className]]; if ((currentHandlerForThread == NULL) && ((currentHandlerForThread = [[self alloc] init]) != NULL)) { [[[NSThread currentThread] threadDictionary] - setObject: currentHandlerForThread - forKey: [self className]]; + setObject: currentHandlerForThread + forKey: [self className]]; } return (currentHandlerForThread); diff --git a/Foundation/NSAttributedString/NSAttributedString.h b/Foundation/NSAttributedString/NSAttributedString.h index 43832cdb..c458d167 100644 --- a/Foundation/NSAttributedString/NSAttributedString.h +++ b/Foundation/NSAttributedString/NSAttributedString.h @@ -39,12 +39,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ inRange: (NSRange) inRange; - attribute: (NSString *) name - atIndex: (NSUInteger) location - effectiveRange: (NSRange *) range; + atIndex: (NSUInteger) location + effectiveRange: (NSRange *) range; - attribute: (NSString *) name - atIndex: (NSUInteger) location - longestEffectiveRange: (NSRange *) range - inRange: (NSRange) inRange; + atIndex: (NSUInteger) location + longestEffectiveRange: (NSRange *) range + inRange: (NSRange) inRange; - (NSAttributedString *) attributedSubstringFromRange: (NSRange) range; diff --git a/Foundation/NSAttributedString/NSAttributedString.m b/Foundation/NSAttributedString/NSAttributedString.m index a5063719..8c2abae1 100644 --- a/Foundation/NSAttributedString/NSAttributedString.m +++ b/Foundation/NSAttributedString/NSAttributedString.m @@ -73,12 +73,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - mutableCopy { return [[NSMutableAttributedString allocWithZone: NULL] - initWithAttributedString: self]; + initWithAttributedString: self]; } - mutableCopyWithZone: (NSZone *) zone { return [[NSMutableAttributedString allocWithZone: zone] - initWithAttributedString: self]; + initWithAttributedString: self]; } - (BOOL) isEqualToAttributedString: (NSAttributedString *) other { @@ -146,17 +146,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - attribute: (NSString *) name - atIndex: (NSUInteger) location - effectiveRange: (NSRange *) range + atIndex: (NSUInteger) location + effectiveRange: (NSRange *) range { return [[self attributesAtIndex: location effectiveRange: range] objectForKey: name]; } - attribute: (NSString *) name - atIndex: (NSUInteger) location - longestEffectiveRange: (NSRange *) range - inRange: (NSRange) inRange + atIndex: (NSUInteger) location + longestEffectiveRange: (NSRange *) range + inRange: (NSRange) inRange { NSUnimplementedMethod(); return nil; @@ -164,7 +164,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSAttributedString *) attributedSubstringFromRange: (NSRange) range { NSMutableAttributedString *result = - [[[NSMutableAttributedString allocWithZone: NULL] init] autorelease]; + [[[NSMutableAttributedString allocWithZone: NULL] init] + autorelease]; NSUInteger location = range.location; NSUInteger limit = MIN(NSMaxRange(range), [self length]); @@ -183,7 +184,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ appendedRange.location = [result length]; appendedRange.length = effectiveRange.length; [[result mutableString] - appendString: [[self string] substringWithRange: effectiveRange]]; + appendString: [[self string] + substringWithRange: effectiveRange]]; [result setAttributes: attributes range: appendedRange]; location = NSMaxRange(effectiveRange); diff --git a/Foundation/NSAttributedString/NSAttributedString_placeholder.m b/Foundation/NSAttributedString/NSAttributedString_placeholder.m index 93c67ac3..af6455c7 100644 --- a/Foundation/NSAttributedString/NSAttributedString_placeholder.m +++ b/Foundation/NSAttributedString/NSAttributedString_placeholder.m @@ -32,22 +32,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSDeallocateObject(self); return [NSAllocateObject([NSAttributedString_nilAttributes class], 0, NULL) - initWithString: string]; + initWithString: string]; } - initWithString: (NSString *) string attributes: (NSDictionary *) attributes { NSDeallocateObject(self); return [NSAllocateObject([NSAttributedString_oneAttribute class], 0, NULL) - initWithString: string - attributes: attributes]; + initWithString: string + attributes: attributes]; } - initWithAttributedString: (NSAttributedString *) other { NSDeallocateObject(self); return [NSAllocateObject([NSAttributedString_manyAttributes class], 0, NULL) - initWithAttributedString: other]; + initWithAttributedString: other]; } - initWithCoder: (NSCoder *) coder { @@ -64,7 +64,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ attributes: attributes]; } return [NSAllocateObject([NSAttributedString_nilAttributes class], 0, NULL) - initWithString: string]; + initWithString: string]; } @end diff --git a/Foundation/NSAttributedString/NSMutableAttributedString.m b/Foundation/NSAttributedString/NSMutableAttributedString.m index 0f1b5b26..f1c3370d 100644 --- a/Foundation/NSAttributedString/NSMutableAttributedString.m +++ b/Foundation/NSAttributedString/NSMutableAttributedString.m @@ -50,7 +50,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (id) copyWithZone: (NSZone *) zone { return [[NSAttributedString allocWithZone: NULL] - initWithAttributedString: self]; + initWithAttributedString: self]; } - (NSMutableString *) mutableString { @@ -72,9 +72,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ while (location < limit) { NSRange effectiveRange; - NSMutableDictionary *modify = - [[[self attributesAtIndex: location effectiveRange: &effectiveRange] - mutableCopy] autorelease]; + NSMutableDictionary *modify = [[[self + attributesAtIndex: location + effectiveRange: &effectiveRange] mutableCopy] autorelease]; NSRange replace; [modify addEntriesFromDictionary: attributes]; @@ -111,7 +111,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ replace.location = location; replace.length = - MIN(NSMaxRange(range), NSMaxRange(effectiveRange)) - location; + MIN(NSMaxRange(range), NSMaxRange(effectiveRange)) - location; if ([check objectForKey: name] != nil) { NSMutableDictionary *modify = [[check mutableCopy] autorelease]; diff --git a/Foundation/NSAttributedString/NSMutableAttributedString_concrete.m b/Foundation/NSAttributedString/NSMutableAttributedString_concrete.m index d4d11088..7a260e74 100644 --- a/Foundation/NSAttributedString/NSMutableAttributedString_concrete.m +++ b/Foundation/NSAttributedString/NSMutableAttributedString_concrete.m @@ -91,8 +91,8 @@ static NSUInteger decodeFromData(NSData *data, NSUInteger offset, } else { // we've got an array to work through NSMutableAttributedString *attrStr = - [[[NSMutableAttributedString alloc] initWithString: string] - autorelease]; + [[[NSMutableAttributedString alloc] initWithString: string] + autorelease]; NSData *data = [keyed decodeObjectForKey: @"NSAttributeInfo"]; NSArray *attributesArray = attributes; NSUInteger offset = 0; @@ -128,13 +128,13 @@ static NSUInteger decodeFromData(NSData *data, NSUInteger offset, [keyed encodeObject: dict forKey: @"NSAttributes"]; } else { NSMutableArray *attributesArray = - [NSMutableArray arrayWithCapacity: 10]; + [NSMutableArray arrayWithCapacity: 10]; // we've got more than one set of attributes so we have to encode // more data NSUInteger count = NSCountRangeEntries(_rangeToAttributes); NSMutableData *data = [NSMutableData dataWithCapacity: count * 4]; NSRangeEnumerator enumerator = - NSRangeEntryEnumerator(_rangeToAttributes); + NSRangeEntryEnumerator(_rangeToAttributes); NSDictionary *attributes = nil; int i = 0; while (NSNextRangeEnumeratorEntry(&enumerator, &range, @@ -218,9 +218,9 @@ static NSUInteger decodeFromData(NSData *data, NSUInteger offset, } - (NSMutableString *) mutableString { - return - [[[NSMutableString_proxyToMutableAttributedString allocWithZone: NULL] - initWithMutableAttributedString: self] autorelease]; + return [[[NSMutableString_proxyToMutableAttributedString + allocWithZone: NULL] initWithMutableAttributedString: self] + autorelease]; } - (void) fixAttributesAfterEditingRange: (NSRange) range { diff --git a/Foundation/NSAttributedString/NSMutableString_proxyToMutableAttributedString.h b/Foundation/NSAttributedString/NSMutableString_proxyToMutableAttributedString.h index 7e71312e..20e10b8a 100644 --- a/Foundation/NSAttributedString/NSMutableString_proxyToMutableAttributedString.h +++ b/Foundation/NSAttributedString/NSMutableString_proxyToMutableAttributedString.h @@ -25,6 +25,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithMutableAttributedString: - (NSMutableAttributedString *) attributedString; + (NSMutableAttributedString *) attributedString; @end diff --git a/Foundation/NSAttributedString/NSMutableString_proxyToMutableAttributedString.m b/Foundation/NSAttributedString/NSMutableString_proxyToMutableAttributedString.m index c44afae6..350b5b43 100644 --- a/Foundation/NSAttributedString/NSMutableString_proxyToMutableAttributedString.m +++ b/Foundation/NSAttributedString/NSMutableString_proxyToMutableAttributedString.m @@ -22,7 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSMutableString_proxyToMutableAttributedString - initWithMutableAttributedString: - (NSMutableAttributedString *) attributedString + (NSMutableAttributedString *) attributedString { _attributedString = [attributedString retain]; return self; diff --git a/Foundation/NSAttributedString/NSRangeEntries.m b/Foundation/NSAttributedString/NSRangeEntries.m index 8594a0f1..b8532fc5 100644 --- a/Foundation/NSAttributedString/NSRangeEntries.m +++ b/Foundation/NSAttributedString/NSRangeEntries.m @@ -41,7 +41,7 @@ NSRangeEntries *NSCreateRangeToOwnedPointerEntries(NSUInteger capacity) { result->capacity = (capacity < 4) ? 4 : capacity; result->count = 0; result->entries = - NSZoneMalloc(NULL, sizeof(NSRangeEntry) * result->capacity); + NSZoneMalloc(NULL, sizeof(NSRangeEntry) * result->capacity); result->objects = NO; return result; @@ -166,8 +166,8 @@ void NSRangeEntryInsert(NSRangeEntries *self, NSRange range, void *value) { // one if (range.length == 0 || [(id)(self->entries[insertAt - 1].value) isEqual: value]) { - range = - NSUnionRange(self->entries[insertAt - 1].range, range); + range = NSUnionRange(self->entries[insertAt - 1].range, + range); self->entries[insertAt - 1].range = range; merged = YES; } @@ -230,7 +230,8 @@ void *NSRangeEntryAtIndex(NSRangeEntries *self, NSUInteger location, if (effectiveRangep != NULL) { effectiveRangep->location = NSMaxRange(check); effectiveRangep->length = - self->entries[next].range.location - NSMaxRange(check); + self->entries[next].range.location - + NSMaxRange(check); } return NULL; } @@ -247,9 +248,9 @@ void *NSRangeEntryAtIndex(NSRangeEntries *self, NSUInteger location, } else if (location >= NSMaxRange(self->entries[prev].range)) { if (effectiveRangep != NULL) { effectiveRangep->location = - NSMaxRange(self->entries[prev].range); + NSMaxRange(self->entries[prev].range); effectiveRangep->length = - check.location - effectiveRangep->location; + check.location - effectiveRangep->location; } return NULL; } @@ -340,14 +341,14 @@ void NSRangeEntriesExpandAndWipe(NSRangeEntries *self, NSRange range, removeEntryAtIndex(self, count); else self->entries[count].range = - NSMakeRange(max + delta, NSMaxRange(check) - max); + NSMakeRange(max + delta, NSMaxRange(check) - max); } else if (check.location == range.location) { if (delta < 0 && -delta >= check.length) removeEntryAtIndex(self, count); else if (useAttributes == useFirst) { self->entries[count].range.length = - MAX(max + delta, NSMaxRange(check) + delta) - - check.location; + MAX(max + delta, NSMaxRange(check) + delta) - + check.location; useAttributes = useNone; } } else if (check.location < range.location) { @@ -357,10 +358,10 @@ void NSRangeEntriesExpandAndWipe(NSRangeEntries *self, NSRange range, self->entries[count].range.length += delta; else if (useAttributes == useBefore || useAttributes == useFirst) self->entries[count].range.length = - (max + delta) - check.location; + (max + delta) - check.location; else self->entries[count].range.length = - range.location - check.location; + range.location - check.location; } } } @@ -397,7 +398,7 @@ void NSRangeEntriesDivideAndConquer(NSRangeEntries *self, NSRange range) { } // Shorten the entry to make room for the added one self->entries[count].range.length = - range.location - check.location; + range.location - check.location; } } } diff --git a/Foundation/NSBundle.m b/Foundation/NSBundle.m index b96ef245..ac00d72b 100644 --- a/Foundation/NSBundle.m +++ b/Foundation/NSBundle.m @@ -151,7 +151,7 @@ static char *lastErrorString(DWORD error) { LPVOID lpMsgBuf; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, NULL); @@ -247,15 +247,16 @@ NSModuleHandle NSLoadModule(const char *path, NSError **error) { } else { if (error != NULL) { *error = [NSError - errorWithDomain: NSPOSIXErrorDomain - code: 0 - userInfo: - [NSDictionary - dictionaryWithObject: - @"NSLoadModule: cannot find cwd and " - @"relative path specified" - forKey: - NSLocalizedDescriptionKey]]; + errorWithDomain: NSPOSIXErrorDomain + code: 0 + userInfo: + [NSDictionary + dictionaryWithObject: + @"NSLoadModule: cannot " + @"find cwd and " + @"relative path " + @"specified" + forKey: NSLocalizedDescriptionKey]]; } return NULL; } @@ -265,16 +266,16 @@ NSModuleHandle NSLoadModule(const char *path, NSError **error) { if (handle == NULL) { if (error != NULL) { *error = [NSError - errorWithDomain: NSPOSIXErrorDomain - code: 0 - userInfo: - [NSDictionary - dictionaryWithObject: - [NSString - stringWithFormat: @"%s", - NSLastModuleError()] - forKey: - NSLocalizedDescriptionKey]]; + errorWithDomain: NSPOSIXErrorDomain + code: 0 + userInfo: + [NSDictionary + dictionaryWithObject: + [NSString + stringWithFormat: + @"%s", + NSLastModuleError()] + forKey: NSLocalizedDescriptionKey]]; } } @@ -356,18 +357,19 @@ static NSMapTable *pathToObject = NULL; if (![extension isEqualToString: NSPlatformLoadableObjectFileExtension]) { // Support for MyProgram.app/MyProgram[.exe] if ([[directory lastPathComponent] - isEqualToString: [NSString stringWithFormat: @"%@.app", - name]] == YES) { + isEqualToString: [NSString stringWithFormat: @"%@.app", + name]] == + YES) { return directory; } else { NSString *check = [[directory stringByAppendingPathComponent: name] - stringByAppendingPathExtension: @"app"]; + stringByAppendingPathExtension: @"app"]; if ([[NSFileManager defaultManager] fileExistsAtPath: check]) { result = check; } else { result = [[directory stringByDeletingLastPathComponent] - stringByDeletingLastPathComponent]; + stringByDeletingLastPathComponent]; } } } else { @@ -379,25 +381,27 @@ static NSMapTable *pathToObject = NULL; } if ([[directory lastPathComponent] - isEqualToString: [NSString stringWithFormat: @"%@.bundle", - name]] == YES) { + isEqualToString: [NSString stringWithFormat: @"%@.bundle", + name]] == + YES) { return directory; } else { check = [[directory stringByAppendingPathComponent: name] - stringByAppendingPathExtension: @"framework"]; + stringByAppendingPathExtension: @"framework"]; if ([[NSFileManager defaultManager] fileExistsAtPath: check]) { result = check; } else { check = [[[directory stringByDeletingLastPathComponent] - stringByAppendingPathComponent: @"Frameworks"] - stringByAppendingPathComponent: - [name stringByAppendingPathExtension: @"framework"]]; + stringByAppendingPathComponent: @"Frameworks"] + stringByAppendingPathComponent: + [name stringByAppendingPathExtension: + @"framework"]]; if ([[NSFileManager defaultManager] fileExistsAtPath: check]) { result = check; } else { result = [[directory stringByDeletingLastPathComponent] - stringByDeletingLastPathComponent]; + stringByDeletingLastPathComponent]; } } } @@ -522,14 +526,14 @@ static NSMapTable *pathToObject = NULL; _resourcePath = [_path stringByAppendingPathComponent: @"Resources"]; if (![[NSFileManager defaultManager] fileExistsAtPath: _resourcePath]) { _resourcePath = [[_path stringByAppendingPathComponent: @"Contents"] - stringByAppendingPathComponent: @"Resources"]; + stringByAppendingPathComponent: @"Resources"]; } [_resourcePath retain]; _pluginPath = [_path stringByAppendingPathComponent: @"PlugIns"]; if (![[NSFileManager defaultManager] fileExistsAtPath: _pluginPath]) { _pluginPath = [[_path stringByAppendingPathComponent: @"Contents"] - stringByAppendingPathComponent: @"PlugIns"]; + stringByAppendingPathComponent: @"PlugIns"]; } [_pluginPath retain]; @@ -597,8 +601,8 @@ static NSMapTable *pathToObject = NULL; if (_infoDictionary == nil) { NSString *path = [[[_path stringByAppendingPathComponent: @"Contents"] - stringByAppendingPathComponent: @"Info"] - stringByAppendingPathExtension: @"plist"]; + stringByAppendingPathComponent: @"Info"] + stringByAppendingPathExtension: @"plist"]; if (![[NSFileManager defaultManager] fileExistsAtPath: path]) path = nil; @@ -610,10 +614,10 @@ static NSMapTable *pathToObject = NULL; if (![[NSFileManager defaultManager] fileExistsAtPath: path]) path = [[_path stringByAppendingPathComponent: @"Info"] - stringByAppendingPathExtension: @"plist"]; + stringByAppendingPathExtension: @"plist"]; - _infoDictionary = - [[NSDictionary allocWithZone: NULL] initWithContentsOfFile: path]; + _infoDictionary = [[NSDictionary allocWithZone: NULL] + initWithContentsOfFile: path]; if (_infoDictionary == nil) _infoDictionary = [NSDictionary new]; @@ -676,8 +680,8 @@ static NSMapTable *pathToObject = NULL; // Try to enhance compatibility with Unix-ish code. if ([NSPlatformExecutableFileExtension length]) { - path = [path - stringByAppendingPathExtension: NSPlatformExecutableFileExtension]; + path = [path stringByAppendingPathExtension: + NSPlatformExecutableFileExtension]; if ([fm isExecutableFileAtPath: path]) return path; } @@ -717,7 +721,7 @@ static NSMapTable *pathToObject = NULL; - (NSString *) _findExecutable { NSString *type = [_path pathExtension]; NSString *name = [[[self infoDictionary] - objectForKey: @"CFBundleExecutable"] stringByDeletingPathExtension]; + objectForKey: @"CFBundleExecutable"] stringByDeletingPathExtension]; NSString *checkDir; NSArray *contents; NSInteger i, count; @@ -727,14 +731,14 @@ static NSMapTable *pathToObject = NULL; if ([type isEqualToString: @"framework"]) checkDir = [[[_path stringByDeletingLastPathComponent] - stringByDeletingLastPathComponent] - stringByAppendingPathComponent: @"Executables"]; + stringByDeletingLastPathComponent] + stringByAppendingPathComponent: @"Executables"]; else checkDir = [[_path stringByAppendingPathComponent: @"Contents"] - stringByAppendingPathComponent: NSPlatformExecutableDirectory]; + stringByAppendingPathComponent: NSPlatformExecutableDirectory]; contents = - [[NSFileManager defaultManager] directoryContentsAtPath: checkDir]; + [[NSFileManager defaultManager] directoryContentsAtPath: checkDir]; count = [contents count]; // Need to check for * versioning @@ -751,11 +755,12 @@ static NSMapTable *pathToObject = NULL; } if ([type isEqualToString: @"app"] == YES) { return [[_path stringByAppendingPathComponent: name] - stringByAppendingPathExtension: NSPlatformExecutableFileExtension]; + stringByAppendingPathExtension: + NSPlatformExecutableFileExtension]; } else { return [[_path stringByAppendingPathComponent: name] - stringByAppendingPathExtension: - NSPlatformLoadableObjectFileExtension]; + stringByAppendingPathExtension: + NSPlatformLoadableObjectFileExtension]; } } @@ -816,13 +821,13 @@ static NSMapTable *pathToObject = NULL; // language once the defaults are available. if ([NSUserDefaults standardUserDefaultsAvailable]) language = [[NSUserDefaults standardUserDefaults] - objectForKey: @"PreferredLanguage"]; + objectForKey: @"PreferredLanguage"]; if (language == nil || [language isEqualToString: @""]) { // FIXME: This should be based on language preference order, and // tested for presence in bundle before adding localeid = [[cl objectForKey: NSLocaleIdentifier] - stringByAppendingPathExtension: @"lproj"]; + stringByAppendingPathExtension: @"lproj"]; language = [cl objectForKey: NSLocaleLanguageCode]; if ([language isEqualToString: @"de"]) longlang = @"German.lproj"; @@ -838,28 +843,33 @@ static NSMapTable *pathToObject = NULL; if (localeid) if (longlang) lookInDirectories = [NSArray - arrayWithObjects: - localeid, - [language stringByAppendingPathExtension: @"lproj"], - longlang, @"en.lproj", @"English.lproj", @"", nil]; + arrayWithObjects: + localeid, + [language stringByAppendingPathExtension: + @"lproj"], + longlang, @"en.lproj", @"English.lproj", + @"", nil]; else lookInDirectories = [NSArray - arrayWithObjects: - localeid, - [language stringByAppendingPathExtension: @"lproj"], - @"en.lproj", @"English.lproj", @"", nil]; + arrayWithObjects: + localeid, + [language stringByAppendingPathExtension: + @"lproj"], + @"en.lproj", @"English.lproj", @"", nil]; else if ([language isEqualToString: @"English"]) - lookInDirectories = [NSArray - arrayWithObjects: @"English.lproj", @"en.lproj", @"", nil]; + lookInDirectories = + [NSArray arrayWithObjects: @"English.lproj", + @"en.lproj", @"", nil]; else lookInDirectories = [NSArray - arrayWithObjects: - [language stringByAppendingPathExtension: @"lproj"], - @"en.lproj", @"English.lproj", @"", nil]; + arrayWithObjects: + [language stringByAppendingPathExtension: + @"lproj"], + @"en.lproj", @"English.lproj", @"", nil]; for (NSString *proj in lookInDirectories) { NSString *path = - [_resourcePath stringByAppendingPathComponent: proj]; + [_resourcePath stringByAppendingPathComponent: proj]; BOOL isDirectory = NO; if ([fm fileExistsAtPath: path isDirectory: &isDirectory] && isDirectory) { @@ -916,7 +926,7 @@ static NSMapTable *pathToObject = NULL; for (i = 0; i < count; i++) { NSString *path = [_resourcePath - stringByAppendingPathComponent: [lookIn objectAtIndex: i]]; + stringByAppendingPathComponent: [lookIn objectAtIndex: i]]; if (directory != nil) path = [path stringByAppendingPathComponent: directory]; @@ -991,15 +1001,15 @@ static NSMapTable *pathToObject = NULL; fullPath = [fullPath stringByAppendingPathComponent: path]; NSArray *allFiles = - [[NSFileManager defaultManager] directoryContentsAtPath: fullPath]; + [[NSFileManager defaultManager] directoryContentsAtPath: fullPath]; NSInteger i, count = [allFiles count]; for (i = 0; i < count; i++) { NSString *check = [allFiles objectAtIndex: i]; if ([type length] == 0 || [[check pathExtension] isEqualToString: type]) - [result - addObject: [fullPath stringByAppendingPathComponent: check]]; + [result addObject: [fullPath + stringByAppendingPathComponent: check]]; } return result; @@ -1061,9 +1071,10 @@ static NSMapTable *pathToObject = NULL; - (NSString *) description { return [NSString - stringWithFormat: @"<%@[0x%lx] path: %@ resourcePath: %@ isLoaded: %@>", - [self class], self, _path, _resourcePath, - (_isLoaded ? @"YES" : @"NO")]; + stringWithFormat: + @"<%@[0x%lx] path: %@ resourcePath: %@ isLoaded: %@>", + [self class], self, _path, _resourcePath, + (_isLoaded ? @"YES" : @"NO")]; } @end diff --git a/Foundation/NSCharacterSet/NSCharacterSet.m b/Foundation/NSCharacterSet/NSCharacterSet.m index 41b7322d..486ade6a 100644 --- a/Foundation/NSCharacterSet/NSCharacterSet.m +++ b/Foundation/NSCharacterSet/NSCharacterSet.m @@ -45,7 +45,7 @@ static NSMapTable *nameToSet = NULL; - mutableCopyWithZone: (NSZone *) zone { return [[NSMutableCharacterSet_bitmap allocWithZone: NULL] - initWithCharacterSet: self]; + initWithCharacterSet: self]; } - (Class) classForCoder { @@ -68,8 +68,8 @@ static NSMapTable *nameToSet = NULL; + characterSetWithCharactersInString: (NSString *) string { return NSAutorelease([[NSCharacterSet_string allocWithZone: NULL] - initWithString: string - inverted: NO]); + initWithString: string + inverted: NO]); } + characterSetWithContentsOfFile: (NSString *) path { @@ -83,7 +83,7 @@ static NSMapTable *nameToSet = NULL; + characterSetWithRange: (NSRange) range { return NSAutorelease( - [[NSCharacterSet_range allocWithZone: NULL] initWithRange: range]); + [[NSCharacterSet_range allocWithZone: NULL] initWithRange: range]); } static NSString *pathForCharacterSet(NSString *name) { @@ -92,8 +92,8 @@ static NSString *pathForCharacterSet(NSString *name) { if (path == nil) [NSException - raise: @"NSCharacterSetFailedException" - format: @"NSCharacterSet unable to find bitmap for %@", name]; + raise: @"NSCharacterSetFailedException" + format: @"NSCharacterSet unable to find bitmap for %@", name]; return path; } @@ -103,12 +103,12 @@ static NSCharacterSet *sharedSetWithName(Class cls, NSString *name) { if (cls != [NSCharacterSet class]) result = - [cls characterSetWithContentsOfFile: pathForCharacterSet(name)]; + [cls characterSetWithContentsOfFile: pathForCharacterSet(name)]; else { if ((result = NSMapGet(nameToSet, name)) == nil) { if ((result = [NSCharacterSet - characterSetWithContentsOfFile: pathForCharacterSet( - name)]) != nil) + characterSetWithContentsOfFile: pathForCharacterSet( + name)]) != nil) NSMapInsert(nameToSet, name, result); } } @@ -163,9 +163,9 @@ static NSCharacterSet *sharedSetWithName(Class cls, NSString *name) { self != [NSCharacterSet class]) { unichar chars[] = {0x0A, 0x0B, 0x0C, 0x0D, 0x85, 0x2028, 0x2029}; set = [self characterSetWithCharactersInString: - [NSString stringWithCharacters: chars - length: sizeof(chars) / - sizeof(unichar)]]; + [NSString stringWithCharacters: chars + length: sizeof(chars) / + sizeof(unichar)]]; if (self == [NSCharacterSet class]) NSMapInsert(nameToSet, setName, set); } @@ -181,9 +181,9 @@ static NSCharacterSet *sharedSetWithName(Class cls, NSString *name) { unichar chars[] = {0x20, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x85, 0xA0, 0x2028, 0x2029}; set = [self characterSetWithCharactersInString: - [NSString stringWithCharacters: chars - length: sizeof(chars) / - sizeof(unichar)]]; + [NSString stringWithCharacters: chars + length: sizeof(chars) / + sizeof(unichar)]]; if (self == [NSCharacterSet class]) NSMapInsert(nameToSet, setName, set); } @@ -197,10 +197,8 @@ static NSCharacterSet *sharedSetWithName(Class cls, NSString *name) { self != [NSCharacterSet class]) { // Doc.s do not mention 0xA0 but it is implemented as a member unichar chars[3] = {0x20, 0x09, 0xA0}; - set = [self - characterSetWithCharactersInString: [NSString - stringWithCharacters: chars - length: 3]]; + set = [self characterSetWithCharactersInString: + [NSString stringWithCharacters: chars length: 3]]; if (self == [NSCharacterSet class]) NSMapInsert(nameToSet, setName, set); } @@ -220,8 +218,8 @@ static NSCharacterSet *sharedSetWithName(Class cls, NSString *name) { bitmap[i] = ~bitmap[i]; return NSAutorelease(NSCharacterSet_bitmapNewWithBitmap( - NULL, [NSData dataWithBytesNoCopy: bitmap - length: NSBitmapCharacterSetSize])); + NULL, [NSData dataWithBytesNoCopy: bitmap + length: NSBitmapCharacterSetSize])); } - (NSData *) bitmapRepresentation { diff --git a/Foundation/NSCharacterSet/NSCharacterSet_bitmap.m b/Foundation/NSCharacterSet/NSCharacterSet_bitmap.m index e85cd776..91a35950 100644 --- a/Foundation/NSCharacterSet/NSCharacterSet_bitmap.m +++ b/Foundation/NSCharacterSet/NSCharacterSet_bitmap.m @@ -48,9 +48,9 @@ what it was exactly { uint8_t _stageOne[256]; uint8_t _stageTwo[8]; NSUInteger i; if ([data length] != NSBitmapCharacterSetSize) - [NSException - raise: @"NSCharacterSetFailedException" - format: @"NSCharacterSet bitmap short %d in init", [data length]]; + [NSException raise: @"NSCharacterSetFailedException" + format: @"NSCharacterSet bitmap short %d in init", + [data length]]; for (i = 0; i < NSBitmapCharacterSetSize; i++) _bitmap[i] = bytes[i]; diff --git a/Foundation/NSCharacterSet/NSCharacterSet_range.m b/Foundation/NSCharacterSet/NSCharacterSet_range.m index 68c44ae1..0c168f0b 100644 --- a/Foundation/NSCharacterSet/NSCharacterSet_range.m +++ b/Foundation/NSCharacterSet/NSCharacterSet_range.m @@ -35,8 +35,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSCharacterSet *) invertedSet { return [[[NSCharacterSet_rangeInverted allocWithZone: NULL] - initWithRange: NSMakeRange(_location, _locationPlusLength - _location)] - autorelease]; + initWithRange: NSMakeRange(_location, + _locationPlusLength - _location)] + autorelease]; } @end diff --git a/Foundation/NSCharacterSet/NSCharacterSet_rangeInverted.m b/Foundation/NSCharacterSet/NSCharacterSet_rangeInverted.m index 4c68eede..12227744 100644 --- a/Foundation/NSCharacterSet/NSCharacterSet_rangeInverted.m +++ b/Foundation/NSCharacterSet/NSCharacterSet_rangeInverted.m @@ -28,8 +28,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSCharacterSet *) invertedSet { return [[[NSCharacterSet_range allocWithZone: NULL] - initWithRange: NSMakeRange(_location, _locationPlusLength - _location)] - autorelease]; + initWithRange: NSMakeRange(_location, + _locationPlusLength - _location)] + autorelease]; } @end diff --git a/Foundation/NSCharacterSet/NSCharacterSet_string.m b/Foundation/NSCharacterSet/NSCharacterSet_string.m index ee6d2789..7ec257f8 100644 --- a/Foundation/NSCharacterSet/NSCharacterSet_string.m +++ b/Foundation/NSCharacterSet/NSCharacterSet_string.m @@ -62,7 +62,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return [[[NSCharacterSet_string alloc] initWithCharacters: _buffer length: _length inverted: !_inverted] - autorelease]; + autorelease]; } @end diff --git a/Foundation/NSCharacterSet/NSMutableCharacterSet.m b/Foundation/NSCharacterSet/NSMutableCharacterSet.m index 18ae26a8..9cf2598b 100644 --- a/Foundation/NSCharacterSet/NSMutableCharacterSet.m +++ b/Foundation/NSCharacterSet/NSMutableCharacterSet.m @@ -25,24 +25,24 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + allocWithZone: (NSZone *) zone { if (self == objc_lookUpClass("NSMutableCharacterSet")) return NSAllocateObject( - objc_lookUpClass("NSMutableCharacterSet_bitmap"), 0, zone); + objc_lookUpClass("NSMutableCharacterSet_bitmap"), 0, zone); return NSAllocateObject(self, 0, zone); } + characterSetWithBitmapRepresentation: (NSData *) data { - return - [[[NSMutableCharacterSet_bitmap alloc] initWithData: data] autorelease]; + return [[[NSMutableCharacterSet_bitmap alloc] initWithData: data] + autorelease]; } + characterSetWithCharactersInString: (NSString *) string { return [[[NSMutableCharacterSet_bitmap alloc] initWithString: string] - autorelease]; + autorelease]; } + characterSetWithRange: (NSRange) range { return [[[NSMutableCharacterSet_bitmap alloc] initWithRange: range] - autorelease]; + autorelease]; } - (void) addCharactersInString: (NSString *) string { diff --git a/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.m b/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.m index 5669b7e8..e5754a9c 100644 --- a/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.m +++ b/Foundation/NSCharacterSet/NSMutableCharacterSet_bitmap.m @@ -50,9 +50,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSUInteger i; if ([data length] != NSBitmapCharacterSetSize) - [NSException - raise: @"NSCharacterSetFailedException" - format: @"NSCharacterSet bitmap short %d in init", [data length]]; + [NSException raise: @"NSCharacterSetFailedException" + format: @"NSCharacterSet bitmap short %d in init", + [data length]]; for (i = 0; i < NSBitmapCharacterSetSize; i++) _bitmap[i] = bytes[i]; diff --git a/Foundation/NSCharacterSet/bitmapRepresentation.h b/Foundation/NSCharacterSet/bitmapRepresentation.h index 0f7d499d..19a3f9b3 100644 --- a/Foundation/NSCharacterSet/bitmapRepresentation.h +++ b/Foundation/NSCharacterSet/bitmapRepresentation.h @@ -47,13 +47,13 @@ static inline uint8_t *bitmapBytes(NSCharacterSet *self) { BOOL(*method) () = (void *) [self methodForSelector: @selector(characterIsMember:)]; uint8_t *bitmap = - NSZoneMalloc(NULL, sizeof(uint8_t) * NSBitmapCharacterSetSize); + NSZoneMalloc(NULL, sizeof(uint8_t) * NSBitmapCharacterSetSize); uint32_t code; for (code = 0; code <= 0xFFFF; code++) bitmapEnable( - bitmap, code, - method(self, @selector(characterIsMember:), (unichar) code)); + bitmap, code, + method(self, @selector(characterIsMember:), (unichar) code)); return bitmap; } diff --git a/Foundation/NSClassDescription.m b/Foundation/NSClassDescription.m index 07b50e26..3eac7868 100644 --- a/Foundation/NSClassDescription.m +++ b/Foundation/NSClassDescription.m @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSClassDescriptionNeededForClassNotification = - @"NSClassDescriptionNeededForClassNotification"; + @"NSClassDescriptionNeededForClassNotification"; @implementation NSClassDescription @@ -36,9 +36,9 @@ static NSMutableDictionary *classDescriptionCache = nil; result = [classDescriptionCache objectForKey: NSStringFromClass(class)]; if (!result) { [[NSNotificationCenter defaultCenter] - postNotificationName: - NSClassDescriptionNeededForClassNotification - object: class]; + postNotificationName: + NSClassDescriptionNeededForClassNotification + object: class]; } result = [classDescriptionCache objectForKey: NSStringFromClass(class)]; } diff --git a/Foundation/NSConcreteDirectoryEnumerator.m b/Foundation/NSConcreteDirectoryEnumerator.m index 9dfb85cd..4dcb688a 100644 --- a/Foundation/NSConcreteDirectoryEnumerator.m +++ b/Foundation/NSConcreteDirectoryEnumerator.m @@ -37,8 +37,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSString *) description { - return [NSString - stringWithFormat: @"%@, to enumerate: %@", [super description], list]; + return [NSString stringWithFormat: @"%@, to enumerate: %@", + [super description], list]; } - (id) initWithPath: (NSString *) aPath { @@ -72,20 +72,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Add all files in the directory to the list, // after making them relative to the lastFilePath: NSString *lastFilePathAbs = - [startPath stringByAppendingPathComponent: lastFilePath]; + [startPath stringByAppendingPathComponent: lastFilePath]; NSArray *dirContent = [fm directoryContentsAtPath: lastFilePathAbs]; if ([dirContent count]) { NSEnumerator *dirContentEnumerator = - [dirContent reverseObjectEnumerator]; + [dirContent reverseObjectEnumerator]; NSString *filename; // NSLog(@"Found dir content of '%@' to be %@", lastFilePathAbs, // dirContent); while ((filename = [dirContentEnumerator nextObject])) { - NSString *filePath = - [lastFilePath stringByAppendingPathComponent: filename]; + NSString *filePath = [lastFilePath + stringByAppendingPathComponent: filename]; [list insertObject: filePath atIndex: 0]; } } diff --git a/Foundation/NSConnection/NSConnection.h b/Foundation/NSConnection/NSConnection.h index 4528181d..68959d05 100644 --- a/Foundation/NSConnection/NSConnection.h +++ b/Foundation/NSConnection/NSConnection.h @@ -21,7 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSPortNameServer, NSPort, NSRunLoop, NSDistantObject, NSMutableArray, - NSMutableDictionary; + NSMutableDictionary; FOUNDATION_EXPORT NSString *const NSConnectionReplyMode; @@ -50,17 +50,18 @@ FOUNDATION_EXPORT NSString *const NSConnectionReplyMode; + (NSConnection *) connectionWithRegisteredName: (NSString *) name host: (NSString *) hostName usingNameServer: - (NSPortNameServer *) nameServer; + (NSPortNameServer *) nameServer; + (NSConnection *) connectionWithRegisteredName: (NSString *) name host: (NSString *) hostName; + (NSDistantObject *) - rootProxyForConnectionWithRegisteredName: (NSString *) name - host: (NSString *) hostName - usingNameServer: (NSPortNameServer *) nameServer; + rootProxyForConnectionWithRegisteredName: (NSString *) name + host: (NSString *) hostName + usingNameServer: + (NSPortNameServer *) nameServer; + (NSDistantObject *) - rootProxyForConnectionWithRegisteredName: (NSString *) name - host: (NSString *) hostName; + rootProxyForConnectionWithRegisteredName: (NSString *) name + host: (NSString *) hostName; + currentConversation; @@ -104,7 +105,7 @@ FOUNDATION_EXPORT NSString *const NSConnectionReplyMode; - (void) removeRunLoop: (NSRunLoop *) runLoop; - (BOOL) registerName: (NSString *) name - withNameServer: (NSPortNameServer *) nameServer; + withNameServer: (NSPortNameServer *) nameServer; - (BOOL) registerName: (NSString *) name; - (NSDictionary *) statistics; diff --git a/Foundation/NSConnection/NSConnection.m b/Foundation/NSConnection/NSConnection.m index e3525d9d..04daf8b4 100644 --- a/Foundation/NSConnection/NSConnection.m +++ b/Foundation/NSConnection/NSConnection.m @@ -68,17 +68,18 @@ NSString *const NSConnectionReplyMode = @"NSConnectionReplyMode"; + (NSConnection *) connectionWithRegisteredName: (NSString *) name host: (NSString *) hostName { - return - [self connectionWithRegisteredName: name - host: hostName - usingNameServer: [NSPortNameServer - systemDefaultPortNameServer]]; + return [self + connectionWithRegisteredName: name + host: hostName + usingNameServer: [NSPortNameServer + systemDefaultPortNameServer]]; } + (NSDistantObject *) - rootProxyForConnectionWithRegisteredName: (NSString *) name - host: (NSString *) hostName - usingNameServer: (NSPortNameServer *) nameServer + rootProxyForConnectionWithRegisteredName: (NSString *) name + host: (NSString *) hostName + usingNameServer: + (NSPortNameServer *) nameServer { return [[self connectionWithRegisteredName: name host: hostName @@ -86,8 +87,8 @@ NSString *const NSConnectionReplyMode = @"NSConnectionReplyMode"; } + (NSDistantObject *) - rootProxyForConnectionWithRegisteredName: (NSString *) name - host: (NSString *) hostName + rootProxyForConnectionWithRegisteredName: (NSString *) name + host: (NSString *) hostName { return [[self connectionWithRegisteredName: name host: hostName] rootProxy]; } @@ -204,7 +205,7 @@ NSString *const NSConnectionReplyMode = @"NSConnectionReplyMode"; } - (BOOL) registerName: (NSString *) name - withNameServer: (NSPortNameServer *) nameServer + withNameServer: (NSPortNameServer *) nameServer { NSUnimplementedMethod(); return NO; diff --git a/Foundation/NSConnection/NSPort.m b/Foundation/NSConnection/NSPort.m index 81e1d407..aa6d1918 100644 --- a/Foundation/NSConnection/NSPort.m +++ b/Foundation/NSConnection/NSPort.m @@ -21,7 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSPortDidBecomeInvalidNotification = - @"NSPortDidBecomeInvalidNotification"; + @"NSPortDidBecomeInvalidNotification"; @implementation NSPort diff --git a/Foundation/NSConnection/NSPortMessage.h b/Foundation/NSConnection/NSPortMessage.h index a03cb9d5..faa47491 100644 --- a/Foundation/NSConnection/NSPortMessage.h +++ b/Foundation/NSConnection/NSPortMessage.h @@ -28,8 +28,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithSendPort: (NSPort *) sendPort - receivePort: (NSPort *) receivePort - components: (NSArray *) components; + receivePort: (NSPort *) receivePort + components: (NSArray *) components; - (uint32_t) msgid; - (NSArray *) components; diff --git a/Foundation/NSConnection/NSPortMessage.m b/Foundation/NSConnection/NSPortMessage.m index 3a195338..06ecda28 100644 --- a/Foundation/NSConnection/NSPortMessage.m +++ b/Foundation/NSConnection/NSPortMessage.m @@ -24,8 +24,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSPortMessage - initWithSendPort: (NSPort *) sendPort - receivePort: (NSPort *) receivePort - components: (NSArray *) components + receivePort: (NSPort *) receivePort + components: (NSArray *) components { _sendPort = [sendPort retain]; _receivePort = [receivePort retain]; diff --git a/Foundation/NSData/NSData.m b/Foundation/NSData/NSData.m index d8b2efac..71c592ce 100644 --- a/Foundation/NSData/NSData.m +++ b/Foundation/NSData/NSData.m @@ -103,9 +103,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (errorp != NULL) { NSDictionary *userInfo = [NSDictionary - dictionaryWithObject: - [NSString stringWithFormat: @"Could not open file %@", path] - forKey: NSLocalizedDescriptionKey]; + dictionaryWithObject: + [NSString + stringWithFormat: @"Could not open file %@", + path] + forKey: NSLocalizedDescriptionKey]; *errorp = [NSError errorWithDomain: NSURLErrorDomain code: NSURLErrorCannotOpenFile @@ -132,9 +134,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSURLResponse *response = nil; NSData *data = [NSURLConnection - sendSynchronousRequest: [NSURLRequest requestWithURL: url] - returningResponse: &response - error: &error]; + sendSynchronousRequest: [NSURLRequest requestWithURL: url] + returningResponse: &response + error: &error]; if (data == nil) { if (errorp != NULL) { *errorp = error; @@ -148,10 +150,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (errorp != NULL) { NSDictionary *userInfo = [NSDictionary - dictionaryWithObject: - [NSString - stringWithFormat: @"Could not open url %@", url] - forKey: NSLocalizedDescriptionKey]; + dictionaryWithObject: + [NSString stringWithFormat: + @"Could not open url %@", url] + forKey: NSLocalizedDescriptionKey]; *errorp = [NSError errorWithDomain: NSURLErrorDomain code: NSURLErrorBadURL @@ -211,13 +213,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return [[[self allocWithZone: NULL] initWithBytesNoCopy: bytes length: length freeWhenDone: freeWhenDone] - autorelease]; + autorelease]; } + dataWithBytesNoCopy: (void *) bytes length: (NSUInteger) length { - return - [[[self allocWithZone: NULL] initWithBytesNoCopy: bytes - length: length] autorelease]; + return [[[self allocWithZone: NULL] initWithBytesNoCopy: bytes + length: length] + autorelease]; } + dataWithBytes: (const void *) bytes length: (NSUInteger) length { @@ -226,24 +228,24 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + dataWithData: (NSData *) data { - return - [[[self allocWithZone: NULL] initWithBytes: [data bytes] - length: [data length]] autorelease]; + return [[[self allocWithZone: NULL] initWithBytes: [data bytes] + length: [data length]] + autorelease]; } + dataWithContentsOfFile: (NSString *) path { - return - [[[self allocWithZone: NULL] initWithContentsOfFile: path] autorelease]; + return [[[self allocWithZone: NULL] initWithContentsOfFile: path] + autorelease]; } + dataWithContentsOfMappedFile: (NSString *) path { return [[[self allocWithZone: NULL] initWithContentsOfMappedFile: path] - autorelease]; + autorelease]; } + dataWithContentsOfURL: (NSURL *) url { - return - [[[self allocWithZone: NULL] initWithContentsOfURL: url] autorelease]; + return [[[self allocWithZone: NULL] initWithContentsOfURL: url] + autorelease]; } + dataWithContentsOfFile: (NSString *) path @@ -385,7 +387,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSUInteger pos = 0, i; char *cString; NSString *string = NSAutorelease(NSString_cStringNewWithCapacity( - NULL, 1 + length * 2 + (length / 4) + 1, &cString)); + NULL, 1 + length * 2 + (length / 4) + 1, &cString)); cString[pos++] = '<'; for (i = 0; i < length;) { diff --git a/Foundation/NSData/NSData_concrete.m b/Foundation/NSData/NSData_concrete.m index 3a72480e..15dbd752 100644 --- a/Foundation/NSData/NSData_concrete.m +++ b/Foundation/NSData/NSData_concrete.m @@ -87,7 +87,7 @@ NSData *NSData_concreteNewNoCopy(NSZone *zone, void *bytes, NSUInteger length) { - initWithContentsOfMappedFile: (NSString *) path { [self dealloc]; return (NSData_concrete *) [[NSData_mapped alloc] - initWithContentsOfMappedFile: path]; + initWithContentsOfMappedFile: path]; } - (void) dealloc { diff --git a/Foundation/NSData/NSMutableData.m b/Foundation/NSData/NSMutableData.m index 2b0ce425..f531b7b7 100644 --- a/Foundation/NSData/NSMutableData.m +++ b/Foundation/NSData/NSMutableData.m @@ -66,8 +66,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + dataWithCapacity: (NSUInteger) capacity { - return - [[[self allocWithZone: NULL] initWithCapacity: capacity] autorelease]; + return [[[self allocWithZone: NULL] initWithCapacity: capacity] + autorelease]; } + dataWithLength: (NSUInteger) length { diff --git a/Foundation/NSDate/NSCalendar.m b/Foundation/NSDate/NSCalendar.m index d73beb5b..779c8231 100644 --- a/Foundation/NSDate/NSCalendar.m +++ b/Foundation/NSDate/NSCalendar.m @@ -39,7 +39,7 @@ NSString *const NSGregorianCalendar = @"NSGregorianCalendar"; + currentCalendar { return [[[self alloc] initWithCalendarIdentifier: NSGregorianCalendar] - autorelease]; + autorelease]; } - initWithCalendarIdentifier: (NSString *) identifier { @@ -126,8 +126,8 @@ NSString *const NSGregorianCalendar = @"NSGregorianCalendar"; NSDateComponents *result = [[[NSDateComponents alloc] init] autorelease]; NSTimeInterval interval = [date timeIntervalSinceReferenceDate]; - interval = - NSMoveIntervalFromTimeZoneToGMT(interval, [NSTimeZone localTimeZone]); + interval = NSMoveIntervalFromTimeZoneToGMT(interval, + [NSTimeZone localTimeZone]); if (flags & NSEraCalendarUnit) NSUnimplementedMethod(); @@ -200,10 +200,10 @@ NSString *const NSGregorianCalendar = @"NSGregorianCalendar"; second = check; NSTimeInterval interval = NSTimeIntervalWithComponents( - year, month, day, hour, minute, second, milliseconds); + year, month, day, hour, minute, second, milliseconds); - interval = - NSMoveIntervalFromGMTToTimeZone(interval, [NSTimeZone localTimeZone]); + interval = NSMoveIntervalFromGMTToTimeZone(interval, + [NSTimeZone localTimeZone]); return [NSDate dateWithTimeIntervalSinceReferenceDate: interval]; } diff --git a/Foundation/NSDate/NSCalendarDate.h b/Foundation/NSDate/NSCalendarDate.h index 93670edb..2f6a59e8 100644 --- a/Foundation/NSDate/NSCalendarDate.h +++ b/Foundation/NSDate/NSCalendarDate.h @@ -28,30 +28,30 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + calendarDate; - initWithYear: (NSInteger) year - month: (NSUInteger) month - day: (NSUInteger) day - hour: (NSUInteger) hour - minute: (NSUInteger) minute - second: (NSUInteger) second - timeZone: (NSTimeZone *) timeZone; + month: (NSUInteger) month + day: (NSUInteger) day + hour: (NSUInteger) hour + minute: (NSUInteger) minute + second: (NSUInteger) second + timeZone: (NSTimeZone *) timeZone; - initWithString: (NSString *) string - calendarFormat: (NSString *) format - locale: (NSDictionary *) locale; + calendarFormat: (NSString *) format + locale: (NSDictionary *) locale; - initWithString: (NSString *) string calendarFormat: (NSString *) format; - initWithString: (NSString *) string; + dateWithYear: (NSInteger) year - month: (NSUInteger) month - day: (NSUInteger) day - hour: (NSUInteger) hour - minute: (NSUInteger) minute - second: (NSUInteger) second - timeZone: (NSTimeZone *) timeZone; + month: (NSUInteger) month + day: (NSUInteger) day + hour: (NSUInteger) hour + minute: (NSUInteger) minute + second: (NSUInteger) second + timeZone: (NSTimeZone *) timeZone; + dateWithString: (NSString *) string - calendarFormat: (NSString *) format - locale: (NSDictionary *) locale; + calendarFormat: (NSString *) format + locale: (NSDictionary *) locale; + dateWithString: (NSString *) string calendarFormat: (NSString *) format; @@ -72,12 +72,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSInteger) dayOfCommonEra; - (void) years: (NSInteger *) yearsp - months: (NSInteger *) monthsp - days: (NSInteger *) daysp - hours: (NSInteger *) hoursp - minutes: (NSInteger *) minutesp - seconds: (NSInteger *) secondsp - sinceDate: (NSCalendarDate *) date; + months: (NSInteger *) monthsp + days: (NSInteger *) daysp + hours: (NSInteger *) hoursp + minutes: (NSInteger *) minutesp + seconds: (NSInteger *) secondsp + sinceDate: (NSCalendarDate *) date; - (NSCalendarDate *) dateByAddingYears: (NSInteger) years months: (NSInteger) months diff --git a/Foundation/NSDate/NSCalendarDate.m b/Foundation/NSDate/NSCalendarDate.m index 7f2b71a8..902405e9 100644 --- a/Foundation/NSDate/NSCalendarDate.m +++ b/Foundation/NSDate/NSCalendarDate.m @@ -50,21 +50,21 @@ static NSString *const defaultCalendarDate = @"%Y-%m-%d %H:%M:%S %z"; } - initWithYear: (NSInteger) year - month: (NSUInteger) month - day: (NSUInteger) day - hour: (NSUInteger) hour - minute: (NSUInteger) minute - second: (NSUInteger) second - timeZone: (NSTimeZone *) aTimeZone; + month: (NSUInteger) month + day: (NSUInteger) day + hour: (NSUInteger) hour + minute: (NSUInteger) minute + second: (NSUInteger) second + timeZone: (NSTimeZone *) aTimeZone; { - NSTimeInterval interval = - NSTimeIntervalWithComponents(year, month, day, hour, minute, second, 0); + NSTimeInterval interval = NSTimeIntervalWithComponents( + year, month, day, hour, minute, second, 0); NSTimeZone *tz = - (aTimeZone == nil ? [NSTimeZone localTimeZone] : aTimeZone); - interval = - interval - - [tz secondsFromGMTForDate: - [NSDate dateWithTimeIntervalSinceReferenceDate: interval]]; + (aTimeZone == nil ? [NSTimeZone localTimeZone] : aTimeZone); + interval = interval - + [tz secondsFromGMTForDate: + [NSDate dateWithTimeIntervalSinceReferenceDate: + interval]]; [self initWithTimeIntervalSinceReferenceDate: interval]; [_timeZone release]; @@ -74,8 +74,8 @@ static NSString *const defaultCalendarDate = @"%Y-%m-%d %H:%M:%S %z"; } - initWithString: (NSString *) string - calendarFormat: (NSString *) format - locale: (NSDictionary *) locale + calendarFormat: (NSString *) format + locale: (NSDictionary *) locale { NSMutableString *mu = [[string mutableCopy] autorelease]; @@ -84,9 +84,9 @@ static NSString *const defaultCalendarDate = @"%Y-%m-%d %H:%M:%S %z"; withString: @" "]; NSDateFormatter *dateFormatter = [[[NSDateFormatter allocWithZone: NULL] - initWithDateFormat: format - allowNaturalLanguage: YES - locale: locale] autorelease]; + initWithDateFormat: format + allowNaturalLanguage: YES + locale: locale] autorelease]; NSString *error; [self autorelease]; @@ -116,12 +116,12 @@ static NSString *const defaultCalendarDate = @"%Y-%m-%d %H:%M:%S %z"; } + dateWithYear: (NSInteger) year - month: (NSUInteger) month - day: (NSUInteger) day - hour: (NSUInteger) hour - minute: (NSUInteger) minute - second: (NSUInteger) second - timeZone: (NSTimeZone *) timeZone + month: (NSUInteger) month + day: (NSUInteger) day + hour: (NSUInteger) hour + minute: (NSUInteger) minute + second: (NSUInteger) second + timeZone: (NSTimeZone *) timeZone { return [[[self allocWithZone: NULL] initWithYear: year month: month @@ -134,8 +134,8 @@ static NSString *const defaultCalendarDate = @"%Y-%m-%d %H:%M:%S %z"; } + dateWithString: (NSString *) string - calendarFormat: (NSString *) format - locale: (NSDictionary *) locale + calendarFormat: (NSString *) format + locale: (NSDictionary *) locale { return [[[self allocWithZone: NULL] initWithString: string calendarFormat: format @@ -244,12 +244,12 @@ static NSString *const defaultCalendarDate = @"%Y-%m-%d %H:%M:%S %z"; } - (void) years: (NSInteger *) yearsp - months: (NSInteger *) monthsp - days: (NSInteger *) daysp - hours: (NSInteger *) hoursp - minutes: (NSInteger *) minutesp - seconds: (NSInteger *) secondsp - sinceDate: (NSCalendarDate *) since + months: (NSInteger *) monthsp + days: (NSInteger *) daysp + hours: (NSInteger *) hoursp + minutes: (NSInteger *) minutesp + seconds: (NSInteger *) secondsp + sinceDate: (NSCalendarDate *) since { NSTimeInterval delta; BOOL inverted = NO; @@ -273,33 +273,34 @@ static NSString *const defaultCalendarDate = @"%Y-%m-%d %H:%M:%S %z"; carry = 0; } - carry = - (NSMonthFromTimeInterval(delta) - 1) * (inverted ? -1 : 1) + carry * 12; + carry = (NSMonthFromTimeInterval(delta) - 1) * (inverted ? -1 : 1) + + carry * 12; if (monthsp != NULL) { *monthsp = carry; } if (inverted) { carry = (NSDayOfCommonEraFromTimeInterval([[since - dateByAddingYears: yearsp != NULL ? *yearsp : 0 - months: monthsp != NULL ? *monthsp : 0 - days: 0 - hours: 0 - minutes: 0 - seconds: 0] timeIntervalSinceReferenceDate]) - + dateByAddingYears: yearsp != NULL ? *yearsp : 0 + months: monthsp != NULL ? *monthsp : 0 + days: 0 + hours: 0 + minutes: 0 + seconds: 0] + timeIntervalSinceReferenceDate]) - NSDayOfCommonEraFromTimeInterval( - [self timeIntervalSinceReferenceDate]) - + [self timeIntervalSinceReferenceDate]) - 1) * -1; } else { carry = NSDayOfCommonEraFromTimeInterval([[self - dateByAddingYears: yearsp != NULL ? *yearsp * -1 : 0 - months: monthsp != NULL ? *monthsp * -1 : 0 - days: 0 - hours: 0 - minutes: 0 - seconds: 0] timeIntervalSinceReferenceDate]) - + dateByAddingYears: yearsp != NULL ? *yearsp * -1 : 0 + months: monthsp != NULL ? *monthsp * -1 : 0 + days: 0 + hours: 0 + minutes: 0 + seconds: 0] timeIntervalSinceReferenceDate]) - NSDayOfCommonEraFromTimeInterval( - [since timeIntervalSinceReferenceDate]) - + [since timeIntervalSinceReferenceDate]) - 1; } @@ -417,9 +418,9 @@ static NSString *const defaultCalendarDate = @"%Y-%m-%d %H:%M:%S %z"; year += yearDelta; NSCalendarDate *resultDate = [NSCalendarDate - dateWithTimeIntervalSinceReferenceDate: NSTimeIntervalWithComponents( - year, month, day, hour, - minute, second, 0)]; + dateWithTimeIntervalSinceReferenceDate: + NSTimeIntervalWithComponents(year, month, day, hour, minute, + second, 0)]; [resultDate setTimeZone: _timeZone]; diff --git a/Foundation/NSDate/NSDate.m b/Foundation/NSDate/NSDate.m index d42e9b9d..116dce55 100644 --- a/Foundation/NSDate/NSDate.m +++ b/Foundation/NSDate/NSDate.m @@ -45,8 +45,8 @@ const NSTimeInterval NSTimeIntervalSince1970 = (NSTimeInterval) 978307200.0; static NSDate *staticInstance = nil; if (!staticInstance) staticInstance = [[self allocWithZone: NULL] - initWithTimeIntervalSinceReferenceDate: -(2010.0L * 365.0 * 24.0 * - 60.0 * 60.0)]; + initWithTimeIntervalSinceReferenceDate: -(2010.0L * 365.0 * + 24.0 * 60.0 * 60.0)]; return staticInstance; } @@ -54,14 +54,14 @@ const NSTimeInterval NSTimeIntervalSince1970 = (NSTimeInterval) 978307200.0; static NSDate *staticInstance = nil; if (!staticInstance) staticInstance = [[self allocWithZone: NULL] - initWithTimeIntervalSinceReferenceDate: 2010.0L * 365.0 * 24.0 * - 60.0 * 60.0]; + initWithTimeIntervalSinceReferenceDate: 2010.0L * 365.0 * 24.0 * + 60.0 * 60.0]; return staticInstance; } - init { return [self initWithTimeIntervalSinceReferenceDate: - NSPlatformTimeIntervalSinceReferenceDate()]; + NSPlatformTimeIntervalSinceReferenceDate()]; } - initWithString: (NSString *) string { @@ -76,44 +76,44 @@ const NSTimeInterval NSTimeIntervalSince1970 = (NSTimeInterval) 978307200.0; - initWithTimeIntervalSinceNow: (NSTimeInterval) seconds { return [self initWithTimeIntervalSinceReferenceDate: - NSPlatformTimeIntervalSinceReferenceDate() + seconds]; + NSPlatformTimeIntervalSinceReferenceDate() + seconds]; } - initWithTimeIntervalSince1970: (NSTimeInterval) seconds { - return - [self initWithTimeIntervalSinceReferenceDate: -NSTimeIntervalSince1970 + - seconds]; + return [self + initWithTimeIntervalSinceReferenceDate: -NSTimeIntervalSince1970 + + seconds]; } - initWithTimeInterval: (NSTimeInterval) seconds sinceDate: (NSDate *) other { return [self initWithTimeIntervalSinceReferenceDate: - [other timeIntervalSinceReferenceDate] + seconds]; + [other timeIntervalSinceReferenceDate] + seconds]; } + date { return [[[self allocWithZone: NULL] - initWithTimeIntervalSinceReferenceDate: - NSPlatformTimeIntervalSinceReferenceDate()] autorelease]; + initWithTimeIntervalSinceReferenceDate: + NSPlatformTimeIntervalSinceReferenceDate()] autorelease]; } + dateWithString: (NSString *) string { return [[[NSCalendarDate allocWithZone: NULL] initWithString: string] - autorelease]; + autorelease]; } + dateWithTimeIntervalSinceReferenceDate: (NSTimeInterval) seconds { return [[[self allocWithZone: NULL] - initWithTimeIntervalSinceReferenceDate: seconds] autorelease]; + initWithTimeIntervalSinceReferenceDate: seconds] autorelease]; } + dateWithTimeIntervalSinceNow: (NSTimeInterval) seconds { return [[[self allocWithZone: NULL] initWithTimeIntervalSinceNow: seconds] - autorelease]; + autorelease]; } + dateWithTimeIntervalSince1970: (NSTimeInterval) seconds { return [[[self allocWithZone: NULL] initWithTimeIntervalSince1970: seconds] - autorelease]; + autorelease]; } - copyWithZone: (NSZone *) zone { @@ -205,21 +205,23 @@ const NSTimeInterval NSTimeIntervalSince1970 = (NSTimeInterval) 978307200.0; } - addTimeInterval: (NSTimeInterval) seconds { - return [[self class] dateWithTimeIntervalSinceReferenceDate: - [self timeIntervalSinceReferenceDate] + seconds]; + return [[self class] + dateWithTimeIntervalSinceReferenceDate: + [self timeIntervalSinceReferenceDate] + seconds]; } - dateByAddingTimeInterval: (NSTimeInterval) seconds { - return [[self class] dateWithTimeIntervalSinceReferenceDate: - [self timeIntervalSinceReferenceDate] + seconds]; + return [[self class] + dateWithTimeIntervalSinceReferenceDate: + [self timeIntervalSinceReferenceDate] + seconds]; } - (NSCalendarDate *) dateWithCalendarFormat: (NSString *) format timeZone: (NSTimeZone *) timeZone { NSCalendarDate *date = - [NSCalendarDate dateWithTimeIntervalSinceReferenceDate: - [self timeIntervalSinceReferenceDate]]; + [NSCalendarDate dateWithTimeIntervalSinceReferenceDate: + [self timeIntervalSinceReferenceDate]]; if (format == nil) format = DEFAULT_CALENDAR_FORMAT; diff --git a/Foundation/NSDate/NSDateFormatter.h b/Foundation/NSDate/NSDateFormatter.h index 3ebe4968..5cc1bf2a 100644 --- a/Foundation/NSDate/NSDateFormatter.h +++ b/Foundation/NSDate/NSDateFormatter.h @@ -47,13 +47,13 @@ typedef enum { } - initWithDateFormat: (NSString *) format - allowNaturalLanguage: (BOOL) flag; // shouldn't this be "allows" ? + allowNaturalLanguage: (BOOL) flag; // shouldn't this be "allows" ? // added because NSDateFormatter is the backend for // initWithString:calendarFormat:locale shouldn't this really exist anyway? - initWithDateFormat: (NSString *) format - allowNaturalLanguage: (BOOL) flag - locale: (NSDictionary *) locale; + allowNaturalLanguage: (BOOL) flag + locale: (NSDictionary *) locale; - (NSString *) dateFormat; - (BOOL) allowsNaturalLanguage; diff --git a/Foundation/NSDate/NSDateFormatter.m b/Foundation/NSDate/NSDateFormatter.m index 5892250b..fa06f281 100644 --- a/Foundation/NSDate/NSDateFormatter.m +++ b/Foundation/NSDate/NSDateFormatter.m @@ -37,12 +37,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return [self initWithDateFormat: format allowNaturalLanguage: flag locale: [[NSUserDefaults standardUserDefaults] - dictionaryRepresentation]]; + dictionaryRepresentation]]; } - initWithDateFormat: (NSString *) format - allowNaturalLanguage: (BOOL) flag - locale: (NSDictionary *) locale + allowNaturalLanguage: (BOOL) flag + locale: (NSDictionary *) locale { [super init]; _behavior = NSDateFormatterBehavior10_0; @@ -135,11 +135,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSArray *) shortStandaloneWeekdaySymbols { return [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] - objectForKey: NSShortWeekDayNameArray]; + objectForKey: NSShortWeekDayNameArray]; } - (NSArray *) standaloneWeekdaySymbols { return [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] - objectForKey: NSWeekDayNameArray]; + objectForKey: NSWeekDayNameArray]; } - (void) setLenient: (BOOL) value { @@ -153,23 +153,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([object isKindOfClass: [NSDate class]]) return NSStringWithDateFormatLocale( - [object timeIntervalSinceReferenceDate], _dateFormat10_0, _locale, - _tz); + [object timeIntervalSinceReferenceDate], _dateFormat10_0, + _locale, _tz); if ([object isKindOfClass: [NSCalendarDate class]]) return NSStringWithDateFormatLocale( - [object timeIntervalSinceReferenceDate], _dateFormat10_0, _locale, - [object timeZone]); + [object timeIntervalSinceReferenceDate], _dateFormat10_0, + _locale, [object timeZone]); return nil; } - (NSAttributedString *) attributedStringForObjectValue: (id) object withDefaultAttributes: - (NSDictionary *) attributes + (NSDictionary *) attributes { return [[[NSAttributedString allocWithZone: NULL] - initWithString: [self stringForObjectValue: object] - attributes: attributes] autorelease]; + initWithString: [self stringForObjectValue: object] + attributes: attributes] autorelease]; } - (NSString *) editingStringForObjectValue: (id) object { @@ -177,16 +177,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) getObjectValue: (id *) object - forString: (NSString *) string - errorDescription: (NSString **) error + forString: (NSString *) string + errorDescription: (NSString **) error { - *object = - NSDateWithStringDateFormatLocale(string, _dateFormat10_0, _locale, _tz); + *object = NSDateWithStringDateFormatLocale(string, _dateFormat10_0, _locale, + _tz); if (*object == nil) { // FIX localization if (error != NULL) - *error = - @"Couldn't convert string to a valid NSCalendarDate object."; + *error = @"Couldn't convert string to a valid NSCalendarDate " + @"object."; return NO; } @@ -236,18 +236,18 @@ NSTimeInterval NSMoveIntervalFromTimeZoneToGMT(NSTimeInterval interval, NSTimeZone *timeZone) { return interval + - [timeZone - secondsFromGMTForDate: - [NSDate dateWithTimeIntervalSinceReferenceDate: interval]]; + [timeZone secondsFromGMTForDate: + [NSDate dateWithTimeIntervalSinceReferenceDate: + interval]]; } NSTimeInterval NSMoveIntervalFromGMTToTimeZone(NSTimeInterval interval, NSTimeZone *timeZone) { return interval - - [timeZone - secondsFromGMTForDate: - [NSDate dateWithTimeIntervalSinceReferenceDate: interval]]; + [timeZone secondsFromGMTForDate: + [NSDate dateWithTimeIntervalSinceReferenceDate: + interval]]; } #define NSDaysOfCommonEraOfReferenceDate 730486 @@ -301,11 +301,11 @@ NSTimeInterval NSTimeIntervalWithComponents(NSInteger year, NSInteger month, NSTimeInterval interval; daysOfCommonEra = - numberOfDaysInCommonEraOfDayMonthAndYear(day, month, year); + numberOfDaysInCommonEraOfDayMonthAndYear(day, month, year); daysOfCommonEra -= NSDaysOfCommonEraOfReferenceDate; - interval = - (daysOfCommonEra * 86400.0) + (hour * 3600) + (minute * 60) + second; + interval = (daysOfCommonEra * 86400.0) + (hour * 3600) + (minute * 60) + + second; if (milliseconds) { interval += milliseconds / 1000.0 + 0.0001; @@ -346,8 +346,9 @@ NSInteger NSMonthFromTimeInterval(NSTimeInterval interval) { // 1-12 NSInteger days = NSDayOfCommonEraFromTimeInterval(interval); NSInteger month = 1; - while (days > numberOfDaysInCommonEraOfDayMonthAndYear( - NSNumberOfDaysInMonthOfYear(month, year), month, year)) + while (days > + numberOfDaysInCommonEraOfDayMonthAndYear( + NSNumberOfDaysInMonthOfYear(month, year), month, year)) month++; return month; @@ -359,7 +360,7 @@ NSInteger NSDayOfMonthFromTimeInterval(NSTimeInterval interval) { // 1-31 NSInteger month = NSMonthFromTimeInterval(interval); dayOfCommonEra -= - numberOfDaysInCommonEraOfDayMonthAndYear(1, month, year) - 1; + numberOfDaysInCommonEraOfDayMonthAndYear(1, month, year) - 1; return dayOfCommonEra; } @@ -404,9 +405,9 @@ NSInteger NSAMPMFromTimeInterval(NSTimeInterval interval) { // 0-1 NSInteger NSMinuteFromTimeInterval(NSTimeInterval interval) { // 0-59 NSTimeInterval startOfHour = NSTimeIntervalWithComponents( - NSYearFromTimeInterval(interval), NSMonthFromTimeInterval(interval), - NSDayOfMonthFromTimeInterval(interval), - NS24HourFromTimeInterval(interval), 0, 0, 0); + NSYearFromTimeInterval(interval), NSMonthFromTimeInterval(interval), + NSDayOfMonthFromTimeInterval(interval), + NS24HourFromTimeInterval(interval), 0, 0, 0); return (NSInteger)(interval - startOfHour) / 60; } @@ -446,8 +447,8 @@ NSString *NSStringWithDateFormatLocale(NSTimeInterval interval, interval = NSMoveIntervalFromTimeZoneToGMT(interval, timeZone); if (locale == nil) - locale = - [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]; + locale = [[NSUserDefaults standardUserDefaults] + dictionaryRepresentation]; [format getCharacters: fmtBuffer]; @@ -515,34 +516,34 @@ NSString *NSStringWithDateFormatLocale(NSTimeInterval interval, break; case 'c': - [result - appendFormat: @"%@", - NSStringWithDateFormatLocale( - interval, - [locale - objectForKey: NSTimeDateFormatString], - locale, timeZone)]; + [result appendFormat: + @"%@", + NSStringWithDateFormatLocale( + interval, + [locale objectForKey: + NSTimeDateFormatString], + locale, timeZone)]; break; case 'd': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%2d" : @"%02d"); + ? @"%d" + : ((fillChar == ' ') ? @"%2d" : @"%02d"); - [result - appendFormat: fmt, NSDayOfMonthFromTimeInterval(interval)]; + [result appendFormat: fmt, + NSDayOfMonthFromTimeInterval(interval)]; } break; case 'e': { id fmt = @"%d"; - [result - appendFormat: fmt, NSDayOfMonthFromTimeInterval(interval)]; + [result appendFormat: fmt, + NSDayOfMonthFromTimeInterval(interval)]; } break; case 'F': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%3d" : @"%03d"); + ? @"%d" + : ((fillChar == ' ') ? @"%3d" : @"%03d"); [result appendFormat: fmt, NSMillisecondsFromTimeInterval(interval)]; @@ -550,41 +551,41 @@ NSString *NSStringWithDateFormatLocale(NSTimeInterval interval, case 'H': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%2d" : @"%02d"); + ? @"%d" + : ((fillChar == ' ') ? @"%2d" : @"%02d"); [result appendFormat: fmt, NS24HourFromTimeInterval(interval)]; } break; case 'I': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%2d" : @"%02d"); + ? @"%d" + : ((fillChar == ' ') ? @"%2d" : @"%02d"); [result appendFormat: fmt, NS12HourFromTimeInterval(interval)]; } break; case 'j': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%3d" : @"%03d"); + ? @"%d" + : ((fillChar == ' ') ? @"%3d" : @"%03d"); - [result - appendFormat: fmt, NSDayOfYearFromTimeInterval(interval)]; + [result appendFormat: fmt, + NSDayOfYearFromTimeInterval(interval)]; } break; case 'm': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%2d" : @"%02d"); + ? @"%d" + : ((fillChar == ' ') ? @"%2d" : @"%02d"); [result appendFormat: fmt, NSMonthFromTimeInterval(interval)]; } break; case 'M': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%2d" : @"%02d"); + ? @"%d" + : ((fillChar == ' ') ? @"%2d" : @"%02d"); [result appendFormat: fmt, NSMinuteFromTimeInterval(interval)]; } break; @@ -597,51 +598,53 @@ NSString *NSStringWithDateFormatLocale(NSTimeInterval interval, case 'S': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%2d" : @"%02d"); + ? @"%d" + : ((fillChar == ' ') ? @"%2d" : @"%02d"); [result appendFormat: fmt, NSSecondFromTimeInterval(interval)]; } break; case 'w': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%1d" : @"%01d"); + ? @"%d" + : ((fillChar == ' ') ? @"%1d" : @"%01d"); [result appendFormat: fmt, NSWeekdayFromTimeInterval(interval)]; } break; case 'x': - [result - appendFormat: @"%@", - NSStringWithDateFormatLocale( - interval, - [locale objectForKey: NSDateFormatString], - locale, timeZone)]; + [result appendFormat: + @"%@", + NSStringWithDateFormatLocale( + interval, + [locale objectForKey: + NSDateFormatString], + locale, timeZone)]; break; case 'X': - [result - appendFormat: @"%@", - NSStringWithDateFormatLocale( - interval, - [locale objectForKey: NSTimeFormatString], - locale, timeZone)]; + [result appendFormat: + @"%@", + NSStringWithDateFormatLocale( + interval, + [locale objectForKey: + NSTimeFormatString], + locale, timeZone)]; break; case 'y': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%2d" : @"%02d"); + ? @"%d" + : ((fillChar == ' ') ? @"%2d" : @"%02d"); - [result - appendFormat: fmt, NSYearFromTimeInterval(interval) % 100]; + [result appendFormat: fmt, + NSYearFromTimeInterval(interval) % 100]; } break; case 'Y': { id fmt = (suppressZero) - ? @"%d" - : ((fillChar == ' ') ? @"%4d" : @"%04d"); + ? @"%d" + : ((fillChar == ' ') ? @"%4d" : @"%04d"); [result appendFormat: fmt, NSYearFromTimeInterval(interval)]; } break; @@ -652,18 +655,20 @@ NSString *NSStringWithDateFormatLocale(NSTimeInterval interval, case 'z': { NSInteger secondsFromGMT = [timeZone - secondsFromGMTForDate: - [NSDate - dateWithTimeIntervalSinceReferenceDate: interval]]; - [result - appendString: [[[NSString allocWithZone: NULL] - initWithFormat: @"%@%02d%02d", - (secondsFromGMT >= 0 - ? @"+" - : @""), - secondsFromGMT / 3600, - (secondsFromGMT % 3600) / - 60] autorelease]]; + secondsFromGMTForDate: + [NSDate dateWithTimeIntervalSinceReferenceDate: + interval]]; + [result appendString: [[[NSString allocWithZone: NULL] + initWithFormat: @"%@%02d%02d", + (secondsFromGMT >= + 0 + ? @"+" + : @""), + secondsFromGMT / + 3600, + (secondsFromGMT % + 3600) / 60] + autorelease]]; } break; } state = STATE_SCANNING; @@ -679,7 +684,7 @@ NSString *NSReadStringInString(NSString *aString, NSCharacterSet *characterSet, NSUInteger *endPosition) { NSMutableString *resultString = - [NSMutableString stringWithCapacity: maxLength]; + [NSMutableString stringWithCapacity: maxLength]; for (NSUInteger i = 0; i < maxLength; i++) { if (position + i >= [aString length]) { @@ -755,8 +760,8 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, } if (locale == nil) { - locale = - [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]; + locale = [[NSUserDefaults standardUserDefaults] + dictionaryRepresentation]; } monthNames = [locale objectForKey: NSMonthNameArray]; @@ -824,8 +829,8 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, int month = 1; temp = NSReadStringInString( - string, [NSCharacterSet letterCharacterSet], - currentPosition, 255, ¤tPosition); + string, [NSCharacterSet letterCharacterSet], + currentPosition, 255, ¤tPosition); while ((shortMonthName = [enumerator nextObject]) != nil) { if ([shortMonthName caseInsensitiveCompare: temp] == @@ -852,8 +857,8 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, int month = 1; temp = NSReadStringInString( - string, [NSCharacterSet letterCharacterSet], - currentPosition, 255, ¤tPosition); + string, [NSCharacterSet letterCharacterSet], + currentPosition, 255, ¤tPosition); while ((monthName = [enumerator nextObject]) != nil) { if ([monthName caseInsensitiveCompare: temp] == @@ -874,31 +879,31 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, case 'c': return NSDateWithStringDateFormatLocale( - string, [locale objectForKey: NSTimeDateFormatString], - locale, timeZone); + string, [locale objectForKey: NSTimeDateFormatString], + locale, timeZone); case 'd': days = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 2, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 2, ¤tPosition); break; case 'F': milliseconds = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 3, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 3, ¤tPosition); break; case 'H': hours = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 2, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 2, ¤tPosition); break; case 'I': hours = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 2, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 2, ¤tPosition); AMPMMultiplier = 1; break; @@ -906,8 +911,8 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, // grr case 'j': { NSInteger numberOfDays = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 3, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 3, ¤tPosition); adjustment += numberOfDays * 86400.0; break; @@ -915,23 +920,23 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, case 'm': months = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 2, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 2, ¤tPosition); break; case 'M': minutes = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 2, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 2, ¤tPosition); break; case 'p': { NSString *temp; temp = NSReadStringInString( - string, [NSCharacterSet letterCharacterSet], - currentPosition, 255, ¤tPosition); + string, [NSCharacterSet letterCharacterSet], + currentPosition, 255, ¤tPosition); AMPMMultiplier = [AMPMDesignations indexOfObject: temp]; if (AMPMMultiplier == NSNotFound) { @@ -943,8 +948,8 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, case 'S': seconds = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 2, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 2, ¤tPosition); break; // again, weekdays are useless @@ -957,18 +962,18 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, case 'x': return NSDateWithStringDateFormatLocale( - string, [locale objectForKey: NSDateFormatString], locale, - timeZone); + string, [locale objectForKey: NSDateFormatString], + locale, timeZone); case 'X': return NSDateWithStringDateFormatLocale( - string, [locale objectForKey: NSTimeFormatString], locale, - timeZone); + string, [locale objectForKey: NSTimeFormatString], + locale, timeZone); case 'y': years = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 2, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 2, ¤tPosition); // FIX QUESTIONABLE // 1900 or 2000??, YB does 2000, for some? all? @@ -977,8 +982,8 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, case 'Y': years = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 4, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 4, ¤tPosition); /*if (![scanner scanInteger:&years]) return nil;*/ break; @@ -987,8 +992,8 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, NSString *temp; temp = NSReadStringInString( - string, [NSCharacterSet letterCharacterSet], - currentPosition, 255, ¤tPosition); + string, [NSCharacterSet letterCharacterSet], + currentPosition, 255, ¤tPosition); timeZone = [NSTimeZone timeZoneWithName: temp]; break; @@ -997,14 +1002,14 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, case 'z': { NSInteger hoursMinutes, tzHours, tzMinutes; hoursMinutes = NSReadIntegerInString( - string, [NSCharacterSet decimalDigitCharacterSet], - currentPosition, 4, ¤tPosition); + string, [NSCharacterSet decimalDigitCharacterSet], + currentPosition, 4, ¤tPosition); tzHours = hoursMinutes / 100; tzMinutes = hoursMinutes % 100; - timeZone = - [NSTimeZone timeZoneForSecondsFromGMT: (tzHours * 3600) + - (tzMinutes * 60)]; + timeZone = [NSTimeZone + timeZoneForSecondsFromGMT: (tzHours * 3600) + + (tzMinutes * 60)]; break; } } @@ -1053,12 +1058,12 @@ NSDate *NSDateWithStringDateFormatLocale(NSString *string, NSString *format, timeInterval += adjustment; timeInterval = - timeInterval - - [timeZone - secondsFromGMTForDate: - [NSDate dateWithTimeIntervalSinceReferenceDate: timeInterval]]; + timeInterval - + [timeZone secondsFromGMTForDate: + [NSDate dateWithTimeIntervalSinceReferenceDate: + timeInterval]]; date = [[[NSDate allocWithZone: NULL] - initWithTimeIntervalSinceReferenceDate: timeInterval] autorelease]; + initWithTimeIntervalSinceReferenceDate: timeInterval] autorelease]; return date; } diff --git a/Foundation/NSDecimal/NSDecimalNumber.h b/Foundation/NSDecimal/NSDecimalNumber.h index 1f8195c1..dc0de236 100644 --- a/Foundation/NSDecimal/NSDecimalNumber.h +++ b/Foundation/NSDecimal/NSDecimalNumber.h @@ -61,36 +61,36 @@ FOUNDATION_EXPORT NSString *const NSDecimalNumberExactnessException; - (const char *) objCType; - (NSDecimalNumber *) decimalNumberByRoundingAccordingToBehavior: - (id) behavior; + (id) behavior; - (NSDecimalNumber *) decimalNumberByAdding: (NSDecimalNumber *) other; - (NSDecimalNumber *) decimalNumberByAdding: (NSDecimalNumber *) other withBehavior: - (id) behavior; + (id) behavior; - (NSDecimalNumber *) decimalNumberBySubtracting: (NSDecimalNumber *) other; - (NSDecimalNumber *) decimalNumberBySubtracting: (NSDecimalNumber *) other - withBehavior: - (id) behavior; + withBehavior: (id) + behavior; - (NSDecimalNumber *) decimalNumberByMultiplyingBy: (NSDecimalNumber *) other; - (NSDecimalNumber *) - decimalNumberByMultiplyingBy: (NSDecimalNumber *) other - withBehavior: (id) behavior; + decimalNumberByMultiplyingBy: (NSDecimalNumber *) other + withBehavior: (id) behavior; - (NSDecimalNumber *) decimalNumberByDividingBy: (NSDecimalNumber *) other; - (NSDecimalNumber *) decimalNumberByDividingBy: (NSDecimalNumber *) other - withBehavior: - (id) behavior; + withBehavior: (id) + behavior; - (NSDecimalNumber *) decimalNumberByMultiplyingByPowerOf10: (int16_t) power; - (NSDecimalNumber *) - decimalNumberByMultiplyingByPowerOf10: (int16_t) power - withBehavior: - (id) behavior; + decimalNumberByMultiplyingByPowerOf10: (int16_t) power + withBehavior: (id) + behavior; - (NSDecimalNumber *) decimalNumberByRaisingToPower: (NSUInteger) power; - (NSDecimalNumber *) - decimalNumberByRaisingToPower: (NSUInteger) power - withBehavior: (id) behavior; + decimalNumberByRaisingToPower: (NSUInteger) power + withBehavior: (id) behavior; - (NSString *) descriptionWithLocale: (NSDictionary *) locale; diff --git a/Foundation/NSDecimal/NSDecimalNumber.m b/Foundation/NSDecimal/NSDecimalNumber.m index 96e4ba90..bfdcaa71 100644 --- a/Foundation/NSDecimal/NSDecimalNumber.m +++ b/Foundation/NSDecimal/NSDecimalNumber.m @@ -22,13 +22,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSDecimalNumberDivideByZeroException = - @"NSDecimalNumberDivideByZeroException"; + @"NSDecimalNumberDivideByZeroException"; NSString *const NSDecimalNumberUnderflowException = - @"NSDecimalNumberUnderflowException"; + @"NSDecimalNumberUnderflowException"; NSString *const NSDecimalNumberOverflowException = - @"NSDecimalNumberOverflowException"; + @"NSDecimalNumberOverflowException"; NSString *const NSDecimalNumberExactnessException = - @"NSDecimalNumberExactnessException"; + @"NSDecimalNumberExactnessException"; @implementation NSDecimalNumber @@ -129,7 +129,7 @@ NSString *const NSDecimalNumberExactnessException = } - (NSDecimalNumber *) decimalNumberByRoundingAccordingToBehavior: - (id) behavior + (id) behavior { NSUnimplementedMethod(); return nil; @@ -142,7 +142,7 @@ NSString *const NSDecimalNumberExactnessException = - (NSDecimalNumber *) decimalNumberByAdding: (NSDecimalNumber *) other withBehavior: - (id) behavior + (id) behavior { NSUnimplementedMethod(); return nil; @@ -154,8 +154,8 @@ NSString *const NSDecimalNumberExactnessException = } - (NSDecimalNumber *) decimalNumberBySubtracting: (NSDecimalNumber *) other - withBehavior: - (id) behavior + withBehavior: (id) + behavior { NSUnimplementedMethod(); return nil; @@ -167,8 +167,8 @@ NSString *const NSDecimalNumberExactnessException = } - (NSDecimalNumber *) - decimalNumberByMultiplyingBy: (NSDecimalNumber *) other - withBehavior: (id) behavior + decimalNumberByMultiplyingBy: (NSDecimalNumber *) other + withBehavior: (id) behavior { NSUnimplementedMethod(); return nil; @@ -180,8 +180,8 @@ NSString *const NSDecimalNumberExactnessException = } - (NSDecimalNumber *) decimalNumberByDividingBy: (NSDecimalNumber *) other - withBehavior: - (id) behavior + withBehavior: (id) + behavior { NSUnimplementedMethod(); return nil; @@ -193,9 +193,9 @@ NSString *const NSDecimalNumberExactnessException = } - (NSDecimalNumber *) - decimalNumberByMultiplyingByPowerOf10: (int16_t) power - withBehavior: - (id) behavior + decimalNumberByMultiplyingByPowerOf10: (int16_t) power + withBehavior: + (id) behavior { NSUnimplementedMethod(); return nil; @@ -207,8 +207,8 @@ NSString *const NSDecimalNumberExactnessException = } - (NSDecimalNumber *) - decimalNumberByRaisingToPower: (NSUInteger) power - withBehavior: (id) behavior + decimalNumberByRaisingToPower: (NSUInteger) power + withBehavior: (id) behavior { NSUnimplementedMethod(); return nil; diff --git a/Foundation/NSDecimal/NSDecimalNumberPlaceholder.m b/Foundation/NSDecimal/NSDecimalNumberPlaceholder.m index 7453f7b8..518d0eae 100644 --- a/Foundation/NSDecimal/NSDecimalNumberPlaceholder.m +++ b/Foundation/NSDecimal/NSDecimalNumberPlaceholder.m @@ -22,7 +22,7 @@ // NSUnimplementedMethod(); [self dealloc]; return (NSDecimalNumberPlaceholder *) [[NSNumber alloc] - initWithInteger: 0]; // NSNumber is implemented + initWithInteger: 0]; // NSNumber is implemented } @end diff --git a/Foundation/NSDictionary/NSDictionary.m b/Foundation/NSDictionary/NSDictionary.m index f54b3b1d..30d926b4 100644 --- a/Foundation/NSDictionary/NSDictionary.m +++ b/Foundation/NSDictionary/NSDictionary.m @@ -127,7 +127,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithContentsOfFile: (NSString *) path { NSDictionary *contents = - [NSPropertyListReader dictionaryWithContentsOfFile: path]; + [NSPropertyListReader dictionaryWithContentsOfFile: path]; if (contents == nil) { [self dealloc]; @@ -205,10 +205,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ va_end(arguments); - return - [[[self allocWithZone: NULL] initWithObjects: objects - forKeys: keys - count: count / 2] autorelease]; + return [[[self allocWithZone: NULL] initWithObjects: objects + forKeys: keys + count: count / 2] + autorelease]; } + dictionaryWithObject: object forKey: key { @@ -218,13 +218,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + dictionaryWithContentsOfFile: (NSString *) path { - return - [[[self allocWithZone: NULL] initWithContentsOfFile: path] autorelease]; + return [[[self allocWithZone: NULL] initWithContentsOfFile: path] + autorelease]; } + dictionaryWithContentsOfURL: (NSURL *) url { - return - [[[self allocWithZone: NULL] initWithContentsOfURL: url] autorelease]; + return [[[self allocWithZone: NULL] initWithContentsOfURL: url] + autorelease]; } - copy { @@ -310,7 +310,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSEnumerator *) objectEnumerator { return [[[NSEnumerator_dictionaryObjects allocWithZone: NULL] - initWithDictionary: self] autorelease]; + initWithDictionary: self] autorelease]; } - (void) getObjects: (id *) objects andKeys: (id *) keys { diff --git a/Foundation/NSDictionary/NSEnumerator_dictionaryKeys.m b/Foundation/NSDictionary/NSEnumerator_dictionaryKeys.m index 20e90f65..1a10500d 100644 --- a/Foundation/NSDictionary/NSEnumerator_dictionaryKeys.m +++ b/Foundation/NSDictionary/NSEnumerator_dictionaryKeys.m @@ -35,7 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSEnumerator *NSEnumerator_dictionaryKeysNew(NSMapTable *table) { NSEnumerator_dictionaryKeys *self = - NSAllocateObject([NSEnumerator_dictionaryKeys class], 0, NULL); + NSAllocateObject([NSEnumerator_dictionaryKeys class], 0, NULL); if (self) { self->state = NSEnumerateMapTable(table); } diff --git a/Foundation/NSDictionary/NSMutableDictionary.m b/Foundation/NSDictionary/NSMutableDictionary.m index 1be27a61..d44c0cc0 100644 --- a/Foundation/NSDictionary/NSMutableDictionary.m +++ b/Foundation/NSDictionary/NSMutableDictionary.m @@ -59,8 +59,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + dictionaryWithCapacity: (NSUInteger) capacity { - return - [[[self allocWithZone: NULL] initWithCapacity: capacity] autorelease]; + return [[[self allocWithZone: NULL] initWithCapacity: capacity] + autorelease]; } - (void) setObject: object forKey: aKey { diff --git a/Foundation/NSDictionary/NSMutableDictionary_mapTable.h b/Foundation/NSDictionary/NSMutableDictionary_mapTable.h index 5c84ac43..6a21e4a8 100644 --- a/Foundation/NSDictionary/NSMutableDictionary_mapTable.h +++ b/Foundation/NSDictionary/NSMutableDictionary_mapTable.h @@ -29,10 +29,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithKeys: (const void **) keys - values: (const void **) values - count: (NSUInteger) count - keyCallBacks: (const CFDictionaryKeyCallBacks *) keyCallBacks - valueCallBacks: (const CFDictionaryValueCallBacks *) valueCallBacks; + values: (const void **) values + count: (NSUInteger) count + keyCallBacks: (const CFDictionaryKeyCallBacks *) keyCallBacks + valueCallBacks: (const CFDictionaryValueCallBacks *) valueCallBacks; - (NSUInteger) count; - objectForKey: key; diff --git a/Foundation/NSDictionary/NSMutableDictionary_mapTable.m b/Foundation/NSDictionary/NSMutableDictionary_mapTable.m index 6a558b6d..e83f3503 100644 --- a/Foundation/NSDictionary/NSMutableDictionary_mapTable.m +++ b/Foundation/NSDictionary/NSMutableDictionary_mapTable.m @@ -100,16 +100,17 @@ static void objectReleaseCallBack(CFAllocatorRef allocator, const void *value) { } static CFDictionaryKeyCallBacks objectKeyCallBacks = { - 0, - objectCopyCallBack, - objectReleaseCallBack, - CFCopyDescription, - CFEqual, - CFHash, + 0, + objectCopyCallBack, + objectReleaseCallBack, + CFCopyDescription, + CFEqual, + CFHash, }; static CFDictionaryValueCallBacks objectValueCallbacks = { - 0, objectRetainCallBack, objectReleaseCallBack, CFCopyDescription, CFEqual}; + 0, objectRetainCallBack, objectReleaseCallBack, CFCopyDescription, + CFEqual}; const void *defaultRetainCallBack(CFAllocatorRef allocator, const void *value) { return value; @@ -160,7 +161,7 @@ static CFDictionaryEnumerator keyEnumeratorState(NSMutableDictionary_CF *self) { - (NSEnumerator *) keyEnumerator { return [[[NSEnumerator_CFDictionaryKeys allocWithZone: NULL] - initWithState: keyEnumeratorState(self)] autorelease]; + initWithState: keyEnumeratorState(self)] autorelease]; } static void NSDictInsert(NSMutableDictionary_CF *self, const void *key, @@ -194,12 +195,12 @@ static void NSDictInsert(NSMutableDictionary_CF *self, const void *key, self->_nBuckets = nBuckets * 2; self->_buckets = - NSZoneCalloc(zone, self->_nBuckets, sizeof(NSDictNode *)); + NSZoneCalloc(zone, self->_nBuckets, sizeof(NSDictNode *)); for (i = 0; i < nBuckets; i++) for (j = buckets[i]; j != NULL; j = next) { NSUInteger newi = - self->_keyCallBacks.hash(j->key) % self->_nBuckets; + self->_keyCallBacks.hash(j->key) % self->_nBuckets; next = j->next; j->next = self->_buckets[newi]; @@ -276,35 +277,35 @@ static void NSDictRemove(NSMutableDictionary_CF *self, const void *key) { } - initWithKeys: (const void **) keys - values: (const void **) values - count: (NSUInteger) count - keyCallBacks: (const CFDictionaryKeyCallBacks *) keyCallBacks - valueCallBacks: (const CFDictionaryValueCallBacks *) valueCallBacks + values: (const void **) values + count: (NSUInteger) count + keyCallBacks: (const CFDictionaryKeyCallBacks *) keyCallBacks + valueCallBacks: (const CFDictionaryValueCallBacks *) valueCallBacks { - _keyCallBacks.hash = - (keyCallBacks->hash != NULL) ? keyCallBacks->hash : defaultHashCallBack; + _keyCallBacks.hash = (keyCallBacks->hash != NULL) ? keyCallBacks->hash + : defaultHashCallBack; _keyCallBacks.equal = (keyCallBacks->equal != NULL) ? keyCallBacks->equal : defaultEqualCallBack; _keyCallBacks.retain = (keyCallBacks->retain != NULL) - ? keyCallBacks->retain - : defaultRetainCallBack; + ? keyCallBacks->retain + : defaultRetainCallBack; _keyCallBacks.release = (keyCallBacks->release != NULL) - ? keyCallBacks->release - : defaultReleaseCallBack; + ? keyCallBacks->release + : defaultReleaseCallBack; _keyCallBacks.copyDescription = (keyCallBacks->copyDescription != NULL) - ? keyCallBacks->copyDescription - : defaultCopyDescription; + ? keyCallBacks->copyDescription + : defaultCopyDescription; _valueCallBacks.retain = (valueCallBacks->retain != NULL) - ? valueCallBacks->retain - : defaultRetainCallBack; + ? valueCallBacks->retain + : defaultRetainCallBack; _valueCallBacks.release = (valueCallBacks->release != NULL) - ? valueCallBacks->release - : defaultReleaseCallBack; + ? valueCallBacks->release + : defaultReleaseCallBack; _valueCallBacks.copyDescription = (valueCallBacks->copyDescription != NULL) - ? valueCallBacks->copyDescription - : defaultCopyDescription; + ? valueCallBacks->copyDescription + : defaultCopyDescription; _count = 0; _nBuckets = 4; diff --git a/Foundation/NSDistributedNotificationCenter.h b/Foundation/NSDistributedNotificationCenter.h index 001d2f96..c5940dcb 100644 --- a/Foundation/NSDistributedNotificationCenter.h +++ b/Foundation/NSDistributedNotificationCenter.h @@ -29,7 +29,7 @@ FOUNDATION_EXPORT NSString *const NSLocalNotificationCenterType; + (NSDistributedNotificationCenter *) defaultCenter; + (NSDistributedNotificationCenter *) notificationCenterForType: - (NSString *) type; + (NSString *) type; - (BOOL) suspended; @@ -40,10 +40,10 @@ FOUNDATION_EXPORT NSString *const NSLocalNotificationCenterType; name: (NSString *) name object: (NSString *) object; - (void) addObserver: observer - selector: (SEL) selector - name: (NSString *) name - object: (NSString *) object - suspensionBehavior: (NSNotificationSuspensionBehavior) behavior; + selector: (SEL) selector + name: (NSString *) name + object: (NSString *) object + suspensionBehavior: (NSNotificationSuspensionBehavior) behavior; - (void) removeObserver: observer name: (NSString *) name diff --git a/Foundation/NSDistributedNotificationCenter.m b/Foundation/NSDistributedNotificationCenter.m index efdb873b..ce2f9a78 100644 --- a/Foundation/NSDistributedNotificationCenter.m +++ b/Foundation/NSDistributedNotificationCenter.m @@ -20,7 +20,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSLocalNotificationCenterType = - @"NSLocalNotificationCenterType"; + @"NSLocalNotificationCenterType"; @implementation NSDistributedNotificationCenter @@ -29,7 +29,7 @@ NSString *const NSLocalNotificationCenterType = } + (NSDistributedNotificationCenter *) notificationCenterForType: - (NSString *) type + (NSString *) type { NSUnimplementedMethod(); return nil; @@ -53,10 +53,10 @@ NSString *const NSLocalNotificationCenterType = } - (void) addObserver: observer - selector: (SEL) selector - name: (NSString *) name - object: (NSString *) object - suspensionBehavior: (NSNotificationSuspensionBehavior) behavior + selector: (SEL) selector + name: (NSString *) name + object: (NSString *) object + suspensionBehavior: (NSNotificationSuspensionBehavior) behavior { NSUnimplementedMethod(); } diff --git a/Foundation/NSError.m b/Foundation/NSError.m index 9ec2151c..00493a06 100644 --- a/Foundation/NSError.m +++ b/Foundation/NSError.m @@ -31,11 +31,11 @@ NSString *const NSCocoaErrorDomain = @"NSCocoaErrorDomain"; NSString *const NSUnderlyingErrorKey = @"NSUnderlyingErrorKey"; NSString *const NSLocalizedDescriptionKey = @"NSLocalizedDescriptionKey"; NSString *const NSLocalizedFailureReasonErrorKey = - @"NSLocalizedFailureReasonErrorKey"; + @"NSLocalizedFailureReasonErrorKey"; NSString *const NSLocalizedRecoveryOptionsErrorKey = - @"NSLocalizedRecoveryOptionsErrorKey"; + @"NSLocalizedRecoveryOptionsErrorKey"; NSString *const NSLocalizedRecoverySuggestionErrorKey = - @"NSLocalizedRecoverySuggestionErrorKey"; + @"NSLocalizedRecoverySuggestionErrorKey"; NSString *const NSRecoveryAttempterErrorKey = @"NSRecoveryAttempterErrorKey"; @implementation NSError @@ -99,18 +99,20 @@ NSString *const NSRecoveryAttempterErrorKey = @"NSRecoveryAttempterErrorKey"; localizedDescription = [self localizedFailureReason]; if (localizedDescription) { return [NSString - stringWithFormat: @"%@ %@", - NSLocalizedString( - @"The operation could not be completed.", - @"Default NSError description"), - localizedDescription]; + stringWithFormat: + @"%@ %@", + NSLocalizedString( + @"The operation could not be completed.", + @"Default NSError description"), + localizedDescription]; } else { return [NSString - stringWithFormat: @"%@ (%@ error %d)", - NSLocalizedString( - @"The operation could not be completed.", - @"Default NSError description"), - _domain, _code]; + stringWithFormat: + @"%@ (%@ error %d)", + NSLocalizedString( + @"The operation could not be completed.", + @"Default NSError description"), + _domain, _code]; } } @@ -132,8 +134,9 @@ NSString *const NSRecoveryAttempterErrorKey = @"NSRecoveryAttempterErrorKey"; - (id) description { return [NSString - stringWithFormat: @"Error Domain=%@ Code=%d UserInfo=%p %@", _domain, - _code, _userInfo, [self localizedDescription]]; + stringWithFormat: @"Error Domain=%@ Code=%d UserInfo=%p %@", + _domain, _code, _userInfo, + [self localizedDescription]]; } @end diff --git a/Foundation/NSException/NSException.h b/Foundation/NSException/NSException.h index 0e40d0ef..3e20d775 100644 --- a/Foundation/NSException/NSException.h +++ b/Foundation/NSException/NSException.h @@ -41,12 +41,12 @@ FOUNDATION_EXPORT NSString *const NSInconsistentArchiveException; + (void) raise: (NSString *) name format: (NSString *) format, ...; + (void) raise: (NSString *) name - format: (NSString *) format - arguments: (va_list) arguments; + format: (NSString *) format + arguments: (va_list) arguments; - initWithName: (NSString *) name - reason: (NSString *) reason - userInfo: (NSDictionary *) userInfo; + reason: (NSString *) reason + userInfo: (NSDictionary *) userInfo; + (NSException *) exceptionWithName: (NSString *) name reason: (NSString *) reason diff --git a/Foundation/NSException/NSException.m b/Foundation/NSException/NSException.m index 82a0463f..96469e10 100644 --- a/Foundation/NSException/NSException.m +++ b/Foundation/NSException/NSException.m @@ -34,12 +34,12 @@ NSString *const NSInvalidArgumentException = @"NSInvalidArgumentException"; NSString *const NSRangeException = @"NSRangeException"; NSString *const NSInternalInconsistencyException = - @"NSInternalInconsistencyException"; + @"NSInternalInconsistencyException"; NSString *const NSMallocException = @"NSMallocException"; NSString *const NSParseErrorException = @"NSParseErrorException"; NSString *const NSInconsistentArchiveException = - @"NSInconsistentArchiveException"; + @"NSInconsistentArchiveException"; @implementation NSException @@ -52,8 +52,8 @@ NSString *const NSInconsistentArchiveException = } + (void) raise: (NSString *) name - format: (NSString *) format - arguments: (va_list) arguments + format: (NSString *) format + arguments: (va_list) arguments { [[self exceptionWithName: name reason: NSStringWithFormatArguments(format, arguments) @@ -61,8 +61,8 @@ NSString *const NSInconsistentArchiveException = } - initWithName: (NSString *) name - reason: (NSString *) reason - userInfo: (NSDictionary *) userInfo + reason: (NSString *) reason + userInfo: (NSDictionary *) userInfo { _name = [name copy]; _reason = [reason copy]; diff --git a/Foundation/NSException/NSRaise.h b/Foundation/NSException/NSRaise.h index 905b87c6..a8b83042 100644 --- a/Foundation/NSException/NSRaise.h +++ b/Foundation/NSException/NSRaise.h @@ -25,12 +25,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static inline void _NSInvalidAbstractInvocation(SEL selector, id object, const char *file, int line) { - [NSException - raise: NSInvalidArgumentException - format: - @"-%s only defined for abstract class. Define -[%@ %s] in %s:%d!", - sel_getName(selector), [object class], sel_getName(selector), file, - line]; + [NSException raise: NSInvalidArgumentException + format: @"-%s only defined for abstract class. Define -[%@ %s] " + @"in %s:%d!", + sel_getName(selector), [object class], + sel_getName(selector), file, line]; } static inline void _NSUnimplementedMethod(SEL selector, id object, diff --git a/Foundation/NSException/NSRaise.m b/Foundation/NSException/NSRaise.m index 2184f18a..076deddd 100644 --- a/Foundation/NSException/NSRaise.m +++ b/Foundation/NSException/NSRaise.m @@ -27,7 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // DO NOT USE IN NEW CODE AND REPLACE USAGE. Use NSAssert(). void NSRaiseException(NSString *name, id self, SEL cmd, NSString *fmt, ...) { NSString *where = [NSString - stringWithFormat: @"-[%@ %s]", [self class], sel_getName(cmd)]; + stringWithFormat: @"-[%@ %s]", [self class], sel_getName(cmd)]; NSString *why; va_list args; diff --git a/Foundation/NSException/debugHelpers.m b/Foundation/NSException/debugHelpers.m index 6b3659f3..4cef1340 100644 --- a/Foundation/NSException/debugHelpers.m +++ b/Foundation/NSException/debugHelpers.m @@ -106,8 +106,8 @@ id _NSStackTrace() { goto restore; } - int frame = - 2; // Skip _objc_returnAddress and _NSStackTrace - they are always there + int frame = 2; // Skip _objc_returnAddress and _NSStackTrace - they are + // always there void *addr = _objc_returnAddress(frame); while (addr) { @@ -126,7 +126,7 @@ restore: return ret; #else - return - [NSArray arrayWithObject: @"Stack trace unavailable in Release builds"]; + return [NSArray + arrayWithObject: @"Stack trace unavailable in Release builds"]; #endif } diff --git a/Foundation/NSFileManager.h b/Foundation/NSFileManager.h index f3242478..a9635c7c 100644 --- a/Foundation/NSFileManager.h +++ b/Foundation/NSFileManager.h @@ -124,14 +124,14 @@ FOUNDATION_EXPORT NSString *const NSFileSystemFreeSize; - (BOOL) createDirectoryAtPath: (NSString *) path attributes: (NSDictionary *) attributes; - (BOOL) createDirectoryAtPath: (NSString *) path - withIntermediateDirectories: (BOOL) intermediates - attributes: (NSDictionary *) attributes - error: (NSError **) error; + withIntermediateDirectories: (BOOL) intermediates + attributes: (NSDictionary *) attributes + error: (NSError **) error; - (BOOL) createDirectoryAtURL: (NSURL *) url - withIntermediateDirectories: (BOOL) intermediates - attributes: (NSDictionary *) attributes - error: (NSError **) error; + withIntermediateDirectories: (BOOL) intermediates + attributes: (NSDictionary *) attributes + error: (NSError **) error; - (BOOL) createSymbolicLinkAtPath: (NSString *) path pathContent: (NSString *) destination; @@ -168,39 +168,39 @@ FOUNDATION_EXPORT NSString *const NSFileSystemFreeSize; @interface NSObject (NSFileManager_handler) - (BOOL) fileManager: (NSFileManager *) fileManager - shouldProceedAfterError: (NSDictionary *) dictionary; + shouldProceedAfterError: (NSDictionary *) dictionary; - (void) fileManager: (NSFileManager *) fileManager - willProcessPath: (NSString *) path; + willProcessPath: (NSString *) path; @end @interface NSObject (NSFileManagerDelegate) - (BOOL) fileManager: (NSFileManager *) fileManager - shouldCopyItemAtPath: (NSString *) path - toPath: (NSString *) toPath; + shouldCopyItemAtPath: (NSString *) path + toPath: (NSString *) toPath; - (BOOL) fileManager: (NSFileManager *) fileManager - shouldLinkItemAtPath: (NSString *) path - toPath: (NSString *) toPath; + shouldLinkItemAtPath: (NSString *) path + toPath: (NSString *) toPath; - (BOOL) fileManager: (NSFileManager *) fileManager - shouldMoveItemAtPath: (NSString *) path - toPath: (NSString *) toPath; + shouldMoveItemAtPath: (NSString *) path + toPath: (NSString *) toPath; - (BOOL) fileManager: (NSFileManager *) fileManager - shouldProceedAfterError: (NSError *) error - copyingItemAtPath: (NSString *) path - toPath: (NSString *) toPath; + shouldProceedAfterError: (NSError *) error + copyingItemAtPath: (NSString *) path + toPath: (NSString *) toPath; - (BOOL) fileManager: (NSFileManager *) fileManager - shouldProceedAfterError: (NSError *) error - linkingItemAtPath: (NSString *) path - toPath: (NSString *) toPath; + shouldProceedAfterError: (NSError *) error + linkingItemAtPath: (NSString *) path + toPath: (NSString *) toPath; - (BOOL) fileManager: (NSFileManager *) fileManager - shouldProceedAfterError: (NSError *) error - movingItemAtPath: (NSString *) path - toPath: (NSString *) toPath; + shouldProceedAfterError: (NSError *) error + movingItemAtPath: (NSString *) path + toPath: (NSString *) toPath; - (BOOL) fileManager: (NSFileManager *) fileManager - shouldProceedAfterError: (NSError *) error - removingItemAtPath: (NSString *) path; + shouldProceedAfterError: (NSError *) error + removingItemAtPath: (NSString *) path; - (BOOL) fileManager: (NSFileManager *) fileManager - shouldRemoveItemAtPath: (NSString *) path; + shouldRemoveItemAtPath: (NSString *) path; @end diff --git a/Foundation/NSFileManager.m b/Foundation/NSFileManager.m index 0ace1c34..e083d113 100644 --- a/Foundation/NSFileManager.m +++ b/Foundation/NSFileManager.m @@ -215,18 +215,18 @@ NSString *const NSFileSystemFreeSize = @"NSFileSystemFreeSize"; int x; for (x = 0; x < [files count]; x++) { [paths addObject: [basePath stringByAppendingPathComponent: - [files objectAtIndex: x]]]; + [files objectAtIndex: x]]]; } for (x = 0; x < [files count]; x++) { BOOL isDir = NO; NSString *newPath = - [path stringByAppendingPathComponent: [files objectAtIndex: x]]; + [path stringByAppendingPathComponent: [files objectAtIndex: x]]; [self fileExistsAtPath: newPath isDirectory: &isDir]; if (isDir) [self _subpathsAtPath: newPath basePath: [basePath stringByAppendingPathComponent: - [files objectAtIndex: x]] + [files objectAtIndex: x]] paths: paths]; } } @@ -264,7 +264,7 @@ NSString *const NSFileSystemFreeSize = @"NSFileSystemFreeSize"; - (NSDirectoryEnumerator *) enumeratorAtPath: (NSString *) path { return [[[NSConcreteDirectoryEnumerator alloc] initWithPath: path] - autorelease]; + autorelease]; } - (BOOL) createDirectoryAtPath: (NSString *) path @@ -275,9 +275,9 @@ NSString *const NSFileSystemFreeSize = @"NSFileSystemFreeSize"; } - (BOOL) createDirectoryAtPath: (NSString *) path - withIntermediateDirectories: (BOOL) intermediates - attributes: (NSDictionary *) attributes - error: (NSError **) error + withIntermediateDirectories: (BOOL) intermediates + attributes: (NSDictionary *) attributes + error: (NSError **) error { BOOL result = YES; BOOL isDirectory = NO; @@ -286,8 +286,10 @@ NSString *const NSFileSystemFreeSize = @"NSFileSystemFreeSize"; int i, count = [components count]; for (i = 1; i <= count && result; i++) { NSString *makePath = [NSString - pathWithComponents: [components - subarrayWithRange: NSMakeRange(0, i)]]; + pathWithComponents: [components + subarrayWithRange: NSMakeRange( + 0, + i)]]; if (![self fileExistsAtPath: makePath isDirectory: &isDirectory]) { result = [self createDirectoryAtPath: makePath attributes: attributes]; @@ -301,14 +303,14 @@ NSString *const NSFileSystemFreeSize = @"NSFileSystemFreeSize"; } - (BOOL) createDirectoryAtURL: (NSURL *) url - withIntermediateDirectories: (BOOL) intermediates - attributes: (NSDictionary *) attributes - error: (NSError **) error + withIntermediateDirectories: (BOOL) intermediates + attributes: (NSDictionary *) attributes + error: (NSError **) error { return [self createDirectoryAtPath: [url path] - withIntermediateDirectories: intermediates - attributes: attributes - error: error]; + withIntermediateDirectories: intermediates + attributes: attributes + error: error]; } - (BOOL) createSymbolicLinkAtPath: (NSString *) path diff --git a/Foundation/NSFormatter.h b/Foundation/NSFormatter.h index 6afcaa25..b5280c01 100644 --- a/Foundation/NSFormatter.h +++ b/Foundation/NSFormatter.h @@ -28,8 +28,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ errorDescription: (NSString **) error; - (BOOL) getObjectValue: (id *) object - forString: (NSString *) string - errorDescription: (NSString **) error; + forString: (NSString *) string + errorDescription: (NSString **) error; - (NSString *) stringForObjectValue: object; @@ -37,7 +37,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSAttributedString *) attributedStringForObjectValue: object withDefaultAttributes: - (NSDictionary *) attributes; + (NSDictionary *) attributes; - (BOOL) isPartialStringValid: (NSString **) partialStringp proposedSelectedRange: (NSRange *) proposedRangep diff --git a/Foundation/NSFormatter.m b/Foundation/NSFormatter.m index ea9f273c..7725722c 100644 --- a/Foundation/NSFormatter.m +++ b/Foundation/NSFormatter.m @@ -32,8 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) getObjectValue: (id *) object - forString: (NSString *) string - errorDescription: (NSString **) error + forString: (NSString *) string + errorDescription: (NSString **) error { NSInvalidAbstractInvocation(); return NO; @@ -51,7 +51,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSAttributedString *) attributedStringForObjectValue: (id) object withDefaultAttributes: - (NSDictionary *) attributes + (NSDictionary *) attributes { NSInvalidAbstractInvocation(); return nil; diff --git a/Foundation/NSGeometry.m b/Foundation/NSGeometry.m index a9c1dc8a..4eb19cf9 100644 --- a/Foundation/NSGeometry.m +++ b/Foundation/NSGeometry.m @@ -119,7 +119,7 @@ NSRect NSUnionRect(NSRect rect0, NSRect rect1) { result.origin.y = MIN(rect0.origin.y, rect1.origin.y); result.size.width = MAX(NSMaxX(rect0), NSMaxX(rect1)) - result.origin.x; result.size.height = - MAX(NSMaxY(rect0), NSMaxY(rect1)) - result.origin.y; + MAX(NSMaxY(rect0), NSMaxY(rect1)) - result.origin.y; return result; } @@ -178,8 +178,8 @@ BOOL NSContainsRect(NSRect rect0, NSRect rect1) { (NSMinY(rect0) <= NSMinY(rect1)) && (NSMaxX(rect0) >= NSMaxX(rect1)) && (NSMaxY(rect0) >= NSMaxY(rect1))) - ? YES - : NO; + ? YES + : NO; } BOOL NSIntersectsRect(NSRect rect0, NSRect rect1) { diff --git a/Foundation/NSHTTPCookie/NSHTTPCookieStorage.h b/Foundation/NSHTTPCookie/NSHTTPCookieStorage.h index 6be40fb5..0682e2cb 100644 --- a/Foundation/NSHTTPCookie/NSHTTPCookieStorage.h +++ b/Foundation/NSHTTPCookie/NSHTTPCookieStorage.h @@ -40,8 +40,8 @@ typedef enum { - (void) setCookie: (NSHTTPCookie *) value; - (void) setCookies: (NSArray *) cookies - forURL: (NSURL *) url - mainDocumentURL: (NSURL *) mainDocumentURL; + forURL: (NSURL *) url + mainDocumentURL: (NSURL *) mainDocumentURL; - (void) deleteCookie: (NSHTTPCookie *) value; diff --git a/Foundation/NSHTTPCookie/NSHTTPCookieStorage.m b/Foundation/NSHTTPCookie/NSHTTPCookieStorage.m index 83cf13e1..646807df 100644 --- a/Foundation/NSHTTPCookie/NSHTTPCookieStorage.m +++ b/Foundation/NSHTTPCookie/NSHTTPCookieStorage.m @@ -50,8 +50,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) setCookies: (NSArray *) cookies - forURL: (NSURL *) url - mainDocumentURL: (NSURL *) mainDocumentURL + forURL: (NSURL *) url + mainDocumentURL: (NSURL *) mainDocumentURL { NSUnimplementedMethod(); } diff --git a/Foundation/NSHashTable.m b/Foundation/NSHashTable.m index faff791c..7ce17439 100644 --- a/Foundation/NSHashTable.m +++ b/Foundation/NSHashTable.m @@ -56,14 +56,14 @@ NSHashTable *NSCreateHashTableWithZone(NSHashTableCallBacks callBacks, table->count = 0; table->nBuckets = (capacity < 4) ? 4 : capacity; table->buckets = - NSZoneCalloc(zone, table->nBuckets, sizeof(NSHashBucket *)); + NSZoneCalloc(zone, table->nBuckets, sizeof(NSHashBucket *)); return table; } NSHashTable *NSCopyHashTableWithZone(NSHashTable *table, NSZone *zone) { NSHashTable *newTable = - NSCreateHashTableWithZone(*(table->callBacks), table->count, zone); + NSCreateHashTableWithZone(*(table->callBacks), table->count, zone); NSHashEnumerator state = NSEnumerateHashTable(table); void *entry; @@ -142,7 +142,7 @@ NSArray *NSAllHashTableObjects(NSHashTable *table) { NSHashBucket *j; array = [[[NSMutableArray allocWithZone: NULL] - initWithCapacity: table->count] autorelease]; + initWithCapacity: table->count] autorelease]; for (i = 0; i < table->nBuckets; i++) for (j = table->buckets[i]; j != NULL; j = j->next) @@ -206,11 +206,11 @@ void NSHashInsert(NSHashTable *table, const void *pointer) { table->nBuckets = nBuckets * 2; table->buckets = - NSZoneCalloc(zone, table->nBuckets, sizeof(NSHashBucket *)); + NSZoneCalloc(zone, table->nBuckets, sizeof(NSHashBucket *)); for (i = 0; i < nBuckets; i++) for (j = buckets[i]; j != NULL; j = next) { NSUInteger newi = - table->callBacks->hash(table, j->key) % table->nBuckets; + table->callBacks->hash(table, j->key) % table->nBuckets; next = j->next; j->next = table->buckets[newi]; table->buckets[newi] = j; @@ -355,22 +355,23 @@ const NSHashTableCallBacks NSNonOwnedPointerHashCallBacks = {NULL, NULL, NULL, NULL, NULL}; const NSHashTableCallBacks NSNonRetainedObjectHashCallBacks = { - _NSHashObjectHash, _NSHashObjectIsEqual, NULL, NULL, _NSHashObjectDescribe}; + _NSHashObjectHash, _NSHashObjectIsEqual, NULL, NULL, + _NSHashObjectDescribe}; const NSHashTableCallBacks NSObjectHashCallBacks = { - _NSHashObjectHash, _NSHashObjectIsEqual, _NSHashObjectRetain, - _NSHashObjectRelease, _NSHashObjectDescribe}; + _NSHashObjectHash, _NSHashObjectIsEqual, _NSHashObjectRetain, + _NSHashObjectRelease, _NSHashObjectDescribe}; const NSHashTableCallBacks NSOwnedObjectIdentityHashCallBacks = { - _NSHashPointerHash, _NSHashPointerIsEqual, _NSHashObjectRetain, - _NSHashObjectRelease, _NSHashObjectDescribe}; + _NSHashPointerHash, _NSHashPointerIsEqual, _NSHashObjectRetain, + _NSHashObjectRelease, _NSHashObjectDescribe}; const NSHashTableCallBacks NSOwnedPointerHashCallBacks = { - NULL, NULL, NULL, _NSHashPointerRelease, NULL}; + NULL, NULL, NULL, _NSHashPointerRelease, NULL}; const NSHashTableCallBacks NSPointerToStructHashCallBacks = { - _NSHashPointerToStructHash, _NSHashPointerToStructIsEqual, NULL, - _NSHashPointerRelease, NULL}; + _NSHashPointerToStructHash, _NSHashPointerToStructIsEqual, NULL, + _NSHashPointerRelease, NULL}; NSHashTableCallBacks _NSHashTableFixCallbacks(NSHashTableCallBacks callBacks) { if (callBacks.hash == NULL) diff --git a/Foundation/NSHost.m b/Foundation/NSHost.m index 90c2c785..5166026b 100644 --- a/Foundation/NSHost.m +++ b/Foundation/NSHost.m @@ -60,7 +60,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSHost *) hostWithAddress: (NSString *) address { NSString *hostName = - [[NSPlatform currentPlatform] hostNameByAddress: address]; + [[NSPlatform currentPlatform] hostNameByAddress: address]; if (hostName == nil) { return nil; @@ -81,7 +81,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) _resolveAddressesIfNeeded { if ([_addresses count] == 0) { _addresses = [[[NSPlatform currentPlatform] - addressesForDNSHostName: _name] retain]; + addressesForDNSHostName: _name] retain]; } } diff --git a/Foundation/NSIndexPath.h b/Foundation/NSIndexPath.h index be8ec9e3..6db12a00 100644 --- a/Foundation/NSIndexPath.h +++ b/Foundation/NSIndexPath.h @@ -42,8 +42,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // comparison support - (NSComparisonResult) compare: - (NSIndexPath *) otherObject; // sorting an array of indexPaths using this - // comparison results in an array representing - // nodes in depth-first traversal order + (NSIndexPath *) + otherObject; // sorting an array of indexPaths using this + // comparison results in an array representing + // nodes in depth-first traversal order @end diff --git a/Foundation/NSIndexSet/NSIndexSet.m b/Foundation/NSIndexSet/NSIndexSet.m index e2c6d25d..b14af371 100644 --- a/Foundation/NSIndexSet/NSIndexSet.m +++ b/Foundation/NSIndexSet/NSIndexSet.m @@ -28,7 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + indexSetWithIndexesInRange: (NSRange) range { return [[[self allocWithZone: NULL] initWithIndexesInRange: range] - autorelease]; + autorelease]; } + indexSetWithIndex: (NSUInteger) index { @@ -211,8 +211,8 @@ static NSUInteger positionOfRangeLessThanOrEqualToLocation(NSRange *ranges, } - (NSUInteger) indexGreaterThanIndex: (NSUInteger) index { - NSUInteger first = - positionOfRangeGreaterThanOrEqualToLocation(_ranges, _length, index); + NSUInteger first = positionOfRangeGreaterThanOrEqualToLocation( + _ranges, _length, index); if (first == NSNotFound) return NSNotFound; @@ -231,8 +231,8 @@ static NSUInteger positionOfRangeLessThanOrEqualToLocation(NSRange *ranges, } - (NSUInteger) indexGreaterThanOrEqualToIndex: (NSUInteger) index { - NSUInteger first = - positionOfRangeGreaterThanOrEqualToLocation(_ranges, _length, index); + NSUInteger first = positionOfRangeGreaterThanOrEqualToLocation( + _ranges, _length, index); if (first == NSNotFound) return NSNotFound; @@ -252,7 +252,7 @@ static NSUInteger positionOfRangeLessThanOrEqualToLocation(NSRange *ranges, - (NSUInteger) indexLessThanIndex: (NSUInteger) index { NSInteger first = - positionOfRangeLessThanOrEqualToLocation(_ranges, _length, index); + positionOfRangeLessThanOrEqualToLocation(_ranges, _length, index); if (index == 0) return NSNotFound; @@ -274,7 +274,7 @@ static NSUInteger positionOfRangeLessThanOrEqualToLocation(NSRange *ranges, - (NSUInteger) indexLessThanOrEqualToIndex: (NSUInteger) index { NSInteger first = - positionOfRangeLessThanOrEqualToLocation(_ranges, _length, index); + positionOfRangeLessThanOrEqualToLocation(_ranges, _length, index); if (first == NSNotFound) return NSNotFound; @@ -287,7 +287,7 @@ static NSUInteger positionOfRangeLessThanOrEqualToLocation(NSRange *ranges, - (BOOL) intersectsIndexesInRange: (NSRange) range { NSUInteger first = positionOfRangeGreaterThanOrEqualToLocation( - _ranges, _length, range.location); + _ranges, _length, range.location); if (first == NSNotFound) return NO; @@ -335,8 +335,8 @@ static NSUInteger positionOfRangeLessThanOrEqualToLocation(NSRange *ranges, const uint8_t *rangebytes = [keyed decodeBytesForKey: @"ranges" returnedLength: &length]; NSRange *ranges = (NSRange *) rangebytes; - _ranges = NSZoneMalloc([self zone], sizeof(NSRange) * - ((_length == 0) ? 1 : _length)); + _ranges = NSZoneMalloc( + [self zone], sizeof(NSRange) * ((_length == 0) ? 1 : _length)); for (i = 0; i < _length; i++) _ranges[i] = ranges[i]; } else { @@ -344,10 +344,10 @@ static NSUInteger positionOfRangeLessThanOrEqualToLocation(NSRange *ranges, NSUInteger length; int i; const uint8_t *rangebytes = - [coder decodeBytesWithReturnedLength: &length]; + [coder decodeBytesWithReturnedLength: &length]; NSRange *ranges = (NSRange *) rangebytes; - _ranges = NSZoneMalloc([self zone], sizeof(NSRange) * - ((_length == 0) ? 1 : _length)); + _ranges = NSZoneMalloc( + [self zone], sizeof(NSRange) * ((_length == 0) ? 1 : _length)); for (i = 0; i < _length; i++) _ranges[i] = ranges[i]; } diff --git a/Foundation/NSIndexSet/NSMutableIndexSet.m b/Foundation/NSIndexSet/NSMutableIndexSet.m index db1092a7..1e079f86 100644 --- a/Foundation/NSIndexSet/NSMutableIndexSet.m +++ b/Foundation/NSIndexSet/NSMutableIndexSet.m @@ -73,8 +73,8 @@ static void removeRangeAtPosition(NSRange *ranges, NSUInteger length, _length++; if (_capacity < _length) { _capacity *= 2; - _ranges = - NSZoneRealloc([self zone], _ranges, sizeof(NSRange) * _capacity); + _ranges = NSZoneRealloc([self zone], _ranges, + sizeof(NSRange) * _capacity); } for (i = _length; --i >= position + 1;) _ranges[i] = _ranges[i - 1]; @@ -214,7 +214,7 @@ static void removeRangeAtPosition(NSRange *ranges, NSUInteger length, if (delta < 0) { delta = -delta; NSInteger pos = positionOfRangeLessThanOrEqualToLocation( - _ranges, _length, index - delta); + _ranges, _length, index - delta); if (pos == NSNotFound) return; // raise? @@ -234,7 +234,7 @@ static void removeRangeAtPosition(NSRange *ranges, NSUInteger length, _ranges[count].length -= delta; else _ranges[count].length = - NSMaxRange(_ranges[count]) - (index - delta); + NSMaxRange(_ranges[count]) - (index - delta); } else { // if below and shorter than the delta, remove NSInteger i; @@ -245,8 +245,8 @@ static void removeRangeAtPosition(NSRange *ranges, NSUInteger length, } } else { - NSInteger pos = - positionOfRangeLessThanOrEqualToLocation(_ranges, _length, index); + NSInteger pos = positionOfRangeLessThanOrEqualToLocation( + _ranges, _length, index); if (pos == NSNotFound) return; // raise? diff --git a/Foundation/NSInvocation.h b/Foundation/NSInvocation.h index 63a0c6d0..9771a6c9 100644 --- a/Foundation/NSInvocation.h +++ b/Foundation/NSInvocation.h @@ -36,7 +36,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + (NSInvocation *) invocationWithMethodSignature: - (NSMethodSignature *) signature; + (NSMethodSignature *) signature; - (NSMethodSignature *) methodSignature; diff --git a/Foundation/NSInvocation.m b/Foundation/NSInvocation.m index fefd46d4..40324bd0 100644 --- a/Foundation/NSInvocation.m +++ b/Foundation/NSInvocation.m @@ -48,8 +48,8 @@ id objc_msgSendv(id self, SEL selector, unsigned arg_size, void *arg_frame); NSGetSizeAndAlignment([_signature getArgumentTypeAtIndex: i], &naturalSize, &align); - promotedSize = - ((naturalSize + sizeof(long) - 1) / sizeof(long)) * sizeof(long); + promotedSize = ((naturalSize + sizeof(long) - 1) / sizeof(long)) * + sizeof(long); _argumentSizes[i] = naturalSize; _argumentFrameSize += promotedSize; @@ -191,19 +191,19 @@ static void *bufferForType(void *buffer, const char *type) { } + (NSInvocation *) invocationWithMethodSignature: - (NSMethodSignature *) signature + (NSMethodSignature *) signature { return [[[self allocWithZone: NULL] initWithMethodSignature: signature] - autorelease]; + autorelease]; } + (NSInvocation *) invocationWithMethodSignature: - (NSMethodSignature *) signature + (NSMethodSignature *) signature arguments: (void *) arguments { return [[[self allocWithZone: NULL] initWithMethodSignature: signature arguments: arguments] - autorelease]; + autorelease]; } - (NSMethodSignature *) methodSignature { @@ -228,7 +228,7 @@ static void byteCopy(void *src, void *dst, NSUInteger length) { - (void) getArgument: (void *) pointerToValue atIndex: (NSInteger) index { NSUInteger naturalSize = _argumentSizes[index]; NSUInteger promotedSize = - ((naturalSize + sizeof(long) - 1) / sizeof(long)) * sizeof(long); + ((naturalSize + sizeof(long) - 1) / sizeof(long)) * sizeof(long); if (naturalSize == promotedSize) { byteCopy(_argumentFrame + _argumentOffsets[index], pointerToValue, @@ -247,16 +247,16 @@ static void byteCopy(void *src, void *dst, NSUInteger length) { } } else { [NSException - raise: NSInvalidArgumentException - format: @"Unable to convert naturalSize=%d to promotedSize=%d", - naturalSize, promotedSize]; + raise: NSInvalidArgumentException + format: @"Unable to convert naturalSize=%d to promotedSize=%d", + naturalSize, promotedSize]; } } - (void) setArgument: (void *) pointerToValue atIndex: (NSInteger) index { NSUInteger naturalSize = _argumentSizes[index]; NSUInteger promotedSize = - ((naturalSize + sizeof(long) - 1) / sizeof(long)) * sizeof(long); + ((naturalSize + sizeof(long) - 1) / sizeof(long)) * sizeof(long); if (naturalSize == promotedSize) { byteCopy(pointerToValue, _argumentFrame + _argumentOffsets[index], @@ -471,8 +471,8 @@ static void byteCopy(void *src, void *dst, NSUInteger length) { struct structReturn { char *result; ; - } (*function)() = - (struct structReturn(*)()) msgSendv; // should be msgSend_stret + } (*function)() = (struct structReturn(*)()) + msgSendv; // should be msgSend_stret struct structReturn value; value.result = calloc(size, sizeof(char)); diff --git a/Foundation/NSKeyValueCoding/NSArray+KVC.m b/Foundation/NSKeyValueCoding/NSArray+KVC.m index e57a846b..e35f8ec9 100644 --- a/Foundation/NSKeyValueCoding/NSArray+KVC.m +++ b/Foundation/NSKeyValueCoding/NSArray+KVC.m @@ -44,11 +44,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // find operator selector (e.g. _kvo_operator_count for @count) SEL operatorSelector=NSSelectorFromString([NSString stringWithFormat:@"_kvo_operator_%@", operator]); if (![self respondsToSelector: operatorSelector]) - [NSException - raise: @"NSKeyValueCodingException" - format: - @"operator %@: NSArray selector %@ not implemented", - operator, NSStringFromSelector(operatorSelector)]; + [NSException raise: @"NSKeyValueCodingException" + format: @"operator %@: NSArray selector %@ not " + @"implemented", + operator, + NSStringFromSelector(operatorSelector)]; return [self performSelector: operatorSelector]; } @@ -210,10 +210,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSArray (KVO) - (void) addObserver: (NSObject *) observer - toObjectsAtIndexes: (NSIndexSet *) indexes - forKeyPath: (NSString *) keyPath - options: (NSKeyValueObservingOptions) options - context: (void *) context + toObjectsAtIndexes: (NSIndexSet *) indexes + forKeyPath: (NSString *) keyPath + options: (NSKeyValueObservingOptions) options + context: (void *) context { NSUInteger idx = [indexes firstIndex]; while (idx != NSNotFound) { @@ -226,8 +226,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) removeObserver: (NSObject *) observer - fromObjectsAtIndexes: (NSIndexSet *) indexes - forKeyPath: (NSString *) keyPath + fromObjectsAtIndexes: (NSIndexSet *) indexes + forKeyPath: (NSString *) keyPath { NSUInteger idx = [indexes firstIndex]; while (idx != NSNotFound) { diff --git a/Foundation/NSKeyValueCoding/NSKVCMutableArray.m b/Foundation/NSKeyValueCoding/NSKVCMutableArray.m index 71c24197..96a7fba6 100644 --- a/Foundation/NSKeyValueCoding/NSKVCMutableArray.m +++ b/Foundation/NSKeyValueCoding/NSKVCMutableArray.m @@ -29,18 +29,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ id ukey = [key capitalizedString]; insertSel = NSSelectorFromString( - [NSString stringWithFormat: @"insertObject:in%@AtIndex:", ukey]); + [NSString stringWithFormat: @"insertObject:in%@AtIndex:", ukey]); removeSel = NSSelectorFromString( - [NSString stringWithFormat: @"removeObjectFrom%@AtIndex:", ukey]); + [NSString stringWithFormat: @"removeObjectFrom%@AtIndex:", ukey]); replaceSel = NSSelectorFromString([NSString - stringWithFormat: @"replaceObjectIn%@AtIndex:withObject:", ukey]); + stringWithFormat: @"replaceObjectIn%@AtIndex:withObject:", ukey]); accessorSel = NSSelectorFromString(key); objectAtIndexSel = NSSelectorFromString( - [NSString stringWithFormat: @"objectIn%@AtIndex:", ukey]); + [NSString stringWithFormat: @"objectIn%@AtIndex:", ukey]); setterSel = - NSSelectorFromString([NSString stringWithFormat: @"set%@:", ukey]); - countSel = - NSSelectorFromString([NSString stringWithFormat: @"countOf%@", ukey]); + NSSelectorFromString([NSString stringWithFormat: @"set%@:", ukey]); + countSel = NSSelectorFromString( + [NSString stringWithFormat: @"countOf%@", ukey]); if ([proxyObject respondsToSelector: insertSel]) insert = [proxyObject methodForSelector: insertSel]; diff --git a/Foundation/NSKeyValueCoding/NSKVOInfoPerObject.m b/Foundation/NSKeyValueCoding/NSKVOInfoPerObject.m index 4d01bc7c..48765d7a 100644 --- a/Foundation/NSKeyValueCoding/NSKVOInfoPerObject.m +++ b/Foundation/NSKeyValueCoding/NSKVOInfoPerObject.m @@ -47,9 +47,9 @@ - (void) removeKeyObserver: (NSKeyObserver *) keyObserver { NSString *key = [[[keyObserver key] retain] - autorelease]; // do the retain/autorelease dance, because we just might - // release the key out from under us when the keyObserver - // is deallocated. + autorelease]; // do the retain/autorelease dance, because we just + // might release the key out from under us when the + // keyObserver is deallocated. NSMutableArray *observers = [_dictionary objectForKey: key]; [observers removeObjectIdenticalTo: keyObserver]; @@ -59,6 +59,6 @@ - (NSString *) description { return [NSString - stringWithFormat: @"%@:%p %@", [self class], self, _dictionary]; + stringWithFormat: @"%@:%p %@", [self class], self, _dictionary]; } @end diff --git a/Foundation/NSKeyValueCoding/NSKeyObserver.h b/Foundation/NSKeyValueCoding/NSKeyObserver.h index 430ec278..30ab8310 100644 --- a/Foundation/NSKeyValueCoding/NSKeyObserver.h +++ b/Foundation/NSKeyValueCoding/NSKeyObserver.h @@ -13,9 +13,9 @@ } - initWithObject: object - key: (NSString *) key - keyPathObserver: (NSKeyPathObserver *) keyPathObserver - restOfPath: (NSString *) restOfPath; + key: (NSString *) key + keyPathObserver: (NSKeyPathObserver *) keyPathObserver + restOfPath: (NSString *) restOfPath; - (BOOL) isValid; - (void) invalidate; diff --git a/Foundation/NSKeyValueCoding/NSKeyObserver.m b/Foundation/NSKeyValueCoding/NSKeyObserver.m index 8ef43037..dfd1866c 100644 --- a/Foundation/NSKeyValueCoding/NSKeyObserver.m +++ b/Foundation/NSKeyValueCoding/NSKeyObserver.m @@ -4,9 +4,9 @@ @implementation NSKeyObserver - initWithObject: object - key: (NSString *) key - keyPathObserver: (NSKeyPathObserver *) keyPathObserver - restOfPath: (NSString *) restOfPath + key: (NSString *) key + keyPathObserver: (NSKeyPathObserver *) keyPathObserver + restOfPath: (NSString *) restOfPath { _object = object; _key = [key copy]; @@ -72,8 +72,8 @@ - (NSString *) description { return [NSString - stringWithFormat: @"<%@ %x _object: %@ _key: %@ _branchPath: %@>", - [self class], self, _object, _key, _branchPath]; + stringWithFormat: @"<%@ %x _object: %@ _key: %@ _branchPath: %@>", + [self class], self, _object, _key, _branchPath]; } @end diff --git a/Foundation/NSKeyValueCoding/NSKeyValueCoding.m b/Foundation/NSKeyValueCoding/NSKeyValueCoding.m index 4f41cb4d..dd9b4cd3 100644 --- a/Foundation/NSKeyValueCoding/NSKeyValueCoding.m +++ b/Foundation/NSKeyValueCoding/NSKeyValueCoding.m @@ -93,21 +93,21 @@ NSString *const NSUndefinedKeyException = @"NSUnknownKeyException"; return [NSNumber numberWithLongLong: *(long long *) value]; case 'Q': return [NSNumber - numberWithUnsignedLongLong: *(unsigned long long *) value]; + numberWithUnsignedLongLong: *(unsigned long long *) value]; default: // FIX #warning some wrapping types unimplemented [NSException - raise: NSInvalidArgumentException - format: @"FIXME: wrap value of type %s unimplemented for get", - type]; + raise: NSInvalidArgumentException + format: @"FIXME: wrap value of type %s unimplemented for get", + type]; return nil; } } - (BOOL) _setValue: (id) value - toBuffer: (void *) buffer - ofType: (const char *) type - shouldRetain: (BOOL) shouldRetain + toBuffer: (void *) buffer + ofType: (const char *) type + shouldRetain: (BOOL) shouldRetain { char *cleanType = __builtin_alloca(strlen(type) + 1); [self _demangleTypeEncoding: type to: cleanType]; @@ -166,9 +166,9 @@ NSString *const NSUndefinedKeyException = @"NSUnknownKeyException"; default: // FIX #warning some wrapping types unimplemented [NSException - raise: NSInvalidArgumentException - format: @"FIXME: wrap value of type %s unimplemented for set", - type]; + raise: NSInvalidArgumentException + format: @"FIXME: wrap value of type %s unimplemented for set", + type]; return NO; } } @@ -305,8 +305,8 @@ NSString *const NSUndefinedKeyException = @"NSUnknownKeyException"; } BOOL shouldNotify = - [[self class] automaticallyNotifiesObserversForKey: key] && - [self _hasObserverForKey: key]; + [[self class] automaticallyNotifiesObserversForKey: key] && + [self _hasObserverForKey: key]; if (shouldNotify == YES) { } if ([[self class] accessInstanceVariablesDirectly]) { @@ -346,9 +346,9 @@ NSString *const NSUndefinedKeyException = @"NSUnknownKeyException"; [self setNilValueForKey: key]; } else { [self _setValue: value - toBuffer: (void *) self + ivar_getOffset(ivar) - ofType: ivar_getTypeEncoding(ivar) - shouldRetain: YES]; + toBuffer: (void *) self + ivar_getOffset(ivar) + ofType: ivar_getTypeEncoding(ivar) + shouldRetain: YES]; } if (shouldNotify) { [self didChangeValueForKey: key]; @@ -373,10 +373,10 @@ NSString *const NSUndefinedKeyException = @"NSUnknownKeyException"; error: (NSError **) outError { SEL sel = NSSelectorFromString([NSString - stringWithFormat: @"validate%@:error:", [key capitalizedString]]); + stringWithFormat: @"validate%@:error:", [key capitalizedString]]); if ([self respondsToSelector: sel]) { id inv = [NSInvocation invocationWithMethodSignature: - [self methodSignatureForSelector: sel]]; + [self methodSignatureForSelector: sel]]; [inv setSelector: sel]; [inv setTarget: self]; [inv setArgument: ioValue atIndex: 2]; @@ -394,16 +394,16 @@ NSString *const NSUndefinedKeyException = @"NSUnknownKeyException"; } - valueForUndefinedKey: (NSString *) key { - [NSException - raise: NSUndefinedKeyException - format: @"%@: trying to get undefined key '%@'", [self className], key]; + [NSException raise: NSUndefinedKeyException + format: @"%@: trying to get undefined key '%@'", + [self className], key]; return nil; } - (void) setValue: (id) value forUndefinedKey: (NSString *) key { - [NSException - raise: NSUndefinedKeyException - format: @"%@: trying to set undefined key '%@'", [self className], key]; + [NSException raise: NSUndefinedKeyException + format: @"%@: trying to set undefined key '%@'", + [self className], key]; } - (void) setNilValueForKey: key { @@ -441,8 +441,8 @@ NSString *const NSUndefinedKeyException = @"NSUnknownKeyException"; forKeyPath: (NSString *) keyPath error: (NSError **) outError { - id array = - [[[keyPath componentsSeparatedByString: @"."] mutableCopy] autorelease]; + id array = [[[keyPath componentsSeparatedByString: @"."] mutableCopy] + autorelease]; id lastPathComponent = [array lastObject]; [array removeObject: lastPathComponent]; id en = [array objectEnumerator]; diff --git a/Foundation/NSKeyValueCoding/NSKeyValueObserving.h b/Foundation/NSKeyValueCoding/NSKeyValueObserving.h index daa7d31c..0807f971 100644 --- a/Foundation/NSKeyValueCoding/NSKeyValueObserving.h +++ b/Foundation/NSKeyValueCoding/NSKeyValueObserving.h @@ -56,7 +56,7 @@ typedef NSUInteger NSKeyValueSetMutationKind; + (BOOL) automaticallyNotifiesObserversForKey: (NSString *) key; + (NSSet *) keyPathsForValuesAffectingValueForKey: (NSString *) key; + (void) setKeys: (NSArray *) keys - triggerChangeNotificationsForDependentKey: (NSString *) dependentKey; + triggerChangeNotificationsForDependentKey: (NSString *) dependentKey; - (void) observeValueForKeyPath: (NSString *) keyPath ofObject: (id) object @@ -71,11 +71,11 @@ typedef NSUInteger NSKeyValueSetMutationKind; - (void) willChangeValueForKey: (NSString *) key; - (void) didChangeValueForKey: (NSString *) key; - (void) willChange: (NSKeyValueChange) change - valuesAtIndexes: (NSIndexSet *) indexes - forKey: (NSString *) key; + valuesAtIndexes: (NSIndexSet *) indexes + forKey: (NSString *) key; - (void) didChange: (NSKeyValueChange) change - valuesAtIndexes: (NSIndexSet *) indexes - forKey: (NSString *) key; + valuesAtIndexes: (NSIndexSet *) indexes + forKey: (NSString *) key; - (void) willChangeValueForKey: (NSString *) key withSetMutation: (NSKeyValueSetMutationKind) mutation usingObjects: (NSSet *) objects; @@ -89,13 +89,13 @@ typedef NSUInteger NSKeyValueSetMutationKind; @interface NSArray (KeyValueObserving) - (void) addObserver: (NSObject *) observer - toObjectsAtIndexes: (NSIndexSet *) indexes - forKeyPath: (NSString *) keyPath - options: (NSKeyValueObservingOptions) options - context: (void *) context; + toObjectsAtIndexes: (NSIndexSet *) indexes + forKeyPath: (NSString *) keyPath + options: (NSKeyValueObservingOptions) options + context: (void *) context; - (void) removeObserver: (NSObject *) observer - fromObjectsAtIndexes: (NSIndexSet *) indexes - forKeyPath: (NSString *) keyPath; + fromObjectsAtIndexes: (NSIndexSet *) indexes + forKeyPath: (NSString *) keyPath; @end @protocol NSKeyValueObserver diff --git a/Foundation/NSKeyValueCoding/NSKeyValueObserving.m b/Foundation/NSKeyValueCoding/NSKeyValueObserving.m index e6ad3cee..5d28f1ef 100644 --- a/Foundation/NSKeyValueCoding/NSKeyValueObserving.m +++ b/Foundation/NSKeyValueCoding/NSKeyValueObserving.m @@ -50,12 +50,12 @@ NSString *const NSKeyValueChangeNewKey = @"NSKeyValueChangeNewKey"; NSString *const NSKeyValueChangeOldKey = @"NSKeyValueChangeOldKey"; NSString *const NSKeyValueChangeIndexesKey = @"NSKeyValueChangeIndexesKey"; NSString *const NSKeyValueChangeNotificationIsPriorKey = - @"NSKeyValueChangeNotificationIsPriorKey"; + @"NSKeyValueChangeNotificationIsPriorKey"; NSString *const _KVO_DependentKeysTriggeringChangeNotification = - @"_KVO_DependentKeysTriggeringChangeNotification"; + @"_KVO_DependentKeysTriggeringChangeNotification"; NSString *const _KVO_KeyPathsForValuesAffectingValueForKey = - @"_KVO_KeyPathsForValuesAffectingValueForKey"; + @"_KVO_KeyPathsForValuesAffectingValueForKey"; static pthread_mutex_t kvoLock = PTHREAD_MUTEX_INITIALIZER; @@ -68,7 +68,7 @@ void NSDetermineKeyValueDebugLoggingLevel() { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSKeyValueDebugLogLevel = - [defaults integerForKey: @"NSKeyValueDebugLogLevel"]; + [defaults integerForKey: @"NSKeyValueDebugLogLevel"]; if (NSKeyValueDebugLogLevel > 0) { NSLog(@"set NSKeyValueDebugLevel to: '%d'", NSKeyValueDebugLogLevel); @@ -95,8 +95,8 @@ static inline NSMapTable *masterObservationInfo() { if (observationInfos == NULL) observationInfos = - NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, - NSNonOwnedPointerMapValueCallBacks, 0); + NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, + NSNonOwnedPointerMapValueCallBacks, 0); return observationInfos; } @@ -218,7 +218,7 @@ addKeyPathObserverToDependantPaths(id object, NSSet *dependentPaths, // Recursively walk the keypath setting up key/keyPath observer pairs // for each dependentPath. NSKeyObserver *check = - addKeyPathObserverToObject(object, path, keyPathObserver); + addKeyPathObserverToObject(object, path, keyPathObserver); if (check != nil) [result addObject: check]; @@ -234,8 +234,8 @@ static void addKeyObserverDependantsAndRestOfPath(NSKeyObserver *keyObserver) { NSKeyPathObserver *keyPathObserver = [keyObserver keyPathObserver]; NSArray *dependantObservers = addKeyPathObserverToDependantPaths( - object, [[object class] keyPathsForValuesAffectingValueForKey: key], - keyPathObserver); + object, [[object class] keyPathsForValuesAffectingValueForKey: key], + keyPathObserver); [keyObserver setDependantKeyObservers: dependantObservers]; @@ -244,7 +244,7 @@ static void addKeyObserverDependantsAndRestOfPath(NSKeyObserver *keyObserver) { // for each link in the chain. [object valueForKey: key] makes sure the // observer pair is associated with the correct object. NSKeyObserver *restOfPathObserver = addKeyPathObserverToObject( - [object valueForKey: key], restOfPath, keyPathObserver); + [object valueForKey: key], restOfPath, keyPathObserver); [keyObserver setRestOfPathObserver: restOfPathObserver]; } @@ -266,10 +266,10 @@ addKeyPathObserverToObject(id object, NSString *path, } NSKeyObserver *keyObserver = - [[[NSKeyObserver alloc] initWithObject: object - key: key - keyPathObserver: keyPathObserver - restOfPath: restOfPath] autorelease]; + [[[NSKeyObserver alloc] initWithObject: object + key: key + keyPathObserver: keyPathObserver + restOfPath: restOfPath] autorelease]; addKeyObserverDependantsAndRestOfPath(keyObserver); @@ -307,11 +307,11 @@ addKeyPathObserverToObject(id object, NSString *path, keyPath); NSKeyPathObserver *keyPathObserver = - [[[NSKeyPathObserver alloc] initWithObject: self - observer: observer - keyPath: keyPath - options: options - context: context] autorelease]; + [[[NSKeyPathObserver alloc] initWithObject: self + observer: observer + keyPath: keyPath + options: options + context: context] autorelease]; addKeyPathObserverToObject(self, keyPath, keyPathObserver); @@ -324,9 +324,9 @@ addKeyPathObserverToObject(id object, NSString *path, #endif } NSKeyValueDebugLog( - kNSKeyValueDebugLevel2, - @"self: %@ added keyPathObserver: %@ for observer: %@ keyPath: %@", - self, keyPathObserver, observer, keyPath); + kNSKeyValueDebugLevel2, + @"self: %@ added keyPathObserver: %@ for observer: %@ keyPath: %@", + self, keyPathObserver, observer, keyPath); } static void pruneKeyObserver(NSKeyObserver *keyObserver); @@ -354,7 +354,7 @@ static void pruneKeyObserver(NSKeyObserver *keyObserver) { - (void) removeObserver: observer forKeyPath: (NSString *) keyPath { NSKeyObserver *keyObserver = - keyObserverForObserverAndKeyPath(self, observer, keyPath); + keyObserverForObserverAndKeyPath(self, observer, keyPath); pruneKeyObserver(keyObserver); } @@ -375,13 +375,13 @@ static void willChangeValueForKey(id object, NSString *key, } NSArray *keyObserversArray = - [NSArray arrayWithArray: [observationInfo keyObserversForKey: key]]; + [NSArray arrayWithArray: [observationInfo keyObserversForKey: key]]; NSInteger count = [keyObserversArray count]; if (count > 0) { - NSKeyValueDebugLog( - kNSKeyValueDebugLevel2, - @"notifying %d observers of change to keyPath: %@ which are: %@", - count, key, keyObserversArray); + NSKeyValueDebugLog(kNSKeyValueDebugLevel2, + @"notifying %d observers of change to keyPath: %@ " + @"which are: %@", + count, key, keyObserversArray); } // Cocoa does notifications in this order, last to first while (--count >= 0) { @@ -410,51 +410,51 @@ static void willChangeValueForKey(id object, NSString *key, // unused // void *rootContext=[keyPathObserver context]; NSMutableDictionary *changeDictionary = - [keyPathObserver changeDictionaryWithInfo: changeInfo]; + [keyPathObserver changeDictionaryWithInfo: changeInfo]; if (observingOptions & NSKeyValueObservingOptionOld && ![changeDictionary objectForKey: NSKeyValueChangeOldKey]) { NSIndexSet *idxs = - [changeInfo objectForKey: NSKeyValueChangeIndexesKey]; + [changeInfo objectForKey: NSKeyValueChangeIndexesKey]; if (idxs == nil) [changeDictionary - setValue: [rootObject valueForKeyPath: rootKeyPath] - forKey: NSKeyValueChangeOldKey]; + setValue: [rootObject valueForKeyPath: rootKeyPath] + forKey: NSKeyValueChangeOldKey]; else { // FIXME: this is wrong, the type of change will depend on the // position in the key path int type = [[changeDictionary - objectForKey: NSKeyValueChangeKindKey] intValue]; + objectForKey: NSKeyValueChangeKindKey] intValue]; // for to-many relationships, oldvalue is only sensible for // replace and remove if (type == NSKeyValueChangeReplacement || type == NSKeyValueChangeRemoval) [changeDictionary - setValue: [[object - mutableArrayValueForKeyPath: rootKeyPath] - objectsAtIndexes: idxs] - forKey: NSKeyValueChangeOldKey]; + setValue: [[object mutableArrayValueForKeyPath: + rootKeyPath] + objectsAtIndexes: idxs] + forKey: NSKeyValueChangeOldKey]; } } if (observingOptions & NSKeyValueObservingOptionPrior) { [changeDictionary - setObject: [NSNumber numberWithBool: YES] - forKey: NSKeyValueChangeNotificationIsPriorKey]; + setObject: [NSNumber numberWithBool: YES] + forKey: NSKeyValueChangeNotificationIsPriorKey]; NSKeyValueDebugLog( - kNSKeyValueDebugLevel2, - @"informing observer: %@ prior to change: %@ inKeyPath: %@", - rootObserver, changeDictionary, rootKeyPath); + kNSKeyValueDebugLevel2, + @"informing observer: %@ prior to change: %@ inKeyPath: %@", + rootObserver, changeDictionary, rootKeyPath); [rootObserver observeValueForKeyPath: rootKeyPath ofObject: rootObject change: changeDictionary context: [keyPathObserver context]]; [changeDictionary - removeObjectForKey: NSKeyValueChangeNotificationIsPriorKey]; + removeObjectForKey: NSKeyValueChangeNotificationIsPriorKey]; } pruneRestOfPathAndDependantObservers(keyObserver); @@ -473,7 +473,7 @@ static void willChangeValueForKey(id object, NSString *key, - (void) willChangeValueForKey: (NSString *) key { NSMutableDictionary *changeInfo = - [[NSMutableDictionary allocWithZone: NULL] init]; + [[NSMutableDictionary allocWithZone: NULL] init]; [changeInfo setObject: [NSNumber numberWithInt: NSKeyValueChangeSetting] forKey: NSKeyValueChangeKindKey]; willChangeValueForKey(self, key, changeInfo); @@ -481,11 +481,11 @@ static void willChangeValueForKey(id object, NSString *key, } - (void) willChange: (NSKeyValueChange) change - valuesAtIndexes: (NSIndexSet *) indexes - forKey: (NSString *) key + valuesAtIndexes: (NSIndexSet *) indexes + forKey: (NSString *) key { NSMutableDictionary *changeInfo = - [[NSMutableDictionary allocWithZone: NULL] init]; + [[NSMutableDictionary allocWithZone: NULL] init]; [changeInfo setObject: [NSNumber numberWithUnsignedInteger: change] forKey: NSKeyValueChangeKindKey]; @@ -502,7 +502,7 @@ static void willChangeValueForKey(id object, NSString *key, { NSMutableSet *changeSet; NSMutableDictionary *changeInfo = - [[NSMutableDictionary allocWithZone: NULL] init]; + [[NSMutableDictionary allocWithZone: NULL] init]; switch (mutation) { case NSKeyValueUnionSetMutation: @@ -551,13 +551,13 @@ static void didChangeValueForKey(id object, NSString *key) { } NSArray *keyObserversArray = - [NSArray arrayWithArray: [observationInfo keyObserversForKey: key]]; + [NSArray arrayWithArray: [observationInfo keyObserversForKey: key]]; NSInteger count = [keyObserversArray count]; if (count > 0) { - NSKeyValueDebugLog( - kNSKeyValueDebugLevel2, - @"notifying %d observers of change to keyPath: %@ which are: %@", - count, key, keyObserversArray); + NSKeyValueDebugLog(kNSKeyValueDebugLevel2, + @"notifying %d observers of change to keyPath: %@ " + @"which are: %@", + count, key, keyObserversArray); } // Cocoa does notifications in this order, last to first @@ -587,39 +587,39 @@ static void didChangeValueForKey(id object, NSString *key) { // unused // void *rootContext=[keyPathObserver context]; NSMutableDictionary *changeDictionary = - [keyPathObserver changeDictionary]; + [keyPathObserver changeDictionary]; if (observerOptions & NSKeyValueObservingOptionNew && ![changeDictionary objectForKey: NSKeyValueChangeNewKey]) { NSIndexSet *idxs = - [changeDictionary objectForKey: NSKeyValueChangeIndexesKey]; + [changeDictionary objectForKey: NSKeyValueChangeIndexesKey]; if (idxs == nil) [changeDictionary - setValue: [rootObject valueForKeyPath: rootKeyPath] - forKey: NSKeyValueChangeNewKey]; + setValue: [rootObject valueForKeyPath: rootKeyPath] + forKey: NSKeyValueChangeNewKey]; else { int type = [[changeDictionary - objectForKey: NSKeyValueChangeKindKey] intValue]; + objectForKey: NSKeyValueChangeKindKey] intValue]; // for to-many relationships, newvalue is only sensible for // replace and insert if (type == NSKeyValueChangeReplacement || type == NSKeyValueChangeInsertion) [changeDictionary - setValue: [[rootObject - mutableArrayValueForKeyPath: rootKeyPath] - objectsAtIndexes: idxs] - forKey: NSKeyValueChangeNewKey]; + setValue: [[rootObject mutableArrayValueForKeyPath: + rootKeyPath] + objectsAtIndexes: idxs] + forKey: NSKeyValueChangeNewKey]; } } addKeyObserverDependantsAndRestOfPath(keyObserver); NSKeyValueDebugLog( - kNSKeyValueDebugLevel2, - @"informing observer: %@ after change: %@ inKeyPath: %@", - rootObserver, changeDictionary, rootKeyPath); + kNSKeyValueDebugLevel2, + @"informing observer: %@ after change: %@ inKeyPath: %@", + rootObserver, changeDictionary, rootKeyPath); [rootObserver observeValueForKeyPath: rootKeyPath ofObject: rootObject change: changeDictionary @@ -633,8 +633,8 @@ static void didChangeValueForKey(id object, NSString *key) { } - (void) didChange: (NSKeyValueChange) change - valuesAtIndexes: (NSIndexSet *) indexes - forKey: (NSString *) key + valuesAtIndexes: (NSIndexSet *) indexes + forKey: (NSString *) key { didChangeValueForKey(self, key); } @@ -647,7 +647,7 @@ static void didChangeValueForKey(id object, NSString *key) { } + (void) setKeys: (NSArray *) keys - triggerChangeNotificationsForDependentKey: (NSString *) dependentKey + triggerChangeNotificationsForDependentKey: (NSString *) dependentKey { NSKVOInfoPerObject *observationInfo = [self observationInfo]; @@ -657,12 +657,12 @@ static void didChangeValueForKey(id object, NSString *key) { } NSMutableDictionary *dependencies = [observationInfo - objectForKey: _KVO_DependentKeysTriggeringChangeNotification]; + objectForKey: _KVO_DependentKeysTriggeringChangeNotification]; if (!dependencies) { dependencies = [NSMutableDictionary dictionary]; [observationInfo - setObject: dependencies - forKey: _KVO_DependentKeysTriggeringChangeNotification]; + setObject: dependencies + forKey: _KVO_DependentKeysTriggeringChangeNotification]; } for (id key in keys) { @@ -701,7 +701,7 @@ static SEL selectorForKeyPathsForValuesAffecting(NSString *key) { else { NSKVOInfoPerObject *observationInfo = [self observationInfo]; NSDictionary *keyPathsByKey = [observationInfo - objectForKey: _KVO_KeyPathsForValuesAffectingValueForKey]; + objectForKey: _KVO_KeyPathsForValuesAffectingValueForKey]; if (keyPathsByKey == nil) { keyPathsByKey = [self _KVO_buildDependencyUnion]; @@ -750,7 +750,7 @@ static SEL selectorForKeyPathsForValuesAffecting(NSString *key) { [self willChangeValueForKey: key]; \ typedef id (*sender)(id obj, SEL selector, type value); \ sender implementation = \ - (sender) [[self superclass] instanceMethodForSelector: _cmd]; \ + (sender) [[self superclass] instanceMethodForSelector: _cmd]; \ (void) *implementation(self, _cmd, value); \ if (shouldNotify) \ [self didChangeValueForKey: key]; \ @@ -792,7 +792,7 @@ CHANGE_DECLARATION(SEL) } typedef id (*sender)(id obj, SEL selector, id object, id key); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; implementation(self, _cmd, object, key); if (shouldNotify) { [self didChangeValueForKey: key]; @@ -806,7 +806,7 @@ CHANGE_DECLARATION(SEL) } typedef id (*sender)(id obj, SEL selector, id key); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; implementation(self, _cmd, key); if (shouldNotify) { [self didChangeValueForKey: key]; @@ -829,15 +829,15 @@ CHANGE_DECLARATION(SEL) NSString *key = [[NSString allocWithZone: NULL] initWithCString: sel]; [self willChange: NSKeyValueChangeInsertion - valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] - forKey: key]; + valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] + forKey: key]; typedef id (*sender)(id obj, SEL selector, id value, NSInteger index); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; (void) *implementation(self, _cmd, object, index); [self didChange: NSKeyValueChangeInsertion - valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] - forKey: key]; + valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] + forKey: key]; [key release]; } @@ -857,16 +857,16 @@ CHANGE_DECLARATION(SEL) NSString *key = [[NSString allocWithZone: NULL] initWithCString: sel]; [self willChange: NSKeyValueChangeInsertion - valuesAtIndexes: indexes - forKey: key]; + valuesAtIndexes: indexes + forKey: key]; typedef id (*sender)(id obj, SEL selector, NSArray * value, NSIndexSet * indexes); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; (void) *implementation(self, _cmd, objects, indexes); [self didChange: NSKeyValueChangeInsertion - valuesAtIndexes: indexes - forKey: key]; + valuesAtIndexes: indexes + forKey: key]; [key release]; } @@ -885,21 +885,21 @@ CHANGE_DECLARATION(SEL) strcat(countSelName, sel); NSUInteger idx = - (NSUInteger) [self performSelector: sel_getUid(countSelName)]; + (NSUInteger) [self performSelector: sel_getUid(countSelName)]; sel[0] = tolower(sel[0]); NSString *key = [[NSString allocWithZone: NULL] initWithCString: sel]; [self willChange: NSKeyValueChangeInsertion - valuesAtIndexes: [NSIndexSet indexSetWithIndex: idx] - forKey: key]; + valuesAtIndexes: [NSIndexSet indexSetWithIndex: idx] + forKey: key]; typedef id (*sender)(id obj, SEL selector, id value); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; (void) *implementation(self, _cmd, object); [self didChange: NSKeyValueChangeInsertion - valuesAtIndexes: [NSIndexSet indexSetWithIndex: idx] - forKey: key]; + valuesAtIndexes: [NSIndexSet indexSetWithIndex: idx] + forKey: key]; [key release]; } @@ -921,7 +921,7 @@ CHANGE_DECLARATION(SEL) usingObjects: objects]; typedef id (*sender)(id obj, SEL selector, NSSet * objects); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; (void) *implementation(self, _cmd, objects); [self didChangeValueForKey: key withSetMutation: NSKeyValueUnionSetMutation @@ -944,21 +944,21 @@ CHANGE_DECLARATION(SEL) strcat(countSelName, sel); NSUInteger idx = - (NSUInteger) [self performSelector: sel_getUid(countSelName)]; + (NSUInteger) [self performSelector: sel_getUid(countSelName)]; sel[0] = tolower(sel[0]); NSString *key = [[NSString allocWithZone: NULL] initWithCString: sel]; [self willChange: NSKeyValueChangeRemoval - valuesAtIndexes: [NSIndexSet indexSetWithIndex: idx] - forKey: key]; + valuesAtIndexes: [NSIndexSet indexSetWithIndex: idx] + forKey: key]; typedef id (*sender)(id obj, SEL selector, id value); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; (void) *implementation(self, _cmd, object); [self didChange: NSKeyValueChangeRemoval - valuesAtIndexes: [NSIndexSet indexSetWithIndex: idx] - forKey: key]; + valuesAtIndexes: [NSIndexSet indexSetWithIndex: idx] + forKey: key]; [key release]; } @@ -980,7 +980,7 @@ CHANGE_DECLARATION(SEL) usingObjects: objects]; typedef id (*sender)(id obj, SEL selector, NSSet * objects); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; (void) *implementation(self, _cmd, objects); [self didChangeValueForKey: key withSetMutation: NSKeyValueMinusSetMutation @@ -1000,15 +1000,15 @@ CHANGE_DECLARATION(SEL) sel[0] = tolower(sel[0]); NSString *key = [[NSString allocWithZone: NULL] initWithCString: sel]; [self willChange: NSKeyValueChangeRemoval - valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] - forKey: key]; + valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] + forKey: key]; typedef id (*sender)(id obj, SEL selector, int index); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; (void) *implementation(self, _cmd, index); [self didChange: NSKeyValueChangeRemoval - valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] - forKey: key]; + valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] + forKey: key]; [key release]; } @@ -1024,15 +1024,15 @@ CHANGE_DECLARATION(SEL) sel[0] = tolower(sel[0]); NSString *key = [[NSString allocWithZone: NULL] initWithCString: sel]; [self willChange: NSKeyValueChangeRemoval - valuesAtIndexes: indexes - forKey: key]; + valuesAtIndexes: indexes + forKey: key]; typedef id (*sender)(id obj, SEL selector, NSIndexSet * indexes); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; (void) *implementation(self, _cmd, indexes); [self didChange: NSKeyValueChangeRemoval - valuesAtIndexes: indexes - forKey: key]; + valuesAtIndexes: indexes + forKey: key]; [key release]; } @@ -1050,15 +1050,15 @@ CHANGE_DECLARATION(SEL) NSString *key = [[NSString allocWithZone: NULL] initWithCString: sel]; [self willChange: NSKeyValueChangeReplacement - valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] - forKey: key]; + valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] + forKey: key]; typedef id (*sender)(id obj, SEL selector, int index, id object); sender implementation = - (sender) [[self superclass] instanceMethodForSelector: _cmd]; + (sender) [[self superclass] instanceMethodForSelector: _cmd]; (void) *implementation(self, _cmd, index, object); [self didChange: NSKeyValueChangeReplacement - valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] - forKey: key]; + valuesAtIndexes: [NSIndexSet indexSetWithIndex: index] + forKey: key]; [key release]; } @@ -1089,8 +1089,8 @@ CHANGE_DECLARATION(SEL) id class = self; while (class != [NSObject class]) { - NSDictionary *classDependents = - [(NSDictionary *) [class observationInfo] + NSDictionary *classDependents = [( + NSDictionary *) [class observationInfo] objectForKey: _KVO_DependentKeysTriggeringChangeNotification]; for (id key in [classDependents allKeys]) { @@ -1197,7 +1197,7 @@ static BOOL methodIsAutoNotifyingSetter(Class class, const char *methodCString) - (Class) _KVO_swizzledClass { // find swizzled class const char *swizzledName = [[NSString - stringWithFormat: @"KVONotifying_%@", [self className]] UTF8String]; + stringWithFormat: @"KVONotifying_%@", [self className]] UTF8String]; Class swizzledClass = objc_lookUpClass(swizzledName); if (swizzledClass) { @@ -1208,17 +1208,17 @@ static BOOL methodIsAutoNotifyingSetter(Class class, const char *methodCString) swizzledClass = objc_allocateClassPair([self class], swizzledName, 0); if (!swizzledClass) { [NSException - raise: @"NSClassCreationException" - format: @"couldn't swizzle class %@ for KVO", [self className]]; + raise: @"NSClassCreationException" + format: @"couldn't swizzle class %@ for KVO", [self className]]; } // add KVO-Observing methods // override className so it returns the original class name Method className = - class_getInstanceMethod([self class], @selector(_KVO_className)); + class_getInstanceMethod([self class], @selector(_KVO_className)); Method class = class_getInstanceMethod([self class], @selector(_KVO_class)); - Method classForCoder = - class_getInstanceMethod([self class], @selector(_KVO_classForCoder)); + Method classForCoder = class_getInstanceMethod([self class], @selector + (_KVO_classForCoder)); IMP classNameImp = method_getImplementation(className); IMP classImp = method_getImplementation(class); IMP classForCoderImp = method_getImplementation(classForCoder); @@ -1250,13 +1250,13 @@ static BOOL methodIsAutoNotifyingSetter(Class class, const char *methodCString) if (numberOfArguments == 3 && methodIsAutoNotifyingSetter([self class], methodCString)) { NSMethodSignature *signature = - [self methodSignatureForSelector: sel]; + [self methodSignatureForSelector: sel]; const char *firstParameterType = - [signature getArgumentTypeAtIndex: 2]; + [signature getArgumentTypeAtIndex: 2]; const char *returnType = [signature methodReturnType]; char *cleanFirstParameterType = - __builtin_alloca(strlen(firstParameterType) + 1); + __builtin_alloca(strlen(firstParameterType) + 1); [self _demangleTypeEncoding: firstParameterType to: cleanFirstParameterType]; @@ -1300,59 +1300,74 @@ or primitive signed type matching unsigned type NSString *methodName = NSStringFromSelector(sel); if (numberOfArguments == 4 && [methodName - _KVC_isSetterForSelectorNameStartingWith: - @"insertObject:in" - endingWith: - @"AtIndex:"]) { + _KVC_isSetterForSelectorNameStartingWith: + @"insertObject:in" + endingWith: @"AtIndex" + @":"]) { kvoSelector = @selector(KVO_notifying_change_insertObject: inKeyAtIndex:); - } else if (numberOfArguments == 3 && - [methodName - _KVC_isSetterForSelectorNameStartingWith: - @"removeObjectFrom" - endingWith: - @"AtIndex:"]) { - kvoSelector = @selector - (KVO_notifying_change_removeObjectFromKeyAtIndex:); - } else if (numberOfArguments == 4 && - [methodName - _KVC_isSetterForSelectorNameStartingWith: - @"replaceObjectIn" - endingWith: - @"AtIndex:" - @"withObject" - @":"]) { - kvoSelector = @selector - (KVO_notifying_change_replaceObjectInKeyAtIndex: - withObject:); } else if ( - numberOfArguments == 4 && - [methodName - _KVC_isSetterForSelectorNameStartingWith: @"insert" - endingWith: - @":atIndexes:"]) { + numberOfArguments == 3 && + [methodName + _KVC_isSetterForSelectorNameStartingWith: + @"removeObjectFrom" + endingWith: + @"AtIndex" + @":"]) { + kvoSelector = @selector + (KVO_notifying_change_removeObjectFromKeyAtIndex:); + } else if ( + numberOfArguments == 4 && + [methodName + _KVC_isSetterForSelectorNameStartingWith: + @"replaceObjectIn" + endingWith: + @"AtIndex" + @":" + @"withObj" + @"ect" + @":"]) { + kvoSelector = @selector + (KVO_notifying_change_replaceObjectInKeyAtIndex: + withObject:); + } else if ( + numberOfArguments == 4 && + [methodName + _KVC_isSetterForSelectorNameStartingWith: + @"insert" + endingWith: + @":atInde" + @"xes" + @":"]) { kvoSelector = @selector(KVO_notifying_change_insertKey: atIndexes:); } else if ( - numberOfArguments == 3 && - [methodName - _KVC_isSetterForSelectorNameStartingWith: @"remove" - endingWith: - @"AtIndexes:"]) { + numberOfArguments == 3 && + [methodName + _KVC_isSetterForSelectorNameStartingWith: + @"remove" + endingWith: + @"AtIndex" + @"es:"]) { kvoSelector = - @selector(KVO_notifying_change_removeKeyAtIndexes:); + @selector(KVO_notifying_change_removeKeyAtIndexes:); } else if ( - numberOfArguments == 3 && - [methodName - _KVC_isSetterForSelectorNameStartingWith: @"remove" - endingWith: @"Object:"]) { + numberOfArguments == 3 && + [methodName + _KVC_isSetterForSelectorNameStartingWith: + @"remove" + endingWith: + @"Object" + @":"]) { kvoSelector = - @selector(KVO_notifying_change_removeKeyObject:); - } else if (numberOfArguments == 3 && - [methodName - _KVC_isSetterForSelectorNameStartingWith: @"add" - endingWith: - @"Object:"]) { + @selector(KVO_notifying_change_removeKeyObject:); + } else if ( + numberOfArguments == 3 && + [methodName + _KVC_isSetterForSelectorNameStartingWith: @"add" + endingWith: + @"Object" + @":"]) { kvoSelector = @selector(KVO_notifying_change_addKeyObject:); #if 0 // Disabled - this is wrong - this is expecting any addXXX: removeXXX: methods to play with NSSet @@ -1370,7 +1385,7 @@ or primitive signed type matching unsigned type kvoSelector = @selector(KVO_notifying_change_setObject:forKey:); } else if (strcmp(methodCString, "removeObjectForKey:") == 0) { kvoSelector = - @selector(KVO_notifying_change_removeObjectForKey:); + @selector(KVO_notifying_change_removeObjectForKey:); } // there's a suitable selector for us diff --git a/Foundation/NSKeyValueCoding/NSString+KVCAdditions.m b/Foundation/NSKeyValueCoding/NSString+KVCAdditions.m index b924322b..65160070 100644 --- a/Foundation/NSKeyValueCoding/NSString+KVCAdditions.m +++ b/Foundation/NSKeyValueCoding/NSString+KVCAdditions.m @@ -26,10 +26,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ endingWith: (NSString *) end; { if ([self hasPrefix: start] && [self hasSuffix: end]) { - NSString *keyName = - [self substringWithRange: NSMakeRange([start length], - [self length] - [end length] - - [start length])]; + NSString *keyName = [self + substringWithRange: NSMakeRange([start length], + [self length] - [end length] - + [start length])]; if (![keyName length]) return NO; diff --git a/Foundation/NSKeyedArchiving/NSKeyedArchiver.h b/Foundation/NSKeyedArchiving/NSKeyedArchiver.h index c418ea96..280b97b1 100644 --- a/Foundation/NSKeyedArchiving/NSKeyedArchiver.h +++ b/Foundation/NSKeyedArchiving/NSKeyedArchiver.h @@ -70,8 +70,8 @@ FOUNDATION_EXPORT NSString *const NSInvalidArchiveOperationException; @interface NSObject (NSKeyedArchiverDelegate) - (void) archiver: (NSKeyedArchiver *) archiver - willReplaceObject: object - withObject: other; + willReplaceObject: object + withObject: other; - (void) archiver: (NSKeyedArchiver *) archiver willEncodeObject: object; - (void) archiver: (NSKeyedArchiver *) archiver didEncodeObject: object; - (void) archiverWllFinish: (NSKeyedArchiver *) archiver; diff --git a/Foundation/NSKeyedArchiving/NSKeyedArchiver.m b/Foundation/NSKeyedArchiving/NSKeyedArchiver.m index ba223aea..258747ce 100644 --- a/Foundation/NSKeyedArchiving/NSKeyedArchiver.m +++ b/Foundation/NSKeyedArchiving/NSKeyedArchiver.m @@ -31,15 +31,16 @@ static NSMapTable *_globalNameToClass = NULL; + (void) initialize { if (self == [NSKeyedArchiver class]) { - _globalNameToClass = NSCreateMapTable( - NSNonRetainedObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 0); + _globalNameToClass = + NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks, + NSObjectMapValueCallBacks, 0); } } + (NSData *) archivedDataWithRootObject: rootObject { NSMutableData *data = [NSMutableData data]; NSKeyedArchiver *archiver = - [[[self class] alloc] initForWritingWithMutableData: data]; + [[[self class] alloc] initForWritingWithMutableData: data]; [archiver encodeObject: rootObject forKey: @"root"]; [archiver finishEncoding]; @@ -75,7 +76,7 @@ static NSMapTable *_globalNameToClass = NULL; _pass = 0; NSMapTableKeyCallBacks objectToUidKeyCb = - NSNonRetainedObjectMapKeyCallBacks; + NSNonRetainedObjectMapKeyCallBacks; objectToUidKeyCb.isEqual = NULL; // setting the equality callback to NULL means that the maptable will use // pointer comparison. this is necessary to properly archive classes like @@ -84,7 +85,7 @@ static NSMapTable *_globalNameToClass = NULL; // all without this change) _objectToUid = - NSCreateMapTable(objectToUidKeyCb, NSObjectMapValueCallBacks, 0); + NSCreateMapTable(objectToUidKeyCb, NSObjectMapValueCallBacks, 0); _outputFormat = NSPropertyListXMLFormat_v1_0; return self; @@ -216,8 +217,8 @@ static NSMapTable *_globalNameToClass = NULL; NSMutableString *str = [NSMutableString stringWithString: @"{"]; NSUInteger i; for (i = 0; i < count; i++) { - [str - appendFormat: @"%.12f%@", array[i], (i < count - 1) ? @", " : @"}"]; + [str appendFormat: @"%.12f%@", array[i], + (i < count - 1) ? @", " : @"}"]; } [self encodeObject: [NSString stringWithString: str] forKey: key]; @@ -256,7 +257,8 @@ static NSMapTable *_globalNameToClass = NULL; if ([archClass isEqualToString: @"NSString"]) { [_objects - addObject: [NSString stringWithString: [object description]]]; + addObject: [NSString + stringWithString: [object description]]]; } else if ([archClass isEqualToString: @"NSNumber"]) { [_objects addObject: object]; } else if ([archClass isEqualToString: @"NSData"]) { @@ -280,8 +282,9 @@ static NSMapTable *_globalNameToClass = NULL; } NSDictionary *classMap = [NSDictionary - dictionaryWithObjectsAndKeys: supers, @"$classes", archClass, - @"$classname", nil]; + dictionaryWithObjectsAndKeys: supers, @"$classes", + archClass, @"$classname", + nil]; [supers release]; @@ -339,9 +342,9 @@ static NSMapTable *_globalNameToClass = NULL; - (void) finishEncoding { NSData *newData = [NSPropertyListSerialization - dataFromPropertyList: [_plistStack lastObject] - format: _outputFormat - errorDescription: NULL]; + dataFromPropertyList: [_plistStack lastObject] + format: _outputFormat + errorDescription: NULL]; [_data appendData: newData]; } diff --git a/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.h b/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.h index 307b5026..84461d0b 100644 --- a/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.h +++ b/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.h @@ -70,9 +70,9 @@ FOUNDATION_EXPORT NSString *NSInvalidUnarchiveOperationException; @interface NSObject (NSKeyedUnarchiverDelegate) - unarchiver: (NSKeyedUnarchiver *) unarchiver didDecodeObject: object; - (void) unarchiver: (NSKeyedUnarchiver *) unarchiver - willReplaceObject: object - withObject: replacement; + willReplaceObject: object + withObject: replacement; - (Class) unarchiver: (NSKeyedUnarchiver *) unarchiver - cannotDecodeObjectOfClassName: (NSString *) className - originalClasses: (NSArray *) classHierarchy; + cannotDecodeObjectOfClassName: (NSString *) className + originalClasses: (NSArray *) classHierarchy; @end diff --git a/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.m b/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.m index 05414c79..0f8a29c9 100644 --- a/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.m +++ b/Foundation/NSKeyedArchiving/NSKeyedUnarchiver.m @@ -32,7 +32,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *NSInvalidUnarchiveOperationException = - @"NSInvalidUnarchiveOperationException"; + @"NSInvalidUnarchiveOperationException"; @interface NSObject (NSKeyedUnarchiverPrivate) + (id) allocWithKeyedUnarchiver: (NSKeyedUnarchiver *) keyed; @@ -58,8 +58,8 @@ NSString *NSInvalidUnarchiveOperationException = NSNonOwnedPointerMapValueCallBacks, 0); _objectToUid = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSIntMapValueCallBacks, 0); - _classVersions = - NSCreateMapTable(NSObjectMapKeyCallBacks, NSIntMapValueCallBacks, 0); + _classVersions = NSCreateMapTable(NSObjectMapKeyCallBacks, + NSIntMapValueCallBacks, 0); return self; } @@ -139,7 +139,7 @@ static inline int integerFromCFUID(id object) { result = [result awakeAfterUsingCoder: self]; [result autorelease]; if ([_delegate respondsToSelector: @selector(unarchiver: - didDecodeObject:)]) + didDecodeObject:)]) result = [_delegate unarchiver: self didDecodeObject: result]; NSMapInsert(_uidToObject, (void *) uidIntValue, result); NSMapInsert(_objectToUid, result, (void *) uidIntValue); @@ -175,7 +175,7 @@ static inline int integerFromCFUID(id object) { + unarchiveObjectWithData: (NSData *) data { NSKeyedUnarchiver *unarchiver = - [[[self alloc] initForReadingWithData: data] autorelease]; + [[[self alloc] initForReadingWithData: data] autorelease]; return [unarchiver decodeRootObject]; } @@ -385,7 +385,7 @@ static inline NSNumber *_numberForKey(NSKeyedUnarchiver *self, NSString *key) { case expectingFraction: if (code >= '0' && code <= '9') { result[resultLength] = - result[resultLength] + multiplier * (code - '0'); + result[resultLength] + multiplier * (code - '0'); multiplier /= 10; } else if (code == 'e' || code == 'E') { state = expectingExponent; @@ -414,13 +414,13 @@ static inline NSNumber *_numberForKey(NSKeyedUnarchiver *self, NSString *key) { exponent = exponent * 10 + (code - '0'); else if (code == ',') { result[resultLength++] *= - sign * powf(10.0f, expsign * exponent); + sign * powf(10.0f, expsign * exponent); sign = expsign = 1; exponent = 0; state = expectingSpaceOrInteger; } else if (code == '}') { result[resultLength++] *= - sign * powf(10.0f, expsign * exponent); + sign * powf(10.0f, expsign * exponent); sign = expsign = 1; exponent = 0; state = expectingCommaBraceOrSpace; @@ -633,8 +633,8 @@ static inline NSNumber *_numberForKey(NSKeyedUnarchiver *self, NSString *key) { if ([_delegate respondsToSelector: @selector (unarchiver:willReplaceObject:withObject:)]) { [_delegate unarchiver: self - willReplaceObject: object - withObject: replacement]; + willReplaceObject: object + withObject: replacement]; } NSMapInsert(_uidToObject, (void *) uid, replacement); diff --git a/Foundation/NSLocale.m b/Foundation/NSLocale.m index 2bf2b346..e94c2e4c 100644 --- a/Foundation/NSLocale.m +++ b/Foundation/NSLocale.m @@ -42,7 +42,7 @@ NSString *const NSLocaleExemplarCharacterSet = @"NSLocaleExemplarCharacterSet"; NSString *const NSLocaleCollationIdentifier = @"NSLocaleCollationIdentifier"; NSString *const NSCurrentLocaleDidChangeNotification = - @"NSCurrentLocaleDidChangeNotification"; + @"NSCurrentLocaleDidChangeNotification"; BOOL NSCurrentLocaleIsMetric(); @@ -58,7 +58,7 @@ static NSLocale *_sharedCurrentLocale = nil; + systemLocale { if (_sharedSystemLocale == nil) _sharedSystemLocale = - [[NSLocale alloc] initWithLocaleIdentifier: @"en_US"]; + [[NSLocale alloc] initWithLocaleIdentifier: @"en_US"]; return _sharedSystemLocale; } @@ -67,14 +67,14 @@ static NSLocale *_sharedCurrentLocale = nil; NSString *localeIdentifier; if ([self respondsToSelector: @selector - (_platformCurrentLocaleIdentifier)]) - localeIdentifier = [self - performSelector: @selector(_platformCurrentLocaleIdentifier)]; + (_platformCurrentLocaleIdentifier)]) + localeIdentifier = [self performSelector: @selector + (_platformCurrentLocaleIdentifier)]; else localeIdentifier = @"en_US"; _sharedCurrentLocale = - [[NSLocale alloc] initWithLocaleIdentifier: localeIdentifier]; + [[NSLocale alloc] initWithLocaleIdentifier: localeIdentifier]; } return _sharedCurrentLocale; } @@ -101,14 +101,14 @@ static NSLocale *_sharedCurrentLocale = nil; + (NSDictionary *) componentsFromLocaleIdentifier: (NSString *) identifier { if ([identifier - isEqualToString: [[NSLocale currentLocale] localeIdentifier]]) + isEqualToString: [[NSLocale currentLocale] localeIdentifier]]) return [_sharedCurrentLocale _locale]; - else if ([identifier - isEqualToString: [[NSLocale systemLocale] localeIdentifier]]) + else if ([identifier isEqualToString: [[NSLocale systemLocale] + localeIdentifier]]) return [_sharedSystemLocale _locale]; else return [[[[NSLocale alloc] initWithLocaleIdentifier: identifier] - autorelease] _locale]; + autorelease] _locale]; return 0; } @@ -155,18 +155,18 @@ static NSLocale *_sharedCurrentLocale = nil; } NSMutableDictionary *localeInfo = [NSMutableDictionary - dictionaryWithObjectsAndKeys: identifier, NSLocaleIdentifier, language, - NSLocaleLanguageCode, country, - NSLocaleCountryCode, nil]; + dictionaryWithObjectsAndKeys: identifier, NSLocaleIdentifier, + language, NSLocaleLanguageCode, + country, NSLocaleCountryCode, nil]; if ([[self class] respondsToSelector: @selector (_platformLocaleAdditionalDescriptionForIdentifier:)]) { // Use any platform specific method to fill the locale info if one is // defined - NSDictionary *info = - [[self class] performSelector: @selector - (_platformLocaleAdditionalDescriptionForIdentifier:) - withObject: identifier]; + NSDictionary *info = [[self class] + performSelector: @selector + (_platformLocaleAdditionalDescriptionForIdentifier:) + withObject: identifier]; [localeInfo addEntriesFromDictionary: info]; } else { // Else use setlocale & localeconv to try to get some locale info @@ -179,21 +179,21 @@ static NSLocale *_sharedCurrentLocale = nil; // FIXME: This is wrong in that it is using the current locales value, // not the identified one NSNumber *usesMetric = - [NSNumber numberWithBool: NSCurrentLocaleIsMetric()]; + [NSNumber numberWithBool: NSCurrentLocaleIsMetric()]; [localeInfo - setObject: [NSString stringWithUTF8String: conv->decimal_point] - forKey: NSLocaleDecimalSeparator]; - [localeInfo - setObject: [NSString stringWithUTF8String: conv->currency_symbol] - forKey: NSLocaleCurrencySymbol]; + setObject: [NSString stringWithUTF8String: conv->decimal_point] + forKey: NSLocaleDecimalSeparator]; + [localeInfo setObject: [NSString stringWithUTF8String: conv-> + currency_symbol] + forKey: NSLocaleCurrencySymbol]; [localeInfo setObject: usesMetric forKey: NSLocaleUsesMetricSystem]; // Restore the initial locale setlocale(LC_ALL, currentLocale); } _locale = - [[NSDictionary allocWithZone: NULL] initWithDictionary: localeInfo]; + [[NSDictionary allocWithZone: NULL] initWithDictionary: localeInfo]; return self; } @@ -225,7 +225,7 @@ static NSLocale *_sharedCurrentLocale = nil; } - (NSString *) description { - return - [NSString stringWithFormat: @"<%@:%p %@>", [self class], self, _locale]; + return [NSString + stringWithFormat: @"<%@:%p %@>", [self class], self, _locale]; } @end diff --git a/Foundation/NSLock/NSConditionLock.m b/Foundation/NSLock/NSConditionLock.m index a8ef4492..57599612 100644 --- a/Foundation/NSLock/NSConditionLock.m +++ b/Foundation/NSLock/NSConditionLock.m @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + allocWithZone: (NSZone *) zone { if (self == [NSConditionLock class]) return NSAllocateObject( - [[NSPlatform currentPlatform] conditionLockClass], 0, zone); + [[NSPlatform currentPlatform] conditionLockClass], 0, zone); else return NSAllocateObject(self, 0, zone); } diff --git a/Foundation/NSLock/NSRecursiveLock.m b/Foundation/NSLock/NSRecursiveLock.m index 227a4d10..fc8da368 100644 --- a/Foundation/NSLock/NSRecursiveLock.m +++ b/Foundation/NSLock/NSRecursiveLock.m @@ -28,7 +28,7 @@ + allocWithZone: (NSZone *) zone { if (self == [NSRecursiveLock class]) return NSAllocateObject( - [[NSPlatform currentPlatform] recursiveLockClass], 0, zone); + [[NSPlatform currentPlatform] recursiveLockClass], 0, zone); else return NSAllocateObject(self, 0, zone); } diff --git a/Foundation/NSMapTable.h b/Foundation/NSMapTable.h index 233d55fe..19154a35 100644 --- a/Foundation/NSMapTable.h +++ b/Foundation/NSMapTable.h @@ -82,18 +82,18 @@ FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSIntegerMapKeyCallBacks; FOUNDATION_EXPORT const NSMapTableValueCallBacks NSIntegerMapValueCallBacks; FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSNonOwnedPointerMapKeyCallBacks; FOUNDATION_EXPORT const NSMapTableValueCallBacks - NSNonOwnedPointerMapValueCallBacks; + NSNonOwnedPointerMapValueCallBacks; FOUNDATION_EXPORT const NSMapTableKeyCallBacks - NSNonOwnedPointerOrNullMapKeyCallBacks; + NSNonOwnedPointerOrNullMapKeyCallBacks; FOUNDATION_EXPORT const NSMapTableKeyCallBacks - NSNonRetainedObjectMapKeyCallBacks; + NSNonRetainedObjectMapKeyCallBacks; FOUNDATION_EXPORT const NSMapTableValueCallBacks - NSNonRetainedObjectMapValueCallBacks; + NSNonRetainedObjectMapValueCallBacks; FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSObjectMapKeyCallBacks; FOUNDATION_EXPORT const NSMapTableValueCallBacks NSObjectMapValueCallBacks; FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSOwnedPointerMapKeyCallBacks; FOUNDATION_EXPORT const NSMapTableValueCallBacks - NSOwnedPointerMapValueCallBacks; + NSOwnedPointerMapValueCallBacks; FOUNDATION_EXPORT NSMapTable * NSCreateMapTable(NSMapTableKeyCallBacks keyCallBacks, diff --git a/Foundation/NSMapTable.m b/Foundation/NSMapTable.m index 1b9468f3..75854bc0 100644 --- a/Foundation/NSMapTable.m +++ b/Foundation/NSMapTable.m @@ -92,32 +92,33 @@ const NSMapTableKeyCallBacks NSIntegerMapKeyCallBacks = {NULL, NULL, NULL, NULL, const NSMapTableValueCallBacks NSIntegerMapValueCallBacks = {NULL, NULL, NULL}; const NSMapTableKeyCallBacks NSNonOwnedPointerMapKeyCallBacks = { - NULL, NULL, NULL, NULL, NULL}; + NULL, NULL, NULL, NULL, NULL}; const NSMapTableValueCallBacks NSNonOwnedPointerMapValueCallBacks = {NULL, NULL, NULL}; const NSMapTableKeyCallBacks NSNonOwnedPointerOrNullMapKeyCallBacks = { - NULL, NULL, NULL, NULL, NULL}; + NULL, NULL, NULL, NULL, NULL}; const NSMapTableKeyCallBacks NSNonRetainedObjectMapKeyCallBacks = { - _NSMapObjectHash, _NSMapObjectIsEqual, NULL, NULL, _NSMapObjectDescribe}; + _NSMapObjectHash, _NSMapObjectIsEqual, NULL, NULL, + _NSMapObjectDescribe}; const NSMapTableValueCallBacks NSNonRetainedObjectMapValueCallBacks = { - NULL, NULL, _NSMapObjectDescribe}; + NULL, NULL, _NSMapObjectDescribe}; const NSMapTableKeyCallBacks NSObjectMapKeyCallBacks = { - _NSMapObjectHash, _NSMapObjectIsEqual, _NSMapObjectRetain, - _NSMapObjectRelease, _NSMapObjectDescribe}; + _NSMapObjectHash, _NSMapObjectIsEqual, _NSMapObjectRetain, + _NSMapObjectRelease, _NSMapObjectDescribe}; const NSMapTableValueCallBacks NSObjectMapValueCallBacks = { - _NSMapObjectRetain, _NSMapObjectRelease, _NSMapObjectDescribe}; + _NSMapObjectRetain, _NSMapObjectRelease, _NSMapObjectDescribe}; const NSMapTableKeyCallBacks NSOwnedPointerMapKeyCallBacks = { - NULL, NULL, NULL, _NSMapPointerRelease, NULL}; + NULL, NULL, NULL, _NSMapPointerRelease, NULL}; const NSMapTableValueCallBacks NSOwnedPointerMapValueCallBacks = { - NULL, _NSMapPointerRelease, NULL}; + NULL, _NSMapPointerRelease, NULL}; NSMapTable *NSCreateMapTable(NSMapTableKeyCallBacks keyCallBacks, NSMapTableValueCallBacks valueCallBacks, @@ -137,30 +138,31 @@ NSMapTable *NSCreateMapTableWithZone(NSMapTableKeyCallBacks keyCallBacks, table->keyCallBacks = NSZoneMalloc(zone, sizeof(NSMapTableKeyCallBacks)); table->keyCallBacks->hash = - (keyCallBacks.hash != NULL) ? keyCallBacks.hash : _NSMapPointerHash; + (keyCallBacks.hash != NULL) ? keyCallBacks.hash : _NSMapPointerHash; table->keyCallBacks->isEqual = (keyCallBacks.isEqual != NULL) - ? keyCallBacks.isEqual - : _NSMapPointerIsEqual; - table->keyCallBacks->retain = - (keyCallBacks.retain != NULL) ? keyCallBacks.retain : _NSMapEmptyRetain; + ? keyCallBacks.isEqual + : _NSMapPointerIsEqual; + table->keyCallBacks->retain = (keyCallBacks.retain != NULL) + ? keyCallBacks.retain + : _NSMapEmptyRetain; table->keyCallBacks->release = (keyCallBacks.release != NULL) - ? keyCallBacks.release - : _NSMapEmptyRelease; + ? keyCallBacks.release + : _NSMapEmptyRelease; table->keyCallBacks->describe = (keyCallBacks.describe != NULL) - ? keyCallBacks.describe - : _NSMapEmptyDescribe; + ? keyCallBacks.describe + : _NSMapEmptyDescribe; table->valueCallBacks = - NSZoneMalloc(zone, sizeof(NSMapTableValueCallBacks)); + NSZoneMalloc(zone, sizeof(NSMapTableValueCallBacks)); table->valueCallBacks->retain = (valueCallBacks.retain != NULL) - ? valueCallBacks.retain - : _NSMapEmptyRetain; + ? valueCallBacks.retain + : _NSMapEmptyRetain; table->valueCallBacks->release = (valueCallBacks.release != NULL) - ? valueCallBacks.release - : _NSMapEmptyRelease; + ? valueCallBacks.release + : _NSMapEmptyRelease; table->valueCallBacks->describe = (valueCallBacks.describe != NULL) - ? valueCallBacks.describe - : _NSMapEmptyDescribe; + ? valueCallBacks.describe + : _NSMapEmptyDescribe; table->count = 0; table->nBuckets = (capacity < 4) ? 4 : capacity; @@ -170,8 +172,9 @@ NSMapTable *NSCreateMapTableWithZone(NSMapTableKeyCallBacks keyCallBacks, } NSMapTable *NSCopyMapTableWithZone(NSMapTable *table, NSZone *zone) { - NSMapTable *newTable = NSCreateMapTableWithZone( - *(table->keyCallBacks), *(table->valueCallBacks), table->count, zone); + NSMapTable *newTable = NSCreateMapTableWithZone(*(table->keyCallBacks), + *(table->valueCallBacks), + table->count, zone); NSMapEnumerator state = NSEnumerateMapTable(table); void *key, *val; @@ -301,7 +304,7 @@ NSArray *NSAllMapTableKeys(NSMapTable *table) { NSMapNode *j; array = [[[NSMutableArray allocWithZone: NULL] - initWithCapacity: table->count] autorelease]; + initWithCapacity: table->count] autorelease]; for (i = 0; i < table->nBuckets; i++) for (j = table->buckets[i]; j != NULL; j = j->next) @@ -316,7 +319,7 @@ NSArray *NSAllMapTableValues(NSMapTable *table) { NSMapNode *j; array = [[[NSMutableArray allocWithZone: NULL] - initWithCapacity: table->count] autorelease]; + initWithCapacity: table->count] autorelease]; for (i = 0; i < table->nBuckets; i++) for (j = table->buckets[i]; j != NULL; j = j->next) @@ -354,12 +357,12 @@ void NSMapInsert(NSMapTable *table, const void *key, const void *value) { table->nBuckets = nBuckets * 2; table->buckets = - NSZoneCalloc(zone, table->nBuckets, sizeof(NSMapNode *)); + NSZoneCalloc(zone, table->nBuckets, sizeof(NSMapNode *)); for (i = 0; i < nBuckets; i++) for (j = buckets[i]; j != NULL; j = next) { - NSUInteger newi = - table->keyCallBacks->hash(table, j->key) % table->nBuckets; + NSUInteger newi = table->keyCallBacks->hash(table, j->key) % + table->nBuckets; next = j->next; j->next = table->buckets[newi]; @@ -453,9 +456,9 @@ NSString *NSStringFromMapTable(NSMapTable *table) { } + mapTableWithStrongToWeakObjects { - return - [NSCreateMapTable(NSObjectMapKeyCallBacks, - NSNonRetainedObjectMapValueCallBacks, 0) autorelease]; + return [NSCreateMapTable(NSObjectMapKeyCallBacks, + NSNonRetainedObjectMapValueCallBacks, 0) + autorelease]; } + mapTableWithWeakToStrongObjects { @@ -464,9 +467,9 @@ NSString *NSStringFromMapTable(NSMapTable *table) { } + mapTableWithWeakToWeakObjects { - return - [NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks, - NSNonRetainedObjectMapValueCallBacks, 0) autorelease]; + return [NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks, + NSNonRetainedObjectMapValueCallBacks, 0) + autorelease]; } + strongToStrongObjectsMapTable { diff --git a/Foundation/NSMethodSignature.m b/Foundation/NSMethodSignature.m index 27ff41fa..a820dc3d 100644 --- a/Foundation/NSMethodSignature.m +++ b/Foundation/NSMethodSignature.m @@ -99,7 +99,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSMethodSignature *) signatureWithObjCTypes: (const char *) typesCString { return [[[NSMethodSignature allocWithZone: NULL] - initWithTypes: typesCString] autorelease]; + initWithTypes: typesCString] autorelease]; } - (NSString *) description { @@ -138,8 +138,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSUInteger promotedSize; NSGetSizeAndAlignment(_types[i], &naturalSize, &align); - promotedSize = - ((naturalSize + sizeof(long) - 1) / sizeof(long)) * sizeof(long); + promotedSize = ((naturalSize + sizeof(long) - 1) / sizeof(long)) * + sizeof(long); result += promotedSize; } diff --git a/Foundation/NSNetService/NSNetServices.h b/Foundation/NSNetService/NSNetServices.h index 6bd886d6..2bf6d11e 100644 --- a/Foundation/NSNetService/NSNetServices.h +++ b/Foundation/NSNetService/NSNetServices.h @@ -25,7 +25,7 @@ #import @class NSInputStream, NSOutputStream, NSRunLoop, NSSelectInputSource, NSTimer, - NSMutableDictionary; + NSMutableDictionary; typedef enum { NSNetServicesUnknownError = -72000L, @@ -122,14 +122,14 @@ FOUNDATION_EXPORT NSString *const NSNetServicesErrorDomain; - (void) netServiceWillPublish: (NSNetService *) sender; - (void) netServiceDidPublish: (NSNetService *) sender; - (void) netService: (NSNetService *) sender - didNotPublish: (NSDictionary *) errorDict; + didNotPublish: (NSDictionary *) errorDict; - (void) netServiceWillResolve: (NSNetService *) sender; - (void) netServiceDidResolveAddress: (NSNetService *) sender; - (void) netService: (NSNetService *) sender - didNotResolve: (NSDictionary *) errorDict; + didNotResolve: (NSDictionary *) errorDict; - (void) netServiceDidStop: (NSNetService *) sender; - (void) netService: (NSNetService *) sender - didUpdateTXTRecordData: (NSData *) data; + didUpdateTXTRecordData: (NSData *) data; @end @@ -138,7 +138,7 @@ FOUNDATION_EXPORT NSString *const NSNetServicesErrorDomain; @end @class NSRunLoop, NSDictionary, NSNetService, NSSelectInputSource, - NSMutableDictionary; + NSMutableDictionary; @interface NSNetServiceBrowser : NSObject { @private @@ -178,7 +178,7 @@ FOUNDATION_EXPORT NSString *const NSNetServicesErrorDomain; - (void) netServiceBrowser: (NSNetServiceBrowser *) netServiceBrowser didNotSearch: (NSDictionary *) errorDict; - (void) netServiceBrowserDidStopSearch: - (NSNetServiceBrowser *) netServiceBrowser; + (NSNetServiceBrowser *) netServiceBrowser; - (void) netServiceBrowser: (NSNetServiceBrowser *) netServiceBrowser didFindDomain: (NSString *) domainString moreComing: (BOOL) moreComing; diff --git a/Foundation/NSNetService/NSNetServices.m b/Foundation/NSNetService/NSNetServices.m index e0740469..6e8c224a 100644 --- a/Foundation/NSNetService/NSNetServices.m +++ b/Foundation/NSNetService/NSNetServices.m @@ -88,13 +88,13 @@ NSString *const NSNetServicesErrorDomain = @"NSNetServicesErrorDomain"; - (void) _didUpdateTXTRecordData: (NSData *) data { if ([_delegate respondsToSelector: @selector(netService: - didUpdateTXTRecordData:)]) + didUpdateTXTRecordData:)]) [_delegate netService: self didUpdateTXTRecordData: data]; } - (void) beginAsynchronousNetService { NSSocket *socket = [[NSSocket alloc] - initWithFileDescriptor: bonjour_DNSServiceRefSockFD(_netService)]; + initWithFileDescriptor: bonjour_DNSServiceRefSockFD(_netService)]; _inputSource = [[NSSelectInputSource alloc] initWithSocket: socket]; [socket release]; @@ -128,9 +128,9 @@ NSString *const NSNetServicesErrorDomain = @"NSNetServicesErrorDomain"; } - (void) addAddress: (const void *) rdata - length: (uint16_t) rdlen - type: (uint16_t) rrtype - interfaceIndex: (uint32_t) interface + length: (uint16_t) rdlen + type: (uint16_t) rrtype + interfaceIndex: (uint32_t) interface { NSData *data = nil; @@ -138,13 +138,13 @@ NSString *const NSNetServicesErrorDomain = @"NSNetServicesErrorDomain"; case bonjour_kDNSServiceType_A: // ipv4 data = NSSocketAddressDataForNetworkOrderAddressBytesAndPort( - rdata, 4, htons(_port), interface); + rdata, 4, htons(_port), interface); break; case bonjour_kDNSServiceType_AAAA: // ipv6 case bonjour_kDNSServiceType_A6: // deprecates AAAA data = NSSocketAddressDataForNetworkOrderAddressBytesAndPort( - rdata, 16, htons(_port), interface); + rdata, 16, htons(_port), interface); break; } @@ -175,9 +175,9 @@ NSString *const NSNetServicesErrorDomain = @"NSNetServicesErrorDomain"; case bonjour_kDNSServiceType_A: // 1 -- AF_INET [self addAddress: rdata - length: rdlen - type: rrtype - interfaceIndex: interfaceIndex]; + length: rdlen + type: rrtype + interfaceIndex: interfaceIndex]; break; case bonjour_kDNSServiceType_NS: @@ -220,9 +220,9 @@ NSString *const NSNetServicesErrorDomain = @"NSNetServicesErrorDomain"; case bonjour_kDNSServiceType_AAAA: // 28 -- AF_INET6 [self addAddress: rdata - length: rdlen - type: rrtype - interfaceIndex: interfaceIndex]; + length: rdlen + type: rrtype + interfaceIndex: interfaceIndex]; break; case bonjour_kDNSServiceType_LOC: @@ -239,9 +239,9 @@ NSString *const NSNetServicesErrorDomain = @"NSNetServicesErrorDomain"; case bonjour_kDNSServiceType_A6: // 38 -- AF_INET6, deprecates AAAA [self addAddress: rdata - length: rdlen - type: rrtype - interfaceIndex: interfaceIndex]; + length: rdlen + type: rrtype + interfaceIndex: interfaceIndex]; break; case bonjour_kDNSServiceType_DNAME: @@ -281,7 +281,7 @@ NSString *const NSNetServicesErrorDomain = @"NSNetServicesErrorDomain"; [self _didResolveAddress]; else [self _didNotResolve: bonjour_CreateError( - self, NSNetServicesNotFoundError)]; + self, NSNetServicesNotFoundError)]; } } @@ -344,9 +344,9 @@ QueryCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, // Prepare query for A and/or AAAA record errorCode = bonjour_DNSServiceQueryRecord( - &_netService, 0, _interfaceIndex, [_host UTF8String], - bonjour_kDNSServiceType_ANY, bonjour_kDNSServiceClass_IN, QueryCallback, - self); + &_netService, 0, _interfaceIndex, [_host UTF8String], + bonjour_kDNSServiceType_ANY, bonjour_kDNSServiceClass_IN, + QueryCallback, self); if (bonjour_kDNSServiceErr_NoError != errorCode) { [self _invalidateNetService]; @@ -411,7 +411,7 @@ RegistrationCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, if (selectEvent & NSSelectReadEvent) { bonjour_DNSServiceErrorType err = - bonjour_DNSServiceProcessResult(_netService); + bonjour_DNSServiceProcessResult(_netService); if (err != bonjour_kDNSServiceErr_NoError) { if (_isPublishing) @@ -496,7 +496,8 @@ RegistrationCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, } NSData *result = - (i < count) ? nil + (i < count) + ? nil : [NSData dataWithBytes: bonjour_TXTRecordGetBytesPtr(&txt) length: bonjour_TXTRecordGetLength(&txt)]; @@ -531,11 +532,11 @@ RegistrationCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, uint8_t valLen = 0; const void *value = NULL; bonjour_DNSServiceErrorType err = - bonjour_kDNSServiceErr_NoError; + bonjour_kDNSServiceErr_NoError; err = bonjour_TXTRecordGetItemAtIndex( - len, txt, i, sizeof keyCString, keyCString, &valLen, - &value); + len, txt, i, sizeof keyCString, keyCString, &valLen, + &value); // only if we can get the keyCString and value... if (bonjour_kDNSServiceErr_NoError == err) { @@ -655,9 +656,9 @@ RegistrationCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, } err = bonjour_DNSServiceRegister( - &_netService, flags, _interfaceIndex, [_name UTF8String], - [_type UTF8String], [_domain UTF8String], NULL, htons(_port), 0, - NULL, RegistrationCallback, self); + &_netService, flags, _interfaceIndex, [_name UTF8String], + [_type UTF8String], [_domain UTF8String], NULL, htons(_port), 0, + NULL, RegistrationCallback, self); } if (err != bonjour_kDNSServiceErr_NoError) { @@ -698,17 +699,18 @@ RegistrationCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, _resolverTimeout = nil; } - err = bonjour_DNSServiceResolve( - &_netService, flags, _interfaceIndex, [_name UTF8String], - [_type UTF8String], [_domain UTF8String], ResolverCallback, self); + err = bonjour_DNSServiceResolve(&_netService, flags, _interfaceIndex, + [_name UTF8String], [_type UTF8String], + [_domain UTF8String], ResolverCallback, + self); if (err == bonjour_kDNSServiceErr_NoError) { _resolverTimeout = [[NSTimer - scheduledTimerWithTimeInterval: timeout - target: self - selector: @selector(stopResolving:) - userInfo: nil - repeats: NO] retain]; + scheduledTimerWithTimeInterval: timeout + target: self + selector: @selector(stopResolving:) + userInfo: nil + repeats: NO] retain]; } } @@ -742,18 +744,18 @@ RegistrationCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, err = NSNetServicesActivityInProgress; else { NSString *fullname = - [NSString stringWithFormat: @"%@.%@%@", [self name], [self type], - [self domain]]; + [NSString stringWithFormat: @"%@.%@%@", [self name], + [self type], [self domain]]; err = bonjour_DNSServiceQueryRecord( - &_netService, bonjour_kDNSServiceFlagsLongLivedQuery, 0, - [fullname UTF8String], bonjour_kDNSServiceType_TXT, - bonjour_kDNSServiceClass_IN, QueryCallback, self); + &_netService, bonjour_kDNSServiceFlagsLongLivedQuery, 0, + [fullname UTF8String], bonjour_kDNSServiceType_TXT, + bonjour_kDNSServiceClass_IN, QueryCallback, self); if (bonjour_kDNSServiceErr_NoError == err) { NSSocket *socket = [[NSSocket alloc] - initWithFileDescriptor: bonjour_DNSServiceRefSockFD( - _netService)]; + initWithFileDescriptor: bonjour_DNSServiceRefSockFD( + _netService)]; _inputSource = [[NSSelectInputSource alloc] initWithSocket: socket]; [socket release]; @@ -816,7 +818,7 @@ RegistrationCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, // I must admit, the following may not be entirely correct... NSDictionary *dictionary = - [NSNetService dictionaryFromTXTRecordData: [self TXTRecordData]]; + [NSNetService dictionaryFromTXTRecordData: [self TXTRecordData]]; if (dictionary) { NSEnumerator *keys = [dictionary keyEnumerator]; @@ -828,13 +830,14 @@ RegistrationCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, id value = [dictionary objectForKey: key]; if (value != [NSNull null]) { - [array - addObject: [NSString - stringWithFormat: - @"%@=%@", key, - [NSString - stringWithCString: [value bytes] - length: [value length]]]]; + [array addObject: + [NSString + stringWithFormat: + @"%@=%@", key, + [NSString + stringWithCString: + [value bytes] + length: [value length]]]]; } else if ([key length]) { [array addObject: [NSString stringWithFormat: @"%@", key]]; } @@ -853,19 +856,20 @@ RegistrationCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, if (count > 0) { NSMutableDictionary *dictionary = - [NSMutableDictionary dictionaryWithCapacity: count]; + [NSMutableDictionary dictionaryWithCapacity: count]; for (i = 0; i < count; i++) { - NSArray *parts = - [[array objectAtIndex: i] componentsSeparatedByString: @"="]; + NSArray *parts = [[array objectAtIndex: i] + componentsSeparatedByString: @"="]; - [dictionary setObject: [[parts objectAtIndex: 1] + [dictionary + setObject: [[parts objectAtIndex: 1] dataUsingEncoding: NSUTF8StringEncoding] - forKey: [parts objectAtIndex: 0]]; + forKey: [parts objectAtIndex: 0]]; } - [self setTXTRecordData: [NSNetService - dataFromTXTRecordDictionary: dictionary]]; + [self setTXTRecordData: + [NSNetService dataFromTXTRecordDictionary: dictionary]]; } } @@ -889,8 +893,8 @@ RegistrationCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, // Now update the record so others can pick it up err = bonjour_DNSServiceUpdateRecord( - _netService, NULL, 0, recordData ? [recordData length] : 0, - recordData ? [recordData bytes] : NULL, 0); + _netService, NULL, 0, recordData ? [recordData length] : 0, + recordData ? [recordData bytes] : NULL, 0); if (err) { result = NO; } @@ -1033,7 +1037,7 @@ BrowserCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, - (void) _didStopSearch { if ([_delegate - respondsToSelector: @selector(netServiceBrowserDidStopSearch:)]) + respondsToSelector: @selector(netServiceBrowserDidStopSearch:)]) [_delegate netServiceBrowserDidStopSearch: self]; } @@ -1083,8 +1087,8 @@ BrowserCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, if (bonjour_kDNSServiceErr_NoError == err) { [self _willSearch]; NSSocket *socket = [[NSSocket alloc] - initWithFileDescriptor: bonjour_DNSServiceRefSockFD( - _netServiceBrowser)]; + initWithFileDescriptor: bonjour_DNSServiceRefSockFD( + _netServiceBrowser)]; _inputSource = [[NSSelectInputSource alloc] initWithSocket: socket]; [socket release]; @@ -1202,7 +1206,7 @@ BrowserCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, if (selectEvent & NSSelectReadEvent) { bonjour_DNSServiceErrorType err = - bonjour_DNSServiceProcessResult(_netServiceBrowser); + bonjour_DNSServiceProcessResult(_netServiceBrowser); if (err != bonjour_kDNSServiceErr_NoError) { [self _didNotSearch: bonjour_CreateError(self, err)]; @@ -1246,9 +1250,10 @@ BrowserCallback(bonjour_DNSServiceRef sdRef, bonjour_DNSServiceFlags flags, else if (_inputSource) err = NSNetServicesActivityInProgress; else { - err = bonjour_DNSServiceBrowse( - &_netServiceBrowser, 0, _interfaceIndex, [serviceType UTF8String], - [domainName UTF8String], BrowserCallback, self); + err = bonjour_DNSServiceBrowse(&_netServiceBrowser, 0, _interfaceIndex, + [serviceType UTF8String], + [domainName UTF8String], BrowserCallback, + self); } [self executeWithError: err]; diff --git a/Foundation/NSNetService/bonjour.h b/Foundation/NSNetService/bonjour.h index 3ca41b85..5bee2fbe 100644 --- a/Foundation/NSNetService/bonjour.h +++ b/Foundation/NSNetService/bonjour.h @@ -19,32 +19,32 @@ typedef uint32_t bonjour_DNSServiceFlags; typedef int32_t bonjour_DNSServiceErrorType; typedef void(BONJOUR_CALL *bonjour_DNSServiceDomainEnumReply)( - bonjour_DNSServiceRef service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, bonjour_DNSServiceErrorType errorCode, - const char *replyDomain, void *context); + bonjour_DNSServiceRef service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, bonjour_DNSServiceErrorType errorCode, + const char *replyDomain, void *context); typedef void(BONJOUR_CALL *bonjour_DNSServiceRegisterReply)( - bonjour_DNSServiceRef service, bonjour_DNSServiceFlags flags, - bonjour_DNSServiceErrorType errorCode, const char *name, - const char *regtype, const char *domain, void *context); + bonjour_DNSServiceRef service, bonjour_DNSServiceFlags flags, + bonjour_DNSServiceErrorType errorCode, const char *name, + const char *regtype, const char *domain, void *context); typedef void(BONJOUR_CALL *bonjour_DNSServiceBrowseReply)( - bonjour_DNSServiceRef service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, bonjour_DNSServiceErrorType errorCode, - const char *serviceName, const char *regtype, const char *replyDomain, - void *context); + bonjour_DNSServiceRef service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, bonjour_DNSServiceErrorType errorCode, + const char *serviceName, const char *regtype, const char *replyDomain, + void *context); typedef void(BONJOUR_CALL *bonjour_DNSServiceRegisterRecordReply)( - bonjour_DNSServiceRef service, bonjour_DNSRecordRef RecordRef, - bonjour_DNSServiceFlags flags, bonjour_DNSServiceErrorType errorCode, - void *context); + bonjour_DNSServiceRef service, bonjour_DNSRecordRef RecordRef, + bonjour_DNSServiceFlags flags, bonjour_DNSServiceErrorType errorCode, + void *context); typedef void(BONJOUR_CALL *bonjour_DNSServiceQueryRecordReply)( - bonjour_DNSServiceRef DNSServiceRef, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, bonjour_DNSServiceErrorType errorCode, - const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, - const void *rdata, uint32_t ttl, void *context); + bonjour_DNSServiceRef DNSServiceRef, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, bonjour_DNSServiceErrorType errorCode, + const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, + const void *rdata, uint32_t ttl, void *context); typedef void(BONJOUR_CALL *bonjour_DNSServiceResolveReply)( - bonjour_DNSServiceRef service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, bonjour_DNSServiceErrorType errorCode, - const char *fullname, const char *hosttarget, uint16_t port, - uint16_t txtLen, const unsigned char *txtRecord, void *context); + bonjour_DNSServiceRef service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, bonjour_DNSServiceErrorType errorCode, + const char *fullname, const char *hosttarget, uint16_t port, + uint16_t txtLen, const unsigned char *txtRecord, void *context); enum { bonjour_kDNSServiceClass_IN = 1, @@ -149,15 +149,15 @@ bonjour_DNSServiceErrorType bonjour_DNSServiceProcessResult(bonjour_DNSServiceRef service); void bonjour_DNSServiceRefDeallocate(bonjour_DNSServiceRef service); bonjour_DNSServiceErrorType bonjour_DNSServiceEnumerateDomains( - bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, bonjour_DNSServiceDomainEnumReply callBack, - void *context); + bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, bonjour_DNSServiceDomainEnumReply callBack, + void *context); bonjour_DNSServiceErrorType bonjour_DNSServiceRegister( - bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, const char *name, const char *regtype, - const char *domain, const char *host, uint16_t port, uint16_t txtLen, - const void *txtRecord, bonjour_DNSServiceRegisterReply callBack, - void *context); + bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, const char *name, const char *regtype, + const char *domain, const char *host, uint16_t port, uint16_t txtLen, + const void *txtRecord, bonjour_DNSServiceRegisterReply callBack, + void *context); bonjour_DNSServiceErrorType bonjour_DNSServiceAddRecord(bonjour_DNSServiceRef service, bonjour_DNSRecordRef *RecordRef, @@ -178,22 +178,23 @@ bonjour_DNSServiceBrowse(bonjour_DNSServiceRef *service, const char *regtype, const char *domain, bonjour_DNSServiceBrowseReply callBack, void *context); bonjour_DNSServiceErrorType bonjour_DNSServiceResolve( - bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, const char *name, const char *regtype, - const char *domain, bonjour_DNSServiceResolveReply callBack, void *context); + bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, const char *name, const char *regtype, + const char *domain, bonjour_DNSServiceResolveReply callBack, + void *context); bonjour_DNSServiceErrorType bonjour_DNSServiceCreateConnection(bonjour_DNSServiceRef *service); bonjour_DNSServiceErrorType bonjour_DNSServiceRegisterRecord( - bonjour_DNSServiceRef service, bonjour_DNSRecordRef *RecordRef, - bonjour_DNSServiceFlags flags, uint32_t interfaceIndex, - const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, - const void *rdata, uint32_t ttl, - bonjour_DNSServiceRegisterRecordReply callBack, void *context); + bonjour_DNSServiceRef service, bonjour_DNSRecordRef *RecordRef, + bonjour_DNSServiceFlags flags, uint32_t interfaceIndex, + const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, + const void *rdata, uint32_t ttl, + bonjour_DNSServiceRegisterRecordReply callBack, void *context); bonjour_DNSServiceErrorType bonjour_DNSServiceQueryRecord( - bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, - uint16_t rrclass, bonjour_DNSServiceQueryRecordReply callBack, - void *context); + bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, + uint16_t rrclass, bonjour_DNSServiceQueryRecordReply callBack, + void *context); bonjour_DNSServiceErrorType bonjour_DNSServiceReconfirmRecord(bonjour_DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, diff --git a/Foundation/NSNetService/bonjour.m b/Foundation/NSNetService/bonjour.m index ff16fdfc..bb3c542c 100644 --- a/Foundation/NSNetService/bonjour.m +++ b/Foundation/NSNetService/bonjour.m @@ -48,7 +48,7 @@ static void *bonjour_function(const char *name) { int bonjour_DNSServiceRefSockFD(bonjour_DNSServiceRef service) { BONJOUR_CALL typeof(bonjour_DNSServiceRefSockFD) *function = - (typeof(function)) bonjour_function("DNSServiceRefSockFD"); + (typeof(function)) bonjour_function("DNSServiceRefSockFD"); if (function != NULL) return function(service); @@ -60,7 +60,7 @@ bonjour_DNSServiceErrorType bonjour_DNSServiceProcessResult(bonjour_DNSServiceRef service) { BONJOUR_CALL typeof(bonjour_DNSServiceProcessResult) *function = - (typeof(function)) bonjour_function("DNSServiceProcessResult"); + (typeof(function)) bonjour_function("DNSServiceProcessResult"); if (function != NULL) return function(service); @@ -70,19 +70,19 @@ bonjour_DNSServiceProcessResult(bonjour_DNSServiceRef service) void bonjour_DNSServiceRefDeallocate(bonjour_DNSServiceRef service) { BONJOUR_CALL typeof(bonjour_DNSServiceRefDeallocate) *function = - (typeof(function)) bonjour_function("DNSServiceRefDeallocate"); + (typeof(function)) bonjour_function("DNSServiceRefDeallocate"); if (function != NULL) function(service); } bonjour_DNSServiceErrorType bonjour_DNSServiceEnumerateDomains( - bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, bonjour_DNSServiceDomainEnumReply callBack, - void *context) + bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, bonjour_DNSServiceDomainEnumReply callBack, + void *context) { BONJOUR_CALL typeof(bonjour_DNSServiceEnumerateDomains) *function = - (typeof(function)) bonjour_function("DNSServiceEnumerateDomains"); + (typeof(function)) bonjour_function("DNSServiceEnumerateDomains"); if (function != NULL) return function(service, flags, interfaceIndex, callBack, context); @@ -91,14 +91,14 @@ bonjour_DNSServiceErrorType bonjour_DNSServiceEnumerateDomains( } bonjour_DNSServiceErrorType bonjour_DNSServiceRegister( - bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, const char *name, const char *regtype, - const char *domain, const char *host, uint16_t port, uint16_t txtLen, - const void *txtRecord, bonjour_DNSServiceRegisterReply callBack, - void *context) + bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, const char *name, const char *regtype, + const char *domain, const char *host, uint16_t port, uint16_t txtLen, + const void *txtRecord, bonjour_DNSServiceRegisterReply callBack, + void *context) { BONJOUR_CALL typeof(bonjour_DNSServiceRegister) *function = - (typeof(function)) bonjour_function("DNSServiceRegister"); + (typeof(function)) bonjour_function("DNSServiceRegister"); if (function != NULL) return function(service, flags, interfaceIndex, name, regtype, domain, @@ -114,7 +114,7 @@ bonjour_DNSServiceAddRecord(bonjour_DNSServiceRef service, uint16_t rdlen, const void *rdata, uint32_t ttl) { BONJOUR_CALL typeof(bonjour_DNSServiceAddRecord) *function = - (typeof(function)) bonjour_function("DNSServiceAddRecord"); + (typeof(function)) bonjour_function("DNSServiceAddRecord"); if (function != NULL) return function(service, RecordRef, flags, rrtype, rdlen, rdata, ttl); @@ -129,7 +129,7 @@ bonjour_DNSServiceUpdateRecord(bonjour_DNSServiceRef service, const void *rdata, uint32_t ttl) { BONJOUR_CALL typeof(bonjour_DNSServiceUpdateRecord) *function = - (typeof(function)) bonjour_function("DNSServiceUpdateRecord"); + (typeof(function)) bonjour_function("DNSServiceUpdateRecord"); if (function != NULL) return function(service, RecordRef, flags, rdlen, rdata, ttl); @@ -143,7 +143,7 @@ bonjour_DNSServiceRemoveRecord(bonjour_DNSServiceRef service, bonjour_DNSServiceFlags flags) { BONJOUR_CALL typeof(bonjour_DNSServiceRemoveRecord) *function = - (typeof(function)) bonjour_function("DNSServiceRemoveRecord"); + (typeof(function)) bonjour_function("DNSServiceRemoveRecord"); if (function != NULL) return function(service, RecordRef, flags); @@ -158,7 +158,7 @@ bonjour_DNSServiceBrowse(bonjour_DNSServiceRef *service, bonjour_DNSServiceBrowseReply callBack, void *context) { BONJOUR_CALL typeof(bonjour_DNSServiceBrowse) *function = - (typeof(function)) bonjour_function("DNSServiceBrowse"); + (typeof(function)) bonjour_function("DNSServiceBrowse"); if (function != NULL) return function(service, flags, interfaceIndex, regtype, domain, @@ -168,12 +168,13 @@ bonjour_DNSServiceBrowse(bonjour_DNSServiceRef *service, } bonjour_DNSServiceErrorType bonjour_DNSServiceResolve( - bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, const char *name, const char *regtype, - const char *domain, bonjour_DNSServiceResolveReply callBack, void *context) + bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, const char *name, const char *regtype, + const char *domain, bonjour_DNSServiceResolveReply callBack, + void *context) { BONJOUR_CALL typeof(bonjour_DNSServiceResolve) *function = - (typeof(function)) bonjour_function("DNSServiceResolve"); + (typeof(function)) bonjour_function("DNSServiceResolve"); if (function != NULL) return function(service, flags, interfaceIndex, name, regtype, domain, @@ -186,7 +187,7 @@ bonjour_DNSServiceErrorType bonjour_DNSServiceCreateConnection(bonjour_DNSServiceRef *service) { BONJOUR_CALL typeof(bonjour_DNSServiceCreateConnection) *function = - (typeof(function)) bonjour_function("DNSServiceCreateConnection"); + (typeof(function)) bonjour_function("DNSServiceCreateConnection"); if (function != NULL) return function(service); @@ -195,14 +196,14 @@ bonjour_DNSServiceCreateConnection(bonjour_DNSServiceRef *service) } bonjour_DNSServiceErrorType bonjour_DNSServiceRegisterRecord( - bonjour_DNSServiceRef service, bonjour_DNSRecordRef *RecordRef, - bonjour_DNSServiceFlags flags, uint32_t interfaceIndex, - const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, - const void *rdata, uint32_t ttl, - bonjour_DNSServiceRegisterRecordReply callBack, void *context) + bonjour_DNSServiceRef service, bonjour_DNSRecordRef *RecordRef, + bonjour_DNSServiceFlags flags, uint32_t interfaceIndex, + const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, + const void *rdata, uint32_t ttl, + bonjour_DNSServiceRegisterRecordReply callBack, void *context) { BONJOUR_CALL typeof(bonjour_DNSServiceRegisterRecord) *function = - (typeof(function)) bonjour_function("DNSServiceRegisterRecord"); + (typeof(function)) bonjour_function("DNSServiceRegisterRecord"); if (function != NULL) return function(service, RecordRef, flags, interfaceIndex, fullname, @@ -212,13 +213,13 @@ bonjour_DNSServiceErrorType bonjour_DNSServiceRegisterRecord( } bonjour_DNSServiceErrorType bonjour_DNSServiceQueryRecord( - bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, - uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, - uint16_t rrclass, bonjour_DNSServiceQueryRecordReply callBack, - void *context) + bonjour_DNSServiceRef *service, bonjour_DNSServiceFlags flags, + uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, + uint16_t rrclass, bonjour_DNSServiceQueryRecordReply callBack, + void *context) { BONJOUR_CALL typeof(bonjour_DNSServiceQueryRecord) *function = - (typeof(function)) bonjour_function("DNSServiceQueryRecord"); + (typeof(function)) bonjour_function("DNSServiceQueryRecord"); if (function != NULL) return function(service, flags, interfaceIndex, fullname, rrtype, @@ -234,7 +235,7 @@ bonjour_DNSServiceReconfirmRecord(bonjour_DNSServiceFlags flags, uint16_t rdlen, const void *rdata) { BONJOUR_CALL typeof(bonjour_DNSServiceReconfirmRecord) *function = - (typeof(function)) bonjour_function("DNSServiceReconfirmRecord"); + (typeof(function)) bonjour_function("DNSServiceReconfirmRecord"); if (function != NULL) return function(flags, interfaceIndex, fullname, rrtype, rrclass, rdlen, @@ -247,7 +248,7 @@ int bonjour_DNSServiceConstructFullName(char *fullName, const char *service, const char *regtype, const char *domain) { BONJOUR_CALL typeof(bonjour_DNSServiceConstructFullName) *function = - (typeof(function)) bonjour_function("DNSServiceConstructFullName"); + (typeof(function)) bonjour_function("DNSServiceConstructFullName"); if (function != NULL) return function(fullName, service, regtype, domain); @@ -259,7 +260,7 @@ void bonjour_TXTRecordCreate(bonjour_TXTRecordRef *txtRecord, uint16_t bufferLen, void *buffer) { BONJOUR_CALL typeof(bonjour_TXTRecordCreate) *function = - (typeof(function)) bonjour_function("TXTRecordCreate"); + (typeof(function)) bonjour_function("TXTRecordCreate"); if (function != NULL) function(txtRecord, bufferLen, buffer); @@ -267,7 +268,7 @@ void bonjour_TXTRecordCreate(bonjour_TXTRecordRef *txtRecord, void bonjour_TXTRecordDeallocate(bonjour_TXTRecordRef *txtRecord) { BONJOUR_CALL typeof(bonjour_TXTRecordDeallocate) *function = - (typeof(function)) bonjour_function("TXTRecordDeallocate"); + (typeof(function)) bonjour_function("TXTRecordDeallocate"); if (function != NULL) function(txtRecord); @@ -278,7 +279,7 @@ bonjour_TXTRecordSetValue(bonjour_TXTRecordRef *txtRecord, const char *key, uint8_t valueSize, const void *value) { BONJOUR_CALL typeof(bonjour_TXTRecordSetValue) *function = - (typeof(function)) bonjour_function("TXTRecordSetValue"); + (typeof(function)) bonjour_function("TXTRecordSetValue"); if (function != NULL) return function(txtRecord, key, valueSize, value); @@ -290,7 +291,7 @@ bonjour_DNSServiceErrorType bonjour_TXTRecordRemoveValue(bonjour_TXTRecordRef *txtRecord, const char *key) { BONJOUR_CALL typeof(bonjour_TXTRecordRemoveValue) *function = - (typeof(function)) bonjour_function("TXTRecordRemoveValue"); + (typeof(function)) bonjour_function("TXTRecordRemoveValue"); if (function != NULL) return function(txtRecord, key); @@ -300,7 +301,7 @@ bonjour_TXTRecordRemoveValue(bonjour_TXTRecordRef *txtRecord, const char *key) uint16_t bonjour_TXTRecordGetLength(const bonjour_TXTRecordRef *txtRecord) { BONJOUR_CALL typeof(bonjour_TXTRecordGetLength) *function = - (typeof(function)) bonjour_function("TXTRecordGetLength"); + (typeof(function)) bonjour_function("TXTRecordGetLength"); if (function != NULL) return function(txtRecord); @@ -311,7 +312,7 @@ uint16_t bonjour_TXTRecordGetLength(const bonjour_TXTRecordRef *txtRecord) { const void *bonjour_TXTRecordGetBytesPtr(const bonjour_TXTRecordRef *txtRecord) { BONJOUR_CALL typeof(bonjour_TXTRecordGetBytesPtr) *function = - (typeof(function)) bonjour_function("TXTRecordGetBytesPtr"); + (typeof(function)) bonjour_function("TXTRecordGetBytesPtr"); if (function != NULL) return function(txtRecord); @@ -323,7 +324,7 @@ int bonjour_TXTRecordContainsKey(uint16_t txtLen, const void *txtRecord, const char *key) { BONJOUR_CALL typeof(bonjour_TXTRecordContainsKey) *function = - (typeof(function)) bonjour_function("TXTRecordContainsKey"); + (typeof(function)) bonjour_function("TXTRecordContainsKey"); if (function != NULL) return function(txtLen, txtRecord, key); @@ -335,7 +336,7 @@ const void *bonjour_TXTRecordGetValuePtr(uint16_t txtLen, const void *txtRecord, const char *key, uint8_t *valueLen) { BONJOUR_CALL typeof(bonjour_TXTRecordGetValuePtr) *function = - (typeof(function)) bonjour_function("TXTRecordGetValuePtr"); + (typeof(function)) bonjour_function("TXTRecordGetValuePtr"); if (function != NULL) return function(txtLen, txtRecord, key, valueLen); @@ -345,7 +346,7 @@ const void *bonjour_TXTRecordGetValuePtr(uint16_t txtLen, const void *txtRecord, uint16_t bonjour_TXTRecordGetCount(uint16_t txtLen, const void *txtRecord) { BONJOUR_CALL typeof(bonjour_TXTRecordGetCount) *function = - (typeof(function)) bonjour_function("TXTRecordGetCount"); + (typeof(function)) bonjour_function("TXTRecordGetCount"); if (function != NULL) return function(txtLen, txtRecord); @@ -359,7 +360,7 @@ bonjour_TXTRecordGetItemAtIndex(uint16_t txtLen, const void *txtRecord, uint8_t *valueLen, const void **value) { BONJOUR_CALL typeof(bonjour_TXTRecordGetItemAtIndex) *function = - (typeof(function)) bonjour_function("TXTRecordGetItemAtIndex"); + (typeof(function)) bonjour_function("TXTRecordGetItemAtIndex"); if (function != NULL) return function(txtLen, txtRecord, index, keyBufLen, key, valueLen, diff --git a/Foundation/NSNotification/NSNotification.m b/Foundation/NSNotification/NSNotification.m index 624234dd..1fccdab9 100644 --- a/Foundation/NSNotification/NSNotification.m +++ b/Foundation/NSNotification/NSNotification.m @@ -34,8 +34,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithName: (NSString *) name - object: object - userInfo: (NSDictionary *) userInfo + object: object + userInfo: (NSDictionary *) userInfo { NSInvalidAbstractInvocation(); return nil; @@ -73,7 +73,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ userInfo: (NSDictionary *) userInfo { return NSAutorelease( - NSNotification_concreteNew(NULL, name, object, userInfo)); + NSNotification_concreteNew(NULL, name, object, userInfo)); } - (NSString *) name { diff --git a/Foundation/NSNotification/NSNotification_concrete.h b/Foundation/NSNotification/NSNotification_concrete.h index 63bb8c15..06e4fe43 100644 --- a/Foundation/NSNotification/NSNotification_concrete.h +++ b/Foundation/NSNotification/NSNotification_concrete.h @@ -26,8 +26,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithName: (NSString *) name - object: object - userInfo: (NSDictionary *) userInfo; + object: object + userInfo: (NSDictionary *) userInfo; @end diff --git a/Foundation/NSNotification/NSNotification_concrete.m b/Foundation/NSNotification/NSNotification_concrete.m index 45bca4d4..d9497219 100644 --- a/Foundation/NSNotification/NSNotification_concrete.m +++ b/Foundation/NSNotification/NSNotification_concrete.m @@ -31,7 +31,7 @@ NSNotification_concrete *NSNotification_concreteNew(NSZone *zone, NSDictionary *userInfo) { NSNotification_concrete *self = - NSAllocateObject([NSNotification_concrete class], 0, zone); + NSAllocateObject([NSNotification_concrete class], 0, zone); if (self) { self->_name = [name copyWithZone: zone]; self->_object = [object retain]; @@ -41,8 +41,8 @@ NSNotification_concrete *NSNotification_concreteNew(NSZone *zone, } - initWithName: (NSString *) name - object: object - userInfo: (NSDictionary *) userInfo + object: object + userInfo: (NSDictionary *) userInfo { _name = [name copy]; _object = [object retain]; diff --git a/Foundation/NSNotificationCenter/NSNotificationCenter.m b/Foundation/NSNotificationCenter/NSNotificationCenter.m index 31735463..8055af5b 100644 --- a/Foundation/NSNotificationCenter/NSNotificationCenter.m +++ b/Foundation/NSNotificationCenter/NSNotificationCenter.m @@ -62,9 +62,9 @@ static NSNotificationCenter *defaultCenter = nil; { @synchronized(self) { NSNotificationObserver *observer = - [[[NSNotificationObserver allocWithZone: [self zone]] - initWithObserver: anObserver - selector: selector] autorelease]; + [[[NSNotificationObserver allocWithZone: [self zone]] + initWithObserver: anObserver + selector: selector] autorelease]; NSObjectToObservers *registry; if (name == nil) @@ -74,7 +74,7 @@ static NSNotificationCenter *defaultCenter = nil; if (registry == nil) { registry = [[[NSObjectToObservers allocWithZone: [self zone]] - init] autorelease]; + init] autorelease]; [_nameToRegistry setObject: registry forKey: name]; } } @@ -102,8 +102,8 @@ static NSNotificationCenter *defaultCenter = nil; count = [removeRegistries count]; while (--count >= 0) - [_nameToRegistry - removeObjectForKey: [removeRegistries objectAtIndex: count]]; + [_nameToRegistry removeObjectForKey: [removeRegistries + objectAtIndex: count]]; } } @@ -174,7 +174,7 @@ static inline void postNotification(NSNotificationCenter *self, userInfo: (NSDictionary *) userInfo { NSNotification *note = - NSNotification_concreteNew(NULL, name, object, userInfo); + NSNotification_concreteNew(NULL, name, object, userInfo); postNotification(self, note); [note release]; } diff --git a/Foundation/NSNotificationCenter/NSObjectToObservers.m b/Foundation/NSNotificationCenter/NSObjectToObservers.m index 18bf8656..8d23dd6a 100644 --- a/Foundation/NSNotificationCenter/NSObjectToObservers.m +++ b/Foundation/NSNotificationCenter/NSObjectToObservers.m @@ -29,8 +29,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - init { _objectToObservers = - NSCreateMapTableWithZone(NSNonOwnedPointerMapKeyCallBacks, - NSObjectMapValueCallBacks, 0, [self zone]); + NSCreateMapTableWithZone(NSNonOwnedPointerMapKeyCallBacks, + NSObjectMapValueCallBacks, 0, [self zone]); return self; } @@ -105,28 +105,28 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSInteger count; if (object != nil) { - observers = - [NSArray arrayWithArray: (id) NSMapGet(_objectToObservers, object)]; + observers = [NSArray + arrayWithArray: (id) NSMapGet(_objectToObservers, object)]; count = [observers count]; while (--count >= 0) { id observer = [observers objectAtIndex: count]; if ([(NSArray *) NSMapGet(_objectToObservers, object) - indexOfObjectIdenticalTo: observer] != NSNotFound) + indexOfObjectIdenticalTo: observer] != NSNotFound) [observer performSelector: _cmd withObject: note]; } } observers = [NSArray - arrayWithArray: (id) NSMapGet(_objectToObservers, [NSNull null])]; + arrayWithArray: (id) NSMapGet(_objectToObservers, [NSNull null])]; count = [observers count]; while (--count >= 0) { id observer = [observers objectAtIndex: count]; if ([(NSArray *) NSMapGet(_objectToObservers, [NSNull null]) - indexOfObjectIdenticalTo: observer] != NSNotFound) + indexOfObjectIdenticalTo: observer] != NSNotFound) [observer performSelector: _cmd withObject: note]; } } diff --git a/Foundation/NSNotificationQueue/NSNotificationAndModes.m b/Foundation/NSNotificationQueue/NSNotificationAndModes.m index 8d9227a5..1ac7bad2 100644 --- a/Foundation/NSNotificationQueue/NSNotificationAndModes.m +++ b/Foundation/NSNotificationQueue/NSNotificationAndModes.m @@ -46,7 +46,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + queuedWithNotification: (NSNotification *) note modes: (NSArray *) modes { return [[[self allocWithZone: NULL] initWithNotification: note modes: modes] - autorelease]; + autorelease]; } @end diff --git a/Foundation/NSNotificationQueue/NSNotificationQueue.m b/Foundation/NSNotificationQueue/NSNotificationQueue.m index c5af95bb..e3d3cc4e 100644 --- a/Foundation/NSNotificationQueue/NSNotificationQueue.m +++ b/Foundation/NSNotificationQueue/NSNotificationQueue.m @@ -36,8 +36,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - init { - return - [self initWithNotificationCenter: [NSNotificationCenter defaultCenter]]; + return [self + initWithNotificationCenter: [NSNotificationCenter defaultCenter]]; } + (NSNotificationQueue *) defaultQueue { @@ -178,9 +178,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ queue = _asapQueue; [self coalesceNotification: note inQueue: queue coalesceMask: mask]; - [queue - addObject: [NSNotificationAndModes queuedWithNotification: note - modes: modes]]; + [queue addObject: [NSNotificationAndModes + queuedWithNotification: note + modes: modes]]; } } diff --git a/Foundation/NSNumber/NSNumber.m b/Foundation/NSNumber/NSNumber.m index 81d469d3..d0314e59 100644 --- a/Foundation/NSNumber/NSNumber.m +++ b/Foundation/NSNumber/NSNumber.m @@ -360,28 +360,28 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + (NSNumber *) numberWithUnsignedChar: (unsigned char) value { - return - [[[self allocWithZone: NULL] initWithUnsignedChar: value] autorelease]; + return [[[self allocWithZone: NULL] initWithUnsignedChar: value] + autorelease]; } + (NSNumber *) numberWithUnsignedShort: (unsigned short) value { - return - [[[self allocWithZone: NULL] initWithUnsignedShort: value] autorelease]; + return [[[self allocWithZone: NULL] initWithUnsignedShort: value] + autorelease]; } + (NSNumber *) numberWithUnsignedInt: (unsigned int) value { - return - [[[self allocWithZone: NULL] initWithUnsignedInt: value] autorelease]; + return [[[self allocWithZone: NULL] initWithUnsignedInt: value] + autorelease]; } + (NSNumber *) numberWithUnsignedLong: (unsigned long) value { - return - [[[self allocWithZone: NULL] initWithUnsignedLong: value] autorelease]; + return [[[self allocWithZone: NULL] initWithUnsignedLong: value] + autorelease]; } + (NSNumber *) numberWithUnsignedLongLong: (unsigned long long) value { return [[[self allocWithZone: NULL] initWithUnsignedLongLong: value] - autorelease]; + autorelease]; } + (NSNumber *) numberWithUnsignedInteger: (NSUInteger) value { diff --git a/Foundation/NSNumber/NSNumber_BOOL.m b/Foundation/NSNumber/NSNumber_BOOL.m index bbad2252..db5c4527 100644 --- a/Foundation/NSNumber/NSNumber_BOOL.m +++ b/Foundation/NSNumber/NSNumber_BOOL.m @@ -32,9 +32,9 @@ NSNumber *NSNumber_BOOLNew(NSZone *zone, BOOL value) { } + (id) allocWithZone: (NSZone *) zone { - [NSException - raise: NSInternalInconsistencyException - format: @"Private class NSNumber_BOOL is not intended to be alloced."]; + [NSException raise: NSInternalInconsistencyException + format: @"Private class NSNumber_BOOL is not intended to be " + @"alloced."]; return nil; } diff --git a/Foundation/NSNumber/NSNumber_double.m b/Foundation/NSNumber/NSNumber_double.m index eed48d7e..9bbe87c6 100644 --- a/Foundation/NSNumber/NSNumber_double.m +++ b/Foundation/NSNumber/NSNumber_double.m @@ -50,7 +50,7 @@ NSNumber *NSNumber_doubleNew(NSZone *zone, double value) { NSNumber *result = NSNumber_doubleSpecial(value); if (result == nil) { NSNumber_double *self = - NSAllocateObject([NSNumber_double class], 0, zone); + NSAllocateObject([NSNumber_double class], 0, zone); if (self) { self->_type = kCFNumberDoubleType; self->_value = value; @@ -183,37 +183,38 @@ typedef struct { } NSNumber_double_Def; static const NSNumber_double_Def kPositiveInfinityDef = { - &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, INFINITY}; + &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, INFINITY}; static const NSNumber_double_Def kNegativeInfinityDef = { - &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, -INFINITY}; + &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, + -INFINITY}; static const NSNumber_double_Def kNaNDef = { - &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, NAN}; + &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, NAN}; static const NSNumber_double_Def kPositiveZeroDef = { - &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, 0.0}; + &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, 0.0}; static const NSNumber_double_Def kNegativeZeroDef = { - &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, -0.0}; + &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, -0.0}; static const NSNumber_double_Def kPositiveOneDef = { - &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, 1.0}; + &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, 1.0}; static const NSNumber_double_Def kNegativeOneDef = { - &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, -1.0}; + &NS_CLASS_SYMBOL(NSNumber_double_const), kCFNumberDoubleType, -1.0}; const CFNumberRef kCFNumberPositiveInfinity = - (CFNumberRef) &kPositiveInfinityDef; + (CFNumberRef) &kPositiveInfinityDef; const CFNumberRef kCFNumberNegativeInfinity = - (CFNumberRef) &kNegativeInfinityDef; + (CFNumberRef) &kNegativeInfinityDef; const CFNumberRef kCFNumberNaN = (CFNumberRef) &kNaNDef; NS_CONSTOBJ_DEF NSNumber *const kNSNumberPositiveZero = - (NSNumber *) &kPositiveZeroDef; + (NSNumber *) &kPositiveZeroDef; NS_CONSTOBJ_DEF NSNumber *const kNSNumberNegativeZero = - (NSNumber *) &kNegativeZeroDef; + (NSNumber *) &kNegativeZeroDef; NS_CONSTOBJ_DEF NSNumber *const kNSNumberPositiveOne = - (NSNumber *) &kPositiveOneDef; + (NSNumber *) &kPositiveOneDef; NS_CONSTOBJ_DEF NSNumber *const kNSNumberNegativeOne = - (NSNumber *) &kNegativeOneDef; + (NSNumber *) &kNegativeOneDef; diff --git a/Foundation/NSNumber/NSNumber_float.m b/Foundation/NSNumber/NSNumber_float.m index db340fec..7ba83503 100644 --- a/Foundation/NSNumber/NSNumber_float.m +++ b/Foundation/NSNumber/NSNumber_float.m @@ -26,7 +26,7 @@ NSNumber *NSNumber_floatNew(NSZone *zone, float value) { NSNumber *result = NSNumber_doubleSpecial(value); if (result == nil) { NSNumber_float *self = - NSAllocateObject([NSNumber_float class], 0, zone); + NSAllocateObject([NSNumber_float class], 0, zone); if (self) { self->_type = kCFNumberFloatType; self->_value = value; diff --git a/Foundation/NSNumber/NSNumber_longLong.m b/Foundation/NSNumber/NSNumber_longLong.m index 880246d5..176165b4 100644 --- a/Foundation/NSNumber/NSNumber_longLong.m +++ b/Foundation/NSNumber/NSNumber_longLong.m @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSNumber *NSNumber_longLongNew(NSZone *zone, long long value) { NSNumber_longLong *self = - NSAllocateObject([NSNumber_longLong class], 0, zone); + NSAllocateObject([NSNumber_longLong class], 0, zone); if (self) { self->_type = kCFNumberLongLongType; self->_value = value; diff --git a/Foundation/NSNumber/NSNumber_placeholder.m b/Foundation/NSNumber/NSNumber_placeholder.m index c0608ddd..20423e8b 100644 --- a/Foundation/NSNumber/NSNumber_placeholder.m +++ b/Foundation/NSNumber/NSNumber_placeholder.m @@ -43,7 +43,7 @@ static NSNumber_placeholder *sSharedInstance; + (void) initialize { if (self == objc_lookUpClass("NSNumber_placeholder")) sSharedInstance = - NSAllocateObject([NSNumber_placeholder class], 0, NULL); + NSAllocateObject([NSNumber_placeholder class], 0, NULL); } + _sharedInstance { diff --git a/Foundation/NSNumber/NSNumber_unsignedChar.m b/Foundation/NSNumber/NSNumber_unsignedChar.m index 92362620..7e695fa7 100644 --- a/Foundation/NSNumber/NSNumber_unsignedChar.m +++ b/Foundation/NSNumber/NSNumber_unsignedChar.m @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSNumber *NSNumber_unsignedCharNew(NSZone *zone, unsigned char value) { NSNumber_unsignedChar *self = - NSAllocateObject([NSNumber_unsignedChar class], 0, zone); + NSAllocateObject([NSNumber_unsignedChar class], 0, zone); if (self) { self->_type = kCFNumberCharType; self->_value = value; diff --git a/Foundation/NSNumber/NSNumber_unsignedInt.m b/Foundation/NSNumber/NSNumber_unsignedInt.m index 58e27e53..fa9ae7ca 100644 --- a/Foundation/NSNumber/NSNumber_unsignedInt.m +++ b/Foundation/NSNumber/NSNumber_unsignedInt.m @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSNumber *NSNumber_unsignedIntNew(NSZone *zone, unsigned int value) { NSNumber_unsignedInt *self = - NSAllocateObject([NSNumber_unsignedInt class], 0, zone); + NSAllocateObject([NSNumber_unsignedInt class], 0, zone); if (self) { self->_type = kCFNumberIntType; self->_value = value; diff --git a/Foundation/NSNumber/NSNumber_unsignedLong.m b/Foundation/NSNumber/NSNumber_unsignedLong.m index 111711a9..a7f65e47 100644 --- a/Foundation/NSNumber/NSNumber_unsignedLong.m +++ b/Foundation/NSNumber/NSNumber_unsignedLong.m @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSNumber *NSNumber_unsignedLongNew(NSZone *zone, unsigned long value) { NSNumber_unsignedLong *self = - NSAllocateObject([NSNumber_unsignedLong class], 0, zone); + NSAllocateObject([NSNumber_unsignedLong class], 0, zone); if (self) { self->_type = kCFNumberLongType; self->_value = value; diff --git a/Foundation/NSNumber/NSNumber_unsignedLongLong.m b/Foundation/NSNumber/NSNumber_unsignedLongLong.m index 8396b7ae..660bbeef 100644 --- a/Foundation/NSNumber/NSNumber_unsignedLongLong.m +++ b/Foundation/NSNumber/NSNumber_unsignedLongLong.m @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSNumber *NSNumber_unsignedLongLongNew(NSZone *zone, unsigned long long value) { NSNumber_unsignedLongLong *self = - NSAllocateObject([NSNumber_unsignedLongLong class], 0, zone); + NSAllocateObject([NSNumber_unsignedLongLong class], 0, zone); if (self) { self->_type = kCFNumberLongLongType; self->_value = value; diff --git a/Foundation/NSNumber/NSNumber_unsignedShort.m b/Foundation/NSNumber/NSNumber_unsignedShort.m index 94511096..fd8ef08e 100644 --- a/Foundation/NSNumber/NSNumber_unsignedShort.m +++ b/Foundation/NSNumber/NSNumber_unsignedShort.m @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSNumber *NSNumber_unsignedShortNew(NSZone *zone, unsigned short value) { NSNumber_unsignedShort *self = - NSAllocateObject([NSNumber_unsignedShort class], 0, zone); + NSAllocateObject([NSNumber_unsignedShort class], 0, zone); if (self) { self->_type = kCFNumberShortType; self->_value = value; diff --git a/Foundation/NSNumberFormatter.h b/Foundation/NSNumberFormatter.h index 2a3ffdc8..e8d072ef 100644 --- a/Foundation/NSNumberFormatter.h +++ b/Foundation/NSNumberFormatter.h @@ -291,7 +291,7 @@ typedef NSUInteger NSNumberFormatterRoundingMode; - (void) setAttributedStringForZero: (NSAttributedString *) attributedString; - (void) setAttributedStringForNil: (NSAttributedString *) attributedString; - (void) setAttributedStringForNotANumber: - (NSAttributedString *) attributedString; + (NSAttributedString *) attributedString; - (void) setRoundingBehavior: (NSDecimalNumberHandler *) value; @end diff --git a/Foundation/NSNumberFormatter.m b/Foundation/NSNumberFormatter.m index 0dad2b32..70e68973 100644 --- a/Foundation/NSNumberFormatter.m +++ b/Foundation/NSNumberFormatter.m @@ -42,7 +42,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSNumberFormatter static NSNumberFormatterBehavior _defaultFormatterBehavior = - NSNumberFormatterBehavior10_4; + NSNumberFormatterBehavior10_4; + (NSNumberFormatterBehavior) defaultFormatterBehavior { return _defaultFormatterBehavior; @@ -63,15 +63,15 @@ static NSNumberFormatterBehavior _defaultFormatterBehavior = _locale = [[NSLocale currentLocale] retain]; _thousandSeparator = - [[_locale objectForKey: NSLocaleGroupingSeparator] retain]; + [[_locale objectForKey: NSLocaleGroupingSeparator] retain]; _decimalSeparator = - [[_locale objectForKey: NSLocaleDecimalSeparator] retain]; - _attributedStringForNil = - [[NSAttributedString allocWithZone: NULL] initWithString: @"(null)"]; + [[_locale objectForKey: NSLocaleDecimalSeparator] retain]; + _attributedStringForNil = [[NSAttributedString allocWithZone: NULL] + initWithString: @"(null)"]; _attributedStringForNotANumber = - [[NSAttributedString allocWithZone: NULL] initWithString: @"NaN"]; + [[NSAttributedString allocWithZone: NULL] initWithString: @"NaN"]; _attributedStringForZero = - [[NSAttributedString allocWithZone: NULL] initWithString: @"0.0"]; + [[NSAttributedString allocWithZone: NULL] initWithString: @"0.0"]; _allowsFloats = YES; return self; @@ -113,7 +113,7 @@ static void extractFormat(NSString *format, NSString **prefix, } state = STATE_PREFIX; NSUInteger minimumIntegerDigits, maximumIntegerDigits, - minimumFractionDigits, maximumFractionDigits; + minimumFractionDigits, maximumFractionDigits; minimumIntegerDigits = 0; maximumIntegerDigits = 0; minimumFractionDigits = 0; @@ -215,15 +215,15 @@ static void extractFormat(NSString *format, NSString **prefix, } if (prefixLength > 0) { - *prefix = - [[NSString allocWithZone: NULL] initWithCharacters: prefixBuffer - length: prefixLength]; + *prefix = [[NSString allocWithZone: NULL] + initWithCharacters: prefixBuffer + length: prefixLength]; } if (suffixLength > 0) { - *suffix = - [[NSString allocWithZone: NULL] initWithCharacters: suffixBuffer - length: suffixLength]; + *suffix = [[NSString allocWithZone: NULL] + initWithCharacters: suffixBuffer + length: suffixLength]; } } @@ -279,7 +279,7 @@ static void extractFormat(NSString *format, NSString **prefix, if ((check = [attributes objectForKey: @"allowsFloats"]) != nil) _allowsFloats = [check boolValue]; if ((check = [attributes - objectForKey: @"alwaysShowsDecimalSeparator"]) != nil) + objectForKey: @"alwaysShowsDecimalSeparator"]) != nil) _alwaysShowsDecimalSeparator = [check boolValue]; if ((check = [attributes objectForKey: @"lenient"]) != nil) _isLenient = [check boolValue]; @@ -313,7 +313,7 @@ static void extractFormat(NSString *format, NSString **prefix, _nilSymbol = [[attributes objectForKey: @"nilSymbol"] copy]; _notANumberSymbol = - [[attributes objectForKey: @"notANumberSymbol"] copy]; + [[attributes objectForKey: @"notANumberSymbol"] copy]; _zeroSymbol = [[attributes objectForKey: @"zeroSymbol"] copy]; _plusSign = [[attributes objectForKey: @"plusSign"] copy]; _minusSign = [[attributes objectForKey: @"minusSign"] copy]; @@ -323,38 +323,38 @@ static void extractFormat(NSString *format, NSString **prefix, _positivePrefix = [[attributes objectForKey: @"positivePrefix"] copy]; _positiveSuffix = [[attributes objectForKey: @"positiveSuffix"] copy]; _negativeInfinitySymbol = - [[attributes objectForKey: @"negativeInfinitySymbol"] copy]; + [[attributes objectForKey: @"negativeInfinitySymbol"] copy]; _positiveInfinitySymbol = - [[attributes objectForKey: @"positiveInfinitySymbol"] copy]; + [[attributes objectForKey: @"positiveInfinitySymbol"] copy]; _decimalSeparator = - [[attributes objectForKey: @"decimalSeparator"] copy]; + [[attributes objectForKey: @"decimalSeparator"] copy]; _exponentSymbol = [[attributes objectForKey: @"exponentSymbol"] copy]; _currencyCode = [[attributes objectForKey: @"currencyCode"] copy]; _currencySymbol = [[attributes objectForKey: @"currencySymbol"] copy]; - _internationalCurrencySymbol = - [[attributes objectForKey: @"internationalCurrencySymbol"] copy]; + _internationalCurrencySymbol = [[attributes + objectForKey: @"internationalCurrencySymbol"] copy]; _currencyDecimalSeparator = - [[attributes objectForKey: @"currencyDecimalSeparator"] copy]; + [[attributes objectForKey: @"currencyDecimalSeparator"] copy]; _currencyGroupingSeparator = - [[attributes objectForKey: @"currencyGroupingSeparator"] copy]; + [[attributes objectForKey: @"currencyGroupingSeparator"] copy]; _groupingSeparator = - [[attributes objectForKey: @"groupingSeparator"] copy]; + [[attributes objectForKey: @"groupingSeparator"] copy]; _groupingSize = - [[attributes objectForKey: @"groupingSize"] integerValue]; - _secondaryGroupingSize = - [[attributes objectForKey: @"secondaryGroupingSize"] integerValue]; + [[attributes objectForKey: @"groupingSize"] integerValue]; + _secondaryGroupingSize = [[attributes + objectForKey: @"secondaryGroupingSize"] integerValue]; _paddingCharacter = - [[attributes objectForKey: @"paddingCharacter"] copy]; + [[attributes objectForKey: @"paddingCharacter"] copy]; _paddingPosition = - [[attributes objectForKey: @"paddingPosition"] integerValue]; + [[attributes objectForKey: @"paddingPosition"] integerValue]; _percentSymbol = [[attributes objectForKey: @"percentSymbol"] copy]; _perMillSymbol = [[attributes objectForKey: @"perMillSymbol"] copy]; _roundingIncrement = - [[attributes objectForKey: @"roundingIncrement"] copy]; + [[attributes objectForKey: @"roundingIncrement"] copy]; _roundingMode = - [[attributes objectForKey: @"roundingMode"] integerValue]; + [[attributes objectForKey: @"roundingMode"] integerValue]; _positiveFormat = [[attributes objectForKey: @"positiveFormat"] copy]; _negativeFormat = [[attributes objectForKey: @"negativeFormat"] copy]; @@ -451,9 +451,9 @@ static void extractFormat(NSString *format, NSString **prefix, } - (NSString *) format { - return - [NSString stringWithFormat: @"%@;%@;%@", _positiveFormat, - _attributedStringForZero, _negativeFormat]; + return [NSString stringWithFormat: @"%@;%@;%@", _positiveFormat, + _attributedStringForZero, + _negativeFormat]; } - (NSUInteger) formatWidth { @@ -762,8 +762,8 @@ static void extractFormat(NSString *format, NSString **prefix, if ([formatStrings count] == 3) { _negativeFormat = [[formatStrings objectAtIndex: 2] retain]; _attributedStringForZero = [[NSAttributedString allocWithZone: NULL] - initWithString: [formatStrings objectAtIndex: 1] - attributes: [NSDictionary dictionary]]; + initWithString: [formatStrings objectAtIndex: 1] + attributes: [NSDictionary dictionary]]; } else if ([formatStrings count] == 2) _negativeFormat = [[formatStrings objectAtIndex: 1] retain]; else @@ -1127,11 +1127,11 @@ static NSString *stringWithFormatGrouping(NSString *format, id locale, va_start(arguments, groupingSize); unichar *unicode = NSCharactersNewWithFormatAndGrouping( - format, locale, arguments, &length, NULL, groupingSeparator, - groupingSize); + format, locale, arguments, &length, NULL, groupingSeparator, + groupingSize); - return - [NSString_unicodePtrNewNoCopy(NULL, unicode, length, YES) autorelease]; + return [NSString_unicodePtrNewNoCopy(NULL, unicode, length, YES) + autorelease]; } - (NSString *) _stringFromNumber: (NSNumber *) number { @@ -1175,9 +1175,9 @@ static NSString *stringWithFormatGrouping(NSString *format, id locale, #ifndef __LP64__ case _C_LNG: #endif - string = - stringWithFormatGrouping(@"%i", _locale, [self groupingSeparator], - [self groupingSize], [number intValue]); + string = stringWithFormatGrouping( + @"%i", _locale, [self groupingSeparator], [self groupingSize], + [number intValue]); break; case _C_UCHR: @@ -1187,8 +1187,8 @@ static NSString *stringWithFormatGrouping(NSString *format, id locale, case _C_ULNG: #endif string = stringWithFormatGrouping( - @"%u", _locale, [self groupingSeparator], [self groupingSize], - [number unsignedIntValue]); + @"%u", _locale, [self groupingSeparator], [self groupingSize], + [number unsignedIntValue]); break; #ifdef __LP64__ @@ -1196,8 +1196,8 @@ static NSString *stringWithFormatGrouping(NSString *format, id locale, #endif case _C_LNG_LNG: string = stringWithFormatGrouping( - @"%qd", _locale, [self groupingSeparator], [self groupingSize], - [number longLongValue]); + @"%qd", _locale, [self groupingSeparator], [self groupingSize], + [number longLongValue]); break; break; @@ -1206,8 +1206,8 @@ static NSString *stringWithFormatGrouping(NSString *format, id locale, #endif case _C_ULNG_LNG: string = stringWithFormatGrouping( - @"%qu", _locale, [self groupingSeparator], [self groupingSize], - [number unsignedLongLongValue]); + @"%qu", _locale, [self groupingSeparator], [self groupingSize], + [number unsignedLongLongValue]); break; case _C_FLT: @@ -1215,11 +1215,11 @@ static NSString *stringWithFormatGrouping(NSString *format, id locale, NSString *format; format = [NSString - stringWithFormat: @"%%.%df", [self minimumFractionDigits]]; + stringWithFormat: @"%%.%df", [self minimumFractionDigits]]; - string = - stringWithFormatGrouping(format, _locale, [self groupingSeparator], - [self groupingSize], [number doubleValue]); + string = stringWithFormatGrouping( + format, _locale, [self groupingSeparator], [self groupingSize], + [number doubleValue]); break; default: @@ -1235,7 +1235,7 @@ static NSNumber *multipliedNumber(NSNumber *number, NSNumber *multiplier) { return number; return [NSNumber - numberWithDouble: [number doubleValue] * [multiplier doubleValue]]; + numberWithDouble: [number doubleValue] * [multiplier doubleValue]]; } static BOOL numberIsNegative(NSNumber *number) { @@ -1282,7 +1282,7 @@ static BOOL numberIsPositive(NSNumber *number) { - (NSString *) stringFromNumberPercentStyle: (NSNumber *) number { NSUnimplementedMethod(); return [[self stringFromNumberNoStyle: number] - stringByAppendingString: [self percentSymbol]]; + stringByAppendingString: [self percentSymbol]]; } - (NSString *) stringFromNumber10_4: (NSNumber *) number { @@ -1350,14 +1350,15 @@ static BOOL numberIsPositive(NSNumber *number) { // scanner can properly parse the string in case the formatter custom // separator doesn't match the locale one NSString *localeDecimalSeparator = - [locale objectForKey: NSLocaleDecimalSeparator]; + [locale objectForKey: NSLocaleDecimalSeparator]; if (localeDecimalSeparator) { [mutableString - replaceOccurrencesOfString: _decimalSeparator - withString: localeDecimalSeparator - options: 0 - range: NSMakeRange( - 0, [mutableString length])]; + replaceOccurrencesOfString: _decimalSeparator + withString: localeDecimalSeparator + options: 0 + range: NSMakeRange(0, + [mutableString + length])]; } } @@ -1373,10 +1374,10 @@ static BOOL numberIsPositive(NSNumber *number) { if (![scanner isAtEnd]) { // The number is valid only if the remaining string is the suffix NSString *suffix = - value >= 0 ? [self positiveSuffix] : [self negativeSuffix]; + value >= 0 ? [self positiveSuffix] : [self negativeSuffix]; if ([suffix length]) { NSString *remainingString = [[scanner string] - substringFromIndex: [scanner scanLocation]]; + substringFromIndex: [scanner scanLocation]]; if (![remainingString isEqualToString: suffix]) { isValid = NO; } @@ -1394,8 +1395,8 @@ static BOOL numberIsPositive(NSNumber *number) { if (isValid == NO) { if (error != NULL) { *error = NSLocalizedStringFromTableInBundle( - @"Invalid number", nil, - [NSBundle bundleForClass: [NSNumberFormatter class]], @""); + @"Invalid number", nil, + [NSBundle bundleForClass: [NSNumberFormatter class]], @""); } number = nil; } @@ -1521,21 +1522,22 @@ static BOOL numberIsPositive(NSNumber *number) { NSRange r; NSUInteger i, indexRight = 0; BOOL formatNoDecPoint = - ([format rangeOfString: @"."].location == NSNotFound); + ([format rangeOfString: @"."].location == NSNotFound); BOOL havePassedDecPoint = NO; NSInteger lastPlaceholder = 0; // remove negative sign if present if ([stringValue hasPrefix: @"-"]) stringValue = [stringValue - substringWithRange: NSMakeRange(1, [stringValue length] - 1)]; + substringWithRange: NSMakeRange(1, [stringValue length] - 1)]; // since we key from the decimal point... if there isn't one in the format // spec we have to go on the "last placeholder"; if we have neither decimal // NOR placeholders, well, we can't really format the number can we if (formatNoDecPoint) { - lastPlaceholder = - [format rangeOfString: @"#" options: NSBackwardsSearch].location; + lastPlaceholder = [format rangeOfString: @"#" + options: NSBackwardsSearch] + .location; if (lastPlaceholder == NSNotFound) [NSException raise: NSInvalidArgumentException format: @"NSNumberFormatter: Invalid format string"]; @@ -1545,10 +1547,10 @@ static BOOL numberIsPositive(NSNumber *number) { r = [stringValue rangeOfString: @"."]; if (r.location != NSNotFound) { leftSide = [stringValue substringWithRange: NSMakeRange(0, r.location)]; - rightSide = - [stringValue substringWithRange: NSMakeRange(r.location + 1, - [stringValue length] - - r.location - 1)]; + rightSide = [stringValue + substringWithRange: NSMakeRange(r.location + 1, + [stringValue length] - + r.location - 1)]; } else leftSide = stringValue; @@ -1609,7 +1611,7 @@ static BOOL numberIsPositive(NSNumber *number) { - (NSAttributedString *) attributedStringForObjectValue10_0: object withDefaultAttributes: - (NSDictionary *) defaultAttributes + (NSDictionary *) defaultAttributes { if (object == nil) { NSAttributedString *check = [self attributedStringForNil]; @@ -1638,13 +1640,13 @@ static BOOL numberIsPositive(NSNumber *number) { attributes = defaultAttributes; return [[[NSAttributedString allocWithZone: NULL] - initWithString: string - attributes: attributes] autorelease]; + initWithString: string + attributes: attributes] autorelease]; } - (NSAttributedString *) attributedStringForObjectValue10_4: object withDefaultAttributes: - (NSDictionary *) defaultAttributes + (NSDictionary *) defaultAttributes { NSString *string = [self stringForObjectValue: object]; NSDictionary *attributes = nil; @@ -1668,13 +1670,13 @@ static BOOL numberIsPositive(NSNumber *number) { attributes = defaultAttributes; return [[[NSAttributedString allocWithZone: NULL] - initWithString: string - attributes: attributes] autorelease]; + initWithString: string + attributes: attributes] autorelease]; } - (NSAttributedString *) attributedStringForObjectValue: object withDefaultAttributes: - (NSDictionary *) attributes + (NSDictionary *) attributes { NSNumberFormatterBehavior check = _behavior; @@ -1682,13 +1684,13 @@ static BOOL numberIsPositive(NSNumber *number) { check = NSNumberFormatterBehavior10_4; if (check == NSNumberFormatterBehavior10_0) - return [self - attributedStringForObjectValue10_0: object - withDefaultAttributes: (NSDictionary *) attributes]; + return [self attributedStringForObjectValue10_0: object + withDefaultAttributes: (NSDictionary *) + attributes]; else - return [self - attributedStringForObjectValue10_4: object - withDefaultAttributes: (NSDictionary *) attributes]; + return [self attributedStringForObjectValue10_4: object + withDefaultAttributes: (NSDictionary *) + attributes]; } - (NSString *) editingStringForObjectValue: (id) object { @@ -1708,9 +1710,9 @@ static BOOL numberIsPositive(NSNumber *number) { if (result) { *errorp = nil; } else { - NSDictionary *userInfo = - [NSDictionary dictionaryWithObject: errorDescription - forKey: NSLocalizedDescriptionKey]; + NSDictionary *userInfo = [NSDictionary + dictionaryWithObject: errorDescription + forKey: NSLocalizedDescriptionKey]; *errorp = [NSError errorWithDomain: NSCocoaErrorDomain code: 2048 userInfo: userInfo]; @@ -1720,8 +1722,8 @@ static BOOL numberIsPositive(NSNumber *number) { } - (BOOL) getObjectValue: (id *) object - forString: (NSString *) string - errorDescription: (NSString **) error + forString: (NSString *) string + errorDescription: (NSString **) error { if (object) { *object = nil; @@ -1732,15 +1734,17 @@ static BOOL numberIsPositive(NSNumber *number) { if ([self maximum] && value > [[self maximum] floatValue]) { if (error != NULL) { *error = NSLocalizedStringFromTableInBundle( - @"Number too big", nil, - [NSBundle bundleForClass: [NSNumberFormatter class]], @""); + @"Number too big", nil, + [NSBundle bundleForClass: [NSNumberFormatter class]], + @""); } number = nil; } else if ([self minimum] && value < [[self minimum] floatValue]) { if (error != NULL) { *error = NSLocalizedStringFromTableInBundle( - @"Number too smaller", nil, - [NSBundle bundleForClass: [NSNumberFormatter class]], @""); + @"Number too smaller", nil, + [NSBundle bundleForClass: [NSNumberFormatter class]], + @""); } number = nil; } else { diff --git a/Foundation/NSObjCRuntime.m b/Foundation/NSObjCRuntime.m index c9143fe5..375f3d02 100644 --- a/Foundation/NSObjCRuntime.m +++ b/Foundation/NSObjCRuntime.m @@ -64,14 +64,14 @@ static void NSLogDefaultCStringFunction(const char *string, unsigned length, BOOL withSyslogBanner) { NSString *message = - [[NSString alloc] initWithBytes: string - length: length - encoding: [NSString defaultCStringEncoding]]; + [[NSString alloc] initWithBytes: string + length: length + encoding: [NSString defaultCStringEncoding]]; if (withSyslogBanner) { NSString *date = [[NSDate date] - descriptionWithCalendarFormat: @"%Y-%m-%d %H:%M:%S.%F" - timeZone: [NSTimeZone systemTimeZone] - locale: nil]; + descriptionWithCalendarFormat: @"%Y-%m-%d %H:%M:%S.%F" + timeZone: [NSTimeZone systemTimeZone] + locale: nil]; NSString *process = [[NSProcessInfo processInfo] processName]; NSLogFormat(@"%@ %@[%d:%lx] %@", date, process, NSPlatformProcessID(), @@ -152,7 +152,7 @@ NSString *NSStringFromSelector(SEL selector) { const char *name = sel_getName(selector); return NSAutorelease(NSString_anyCStringNewWithBytes( - NSASCIIStringEncoding, NULL, name, strlen(name))); + NSASCIIStringEncoding, NULL, name, strlen(name))); } Class NSClassFromString(NSString *className) { @@ -175,5 +175,5 @@ NSString *NSStringFromClass(Class class) { const char *name = class_getName(class); return NSAutorelease(NSString_anyCStringNewWithBytes( - NSASCIIStringEncoding, NULL, name, strlen(name))); + NSASCIIStringEncoding, NULL, name, strlen(name))); } diff --git a/Foundation/NSObject/NSObject.m b/Foundation/NSObject/NSObject.m index 3d2fa5ed..bd39c937 100644 --- a/Foundation/NSObject/NSObject.m +++ b/Foundation/NSObject/NSObject.m @@ -56,7 +56,7 @@ BOOL NSObjectIsKindOfClass(id object, Class kindOf) { @interface NSInvocation (private) + (NSInvocation *) invocationWithMethodSignature: - (NSMethodSignature *) signature + (NSMethodSignature *) signature arguments: (void *) arguments; @end @@ -264,8 +264,8 @@ static IMP objc_msg_forward(id rcv, SEL message) { return nil; } else { NSInvocation *invocation = - [NSInvocation invocationWithMethodSignature: signature - arguments: arguments]; + [NSInvocation invocationWithMethodSignature: signature + arguments: arguments]; // char result[[signature methodReturnLength]]; id result; diff --git a/Foundation/NSObject/NSZombieObject.m b/Foundation/NSObject/NSZombieObject.m index e86886d6..8ccdf81c 100644 --- a/Foundation/NSObject/NSZombieObject.m +++ b/Foundation/NSObject/NSZombieObject.m @@ -31,8 +31,8 @@ void NSRegisterZombie(NSObject *object) { if (objectToClassName == NULL) { objectToClassName = - NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, - NSNonOwnedPointerMapValueCallBacks, 0); + NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, + NSNonOwnedPointerMapValueCallBacks, 0); } NSMapInsert(objectToClassName, object, object_getClass(object)); diff --git a/Foundation/NSObject/forwarding.m b/Foundation/NSObject/forwarding.m index 7ee36519..830706c0 100644 --- a/Foundation/NSObject/forwarding.m +++ b/Foundation/NSObject/forwarding.m @@ -32,7 +32,7 @@ static void OBJCRaiseException(const char *name, const char *format, ...) { @interface NSInvocation (private) + (NSInvocation *) invocationWithMethodSignature: - (NSMethodSignature *) signature + (NSMethodSignature *) signature arguments: (void *) arguments; @end @@ -52,14 +52,14 @@ void NSObjCForwardInvocation(void *returnValue, id object, SEL selector, va_list arguments) { NSMethodSignature *signature = - [object methodSignatureForSelector: selector]; + [object methodSignatureForSelector: selector]; if (signature == nil) [object doesNotRecognizeSelector: selector]; else { NSInvocation *invocation = - [NSInvocation invocationWithMethodSignature: signature - arguments: arguments]; + [NSInvocation invocationWithMethodSignature: signature + arguments: arguments]; [object forwardInvocation: invocation]; [invocation getReturnValue: returnValue]; @@ -119,7 +119,7 @@ id objc_msgForward(id object, SEL message, ...) { unsigned *frame; if ((method = class_getInstanceMethod( - class, @selector(_frameLengthForSelector:))) == NULL) { + class, @selector(_frameLengthForSelector:))) == NULL) { OBJCRaiseException("OBJCDoesNotRecognizeSelector", "%c[%s %s(%d)]", class_isMetaClass(class) ? '+' : '-', class_getName(class), sel_getName(message), message); @@ -136,7 +136,7 @@ id objc_msgForward(id object, SEL message, ...) { } if ((method = class_getInstanceMethod( - class, @selector(forwardSelector:arguments:))) != NULL) { + class, @selector(forwardSelector:arguments:))) != NULL) { imp = method_getImplementation(method); return imp(object, @selector(forwardSelector:arguments:), message, @@ -160,7 +160,7 @@ id objc_msgForward(id object, SEL message, ...) { void *arguments = &object; if ((method = class_getInstanceMethod( - class, @selector(forwardSelector:arguments:))) != NULL) { + class, @selector(forwardSelector:arguments:))) != NULL) { IMP imp = method_getImplementation(method); return imp(object, @selector(forwardSelector:arguments:), message, diff --git a/Foundation/NSObject/objc_forward_ffi.m b/Foundation/NSObject/objc_forward_ffi.m index 1e2a2134..d8dc8578 100644 --- a/Foundation/NSObject/objc_forward_ffi.m +++ b/Foundation/NSObject/objc_forward_ffi.m @@ -331,14 +331,14 @@ static void invocation_closure(ffi_cif *cif, void *result, void **args, if (!_closureInfo) { NSInteger i, numArgs = [self numberOfArguments]; ffi_type **arg_type = - NSZoneCalloc(NULL, sizeof(ffi_type *), numArgs); + NSZoneCalloc(NULL, sizeof(ffi_type *), numArgs); ffi_type *ret_type = - signature_to_ffi_return_type([self methodReturnType]); + signature_to_ffi_return_type([self methodReturnType]); for (i = 0; i < numArgs; i++) { arg_type[i] = - signature_to_ffi_type([self getArgumentTypeAtIndex: i]); + signature_to_ffi_type([self getArgumentTypeAtIndex: i]); } _closureInfo = NSZoneCalloc(NULL, sizeof(ffi_cif), 1); @@ -385,8 +385,8 @@ static void invocation_closure(ffi_cif *cif, void *result, void **args, } #if defined(GCC_RUNTIME_3) || defined(APPLE_RUNTIME_4) - IMP imp = - class_getMethodImplementation(object_getClass(target), [self selector]); + IMP imp = class_getMethodImplementation(object_getClass(target), + [self selector]); #else IMP imp = objc_msg_lookup(target, [self selector]); #endif diff --git a/Foundation/NSOperation/NSAtomicList.m b/Foundation/NSOperation/NSAtomicList.m index 4995e022..ccf73df2 100644 --- a/Foundation/NSOperation/NSAtomicList.m +++ b/Foundation/NSOperation/NSAtomicList.m @@ -43,8 +43,8 @@ void NSAtomicListInsert(NSAtomicListRef *listPtr, void *elt) { do { node->next = *listPtr; - } while ( - !OSAtomicCompareAndSwapPtrBarrier(node->next, node, (void **) listPtr)); + } while (!OSAtomicCompareAndSwapPtrBarrier(node->next, node, + (void **) listPtr)); } NSAtomicListRef NSAtomicListSteal(NSAtomicListRef *listPtr) { diff --git a/Foundation/NSOperation/NSOperation.m b/Foundation/NSOperation/NSOperation.m index 7aac261c..bda26a8b 100644 --- a/Foundation/NSOperation/NSOperation.m +++ b/Foundation/NSOperation/NSOperation.m @@ -164,9 +164,9 @@ static NSString *NSStringFromQueuePriority(NSOperationQueuePriority priority) { @end NSString *const NSInvocationOperationVoidResultException = - @"NSInvocationOperationVoidResultException"; + @"NSInvocationOperationVoidResultException"; NSString *const NSInvocationOperationCancelledException = - @"NSInvocationOperationCancelledException"; + @"NSInvocationOperationCancelledException"; @implementation NSInvocationOperation @@ -182,9 +182,9 @@ NSString *const NSInvocationOperationCancelledException = - initWithTarget: target selector: (SEL) selector object: argument { NSMethodSignature *signature = - [target methodSignatureForSelector: selector]; + [target methodSignatureForSelector: selector]; NSInvocation *invocation = - [NSInvocation invocationWithMethodSignature: signature]; + [NSInvocation invocationWithMethodSignature: signature]; [invocation setTarget: target]; [invocation setSelector: selector]; @@ -226,8 +226,8 @@ NSString *const NSInvocationOperationCancelledException = - (NSString *) description { return [NSString - stringWithFormat: @"%@, selector: %@", [super description], - NSStringFromSelector([_invocation selector])]; + stringWithFormat: @"%@, selector: %@", [super description], + NSStringFromSelector([_invocation selector])]; } @end diff --git a/Foundation/NSPortNameServer/NSSocketPortNameServer.h b/Foundation/NSPortNameServer/NSSocketPortNameServer.h index 6d9a114c..535d1762 100644 --- a/Foundation/NSPortNameServer/NSSocketPortNameServer.h +++ b/Foundation/NSPortNameServer/NSSocketPortNameServer.h @@ -29,15 +29,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) setDefaultNameServerPortNumber: (uint16_t) number; - (NSPort *) portForName: (NSString *) name - host: (NSString *) host - nameServerPortNumber: (uint16_t) number; + host: (NSString *) host + nameServerPortNumber: (uint16_t) number; - (NSPort *) portForName: (NSString *) name host: (NSString *) host; - (NSPort *) portForName: (NSString *) name; - (BOOL) registerPort: (NSPort *) port name: (NSString *) name; - (BOOL) registerPort: (NSPort *) port - name: (NSString *) name - nameServerPortNumber: (uint16_t) number; + name: (NSString *) name + nameServerPortNumber: (uint16_t) number; - (BOOL) removePortForName: (NSString *) name; diff --git a/Foundation/NSPortNameServer/NSSocketPortNameServer.m b/Foundation/NSPortNameServer/NSSocketPortNameServer.m index ca3c40b7..ee7d33e1 100644 --- a/Foundation/NSPortNameServer/NSSocketPortNameServer.m +++ b/Foundation/NSPortNameServer/NSSocketPortNameServer.m @@ -37,8 +37,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSPort *) portForName: (NSString *) name - host: (NSString *) host - nameServerPortNumber: (uint16_t) number + host: (NSString *) host + nameServerPortNumber: (uint16_t) number { NSUnimplementedMethod(); return 0; @@ -60,8 +60,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) registerPort: (NSPort *) port - name: (NSString *) name - nameServerPortNumber: (uint16_t) number + name: (NSString *) name + nameServerPortNumber: (uint16_t) number { NSUnimplementedMethod(); return 0; diff --git a/Foundation/NSPredicate/NSComparisonPredicate.h b/Foundation/NSPredicate/NSComparisonPredicate.h index e2745806..da522072 100644 --- a/Foundation/NSPredicate/NSComparisonPredicate.h +++ b/Foundation/NSPredicate/NSComparisonPredicate.h @@ -66,11 +66,11 @@ enum { customSelector: (SEL) selector; + (NSPredicate *) - predicateWithLeftExpression: (NSExpression *) left - rightExpression: (NSExpression *) right - modifier: (NSComparisonPredicateModifier) modifier - type: (NSPredicateOperatorType) type - options: (NSUInteger) options; + predicateWithLeftExpression: (NSExpression *) left + rightExpression: (NSExpression *) right + modifier: (NSComparisonPredicateModifier) modifier + type: (NSPredicateOperatorType) type + options: (NSUInteger) options; + (NSPredicate *) predicateWithLeftExpression: (NSExpression *) left rightExpression: (NSExpression *) right customSelector: (SEL) selector; diff --git a/Foundation/NSPredicate/NSComparisonPredicate.m b/Foundation/NSPredicate/NSComparisonPredicate.m index 8de3cc27..e94c045a 100644 --- a/Foundation/NSPredicate/NSComparisonPredicate.m +++ b/Foundation/NSPredicate/NSComparisonPredicate.m @@ -76,11 +76,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + (NSPredicate *) - predicateWithLeftExpression: (NSExpression *) left - rightExpression: (NSExpression *) right - modifier: (NSComparisonPredicateModifier) modifier - type: (NSPredicateOperatorType) type - options: (NSUInteger) options + predicateWithLeftExpression: (NSExpression *) left + rightExpression: (NSExpression *) right + modifier: (NSComparisonPredicateModifier) modifier + type: (NSPredicateOperatorType) type + options: (NSUInteger) options { return [[[self alloc] initWithLeftExpression: left rightExpression: right @@ -174,8 +174,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // FIX, not right case NSCustomSelectorPredicateOperatorType: - operator= [NSString - stringWithFormat: @"@selector(%s)", sel_getName(_customSelector)]; + operator= [NSString stringWithFormat: @"@selector(%s)", + sel_getName(_customSelector)]; break; } @@ -187,9 +187,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSPredicate *) predicateWithSubstitutionVariables: (NSDictionary *) variables { NSExpression *left = - [_left _expressionWithSubstitutionVariables: variables]; + [_left _expressionWithSubstitutionVariables: variables]; NSExpression *right = - [_right _expressionWithSubstitutionVariables: variables]; + [_right _expressionWithSubstitutionVariables: variables]; if (_type != NSCustomSelectorPredicateOperatorType) return [NSComparisonPredicate predicateWithLeftExpression: left @@ -199,9 +199,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ options: _options]; else return [NSComparisonPredicate - predicateWithLeftExpression: left - rightExpression: right - customSelector: _customSelector]; + predicateWithLeftExpression: left + rightExpression: right + customSelector: _customSelector]; } - (NSExpression *) leftExpression { @@ -234,7 +234,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ BOOL selfIsNil = (leftResult == nil || [leftResult isEqual: [NSNull null]]); BOOL objectIsNil = - (rightResult == nil || [rightResult isEqual: [NSNull null]]); + (rightResult == nil || [rightResult isEqual: [NSNull null]]); if (selfIsNil || objectIsNil) return (selfIsNil == objectIsNil && @@ -288,8 +288,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return ([leftResult compare: rightResult options: compareOptions range: range] == NSOrderedSame) - ? YES - : NO; + ? YES + : NO; } case NSEndsWithPredicateOperatorType: { @@ -299,20 +299,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return ([leftResult compare: rightResult options: compareOptions range: range] == NSOrderedSame) - ? YES - : NO; + ? YES + : NO; } case NSInPredicateOperatorType: return ([leftResult rangeOfString: rightResult options: compareOptions] - .location != NSNotFound) - ? YES - : NO; + .location != NSNotFound) + ? YES + : NO; case NSCustomSelectorPredicateOperatorType: { BOOL(*function) (id, SEL, id) = (BOOL(*)( - id, SEL, id)) [leftResult methodForSelector: _customSelector]; + id, SEL, id)) [leftResult methodForSelector: _customSelector]; return function(leftResult, _customSelector, rightResult); } @@ -341,10 +341,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([[self leftExpression] expressionType] != NSKeyPathExpressionType || !([leftValue isKindOfClass: [NSArray class]] || [leftValue isKindOfClass: [NSSet class]])) - [NSException - raise: NSInvalidArgumentException - format: @"The left hand side for an ALL or ANY operator must " - @"be either an NSArray or an NSSet"]; + [NSException raise: NSInvalidArgumentException + format: @"The left hand side for an ALL or ANY " + @"operator must " + @"be either an NSArray or an NSSet"]; [values addObjectsFromArray: leftValue]; } diff --git a/Foundation/NSPredicate/NSCompoundPredicate.h b/Foundation/NSPredicate/NSCompoundPredicate.h index cb436f80..d87eeef3 100644 --- a/Foundation/NSPredicate/NSCompoundPredicate.h +++ b/Foundation/NSPredicate/NSCompoundPredicate.h @@ -30,7 +30,7 @@ typedef enum { } - initWithType: (NSCompoundPredicateType) type - subpredicates: (NSArray *) subpredicates; + subpredicates: (NSArray *) subpredicates; + (NSPredicate *) notPredicateWithSubpredicate: (NSPredicate *) predicate; + (NSPredicate *) andPredicateWithSubpredicates: (NSArray *) predicates; diff --git a/Foundation/NSPredicate/NSCompoundPredicate.m b/Foundation/NSPredicate/NSCompoundPredicate.m index 9eddb133..6c337f6d 100644 --- a/Foundation/NSPredicate/NSCompoundPredicate.m +++ b/Foundation/NSPredicate/NSCompoundPredicate.m @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSCompoundPredicate - initWithType: (NSCompoundPredicateType) type - subpredicates: (NSArray *) predicates + subpredicates: (NSArray *) predicates { _type = type; _predicates = [predicates retain]; @@ -38,7 +38,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSPredicate *) notPredicateWithSubpredicate: (NSPredicate *) predicate { return [[[self alloc] initWithType: NSNotPredicateType subpredicates: [NSArray arrayWithObject: predicate]] - autorelease]; + autorelease]; } + (NSPredicate *) andPredicateWithSubpredicates: (NSArray *) predicates { diff --git a/Foundation/NSPredicate/NSExpression.h b/Foundation/NSPredicate/NSExpression.h index 747087d5..7e8d5e80 100644 --- a/Foundation/NSPredicate/NSExpression.h +++ b/Foundation/NSPredicate/NSExpression.h @@ -54,6 +54,6 @@ typedef enum { // private - (NSExpression *) _expressionWithSubstitutionVariables: - (NSDictionary *) variables; + (NSDictionary *) variables; @end diff --git a/Foundation/NSPredicate/NSExpression.m b/Foundation/NSPredicate/NSExpression.m index 716f85e5..0c8f8f1b 100644 --- a/Foundation/NSPredicate/NSExpression.m +++ b/Foundation/NSPredicate/NSExpression.m @@ -51,7 +51,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSExpression *) expressionForConstantValue: value { return [[[NSExpression_constant allocWithZone: NULL] initWithValue: value] - autorelease]; + autorelease]; } + (NSExpression *) expressionForEvaluatedObject { @@ -60,20 +60,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSExpression *) expressionForVariable: (NSString *) string { return [[[NSExpression_variable allocWithZone: NULL] - initWithVariable: string] autorelease]; + initWithVariable: string] autorelease]; } + (NSExpression *) expressionForKeyPath: (NSString *) keyPath { return [[[NSExpression_keypath allocWithZone: NULL] - initWithKeyPath: keyPath] autorelease]; + initWithKeyPath: keyPath] autorelease]; } + (NSExpression *) expressionForFunction: (NSString *) name arguments: (NSArray *) arguments { return [[[NSExpression_function allocWithZone: NULL] - initWithName: name - arguments: arguments] autorelease]; + initWithName: name + arguments: arguments] autorelease]; } + (NSExpression *) expressionForKeyPathLeft: (NSExpression *) left @@ -132,7 +132,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSExpression *) _expressionWithSubstitutionVariables: - (NSDictionary *) variables + (NSDictionary *) variables { return self; } diff --git a/Foundation/NSPredicate/NSExpression_array.m b/Foundation/NSPredicate/NSExpression_array.m index 81249fe0..0c4a5305 100644 --- a/Foundation/NSPredicate/NSExpression_array.m +++ b/Foundation/NSPredicate/NSExpression_array.m @@ -44,17 +44,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSExpression *) _expressionWithSubstitutionVariables: - (NSDictionary *) variables + (NSDictionary *) variables { NSMutableArray *array = [NSMutableArray array]; NSInteger i, count = [_array count]; for (i = 0; i < count; i++) [array addObject: [[_array objectAtIndex: i] - _expressionWithSubstitutionVariables: variables]]; + _expressionWithSubstitutionVariables: + variables]]; return [[[NSExpression_array allocWithZone: NULL] initWithArray: array] - autorelease]; + autorelease]; } @end diff --git a/Foundation/NSPredicate/NSExpression_assignment.m b/Foundation/NSPredicate/NSExpression_assignment.m index 85bab3ab..6c406bf6 100644 --- a/Foundation/NSPredicate/NSExpression_assignment.m +++ b/Foundation/NSPredicate/NSExpression_assignment.m @@ -39,9 +39,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSExpression *) expressionWithVariable: (NSExpression *) variable expression: (NSExpression *) expression { - return - [[[self allocWithZone: NULL] initWithVariable: variable - expression: expression] autorelease]; + return [[[self allocWithZone: NULL] initWithVariable: variable + expression: expression] + autorelease]; } - (NSString *) description { @@ -54,7 +54,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSExpression *) _expressionWithSubstitutionVariables: - (NSDictionary *) variables + (NSDictionary *) variables { // FIX? return self; diff --git a/Foundation/NSPredicate/NSExpression_function.m b/Foundation/NSPredicate/NSExpression_function.m index 0958719f..151fd3c7 100644 --- a/Foundation/NSPredicate/NSExpression_function.m +++ b/Foundation/NSPredicate/NSExpression_function.m @@ -63,14 +63,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSExpression *) _expressionWithSubstitutionVariables: - (NSDictionary *) variables + (NSDictionary *) variables { NSMutableArray *array = [NSMutableArray array]; NSInteger i, count = [_arguments count]; for (i = 0; i < count; i++) [array addObject: [[_arguments objectAtIndex: i] - _expressionWithSubstitutionVariables: variables]]; + _expressionWithSubstitutionVariables: + variables]]; return [NSExpression expressionForFunction: _name arguments: array]; } diff --git a/Foundation/NSPredicate/NSExpression_operator.m b/Foundation/NSPredicate/NSExpression_operator.m index b795b16c..8de4ebf5 100644 --- a/Foundation/NSPredicate/NSExpression_operator.m +++ b/Foundation/NSPredicate/NSExpression_operator.m @@ -118,14 +118,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSExpression *) _expressionWithSubstitutionVariables: - (NSDictionary *) variables + (NSDictionary *) variables { NSMutableArray *array = [NSMutableArray array]; NSInteger i, count = [_arguments count]; for (i = 0; i < count; i++) [array addObject: [[_arguments objectAtIndex: i] - _expressionWithSubstitutionVariables: variables]]; + _expressionWithSubstitutionVariables: + variables]]; return [NSExpression_operator expressionForOperator: _operator arguments: array]; diff --git a/Foundation/NSPredicate/NSExpression_variable.m b/Foundation/NSPredicate/NSExpression_variable.m index f6ec9dd8..00accd8f 100644 --- a/Foundation/NSPredicate/NSExpression_variable.m +++ b/Foundation/NSPredicate/NSExpression_variable.m @@ -48,13 +48,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSExpression *) _expressionWithSubstitutionVariables: - (NSDictionary *) variables + (NSDictionary *) variables { id constant = [variables objectForKey: _name]; return (constant == nil) - ? (NSExpression *) self - : [NSExpression expressionForConstantValue: constant]; + ? (NSExpression *) self + : [NSExpression expressionForConstantValue: constant]; } @end diff --git a/Foundation/NSPredicate/NSPredicate.h b/Foundation/NSPredicate/NSPredicate.h index 9bf0ce80..4be7b48f 100644 --- a/Foundation/NSPredicate/NSPredicate.h +++ b/Foundation/NSPredicate/NSPredicate.h @@ -35,7 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) predicateFormat; - (NSPredicate *) predicateWithSubstitutionVariables: - (NSDictionary *) variables; + (NSDictionary *) variables; - (BOOL) evaluateWithObject: object; diff --git a/Foundation/NSPredicate/NSPredicate.m b/Foundation/NSPredicate/NSPredicate.m index 2d22e82b..020d5212 100644 --- a/Foundation/NSPredicate/NSPredicate.m +++ b/Foundation/NSPredicate/NSPredicate.m @@ -125,9 +125,9 @@ static void raiseError(predicateScanner *scanner, NSString *format, ...) { va_end(arguments); [NSException - raise: NSInvalidArgumentException - format: @"Unable to parse the format string \"%@\", reason = %@", - scanner->original, reason]; + raise: NSInvalidArgumentException + format: @"Unable to parse the format string \"%@\", reason = %@", + scanner->original, reason]; } static int classifyToken(NSString *token) { @@ -244,8 +244,8 @@ static int scanToken(predicateScanner *scanner, id *token) { for (; scanner->position <= scanner->length; scanner->position++) { unichar code = (scanner->position < scanner->length) - ? scanner->unicode[scanner->position] - : 0xFFFF; + ? scanner->unicode[scanner->position] + : 0xFFFF; switch (state) { @@ -365,8 +365,9 @@ static int scanToken(predicateScanner *scanner, id *token) { default: *token = [NSString - stringWithCharacters: scanner->unicode + tokenLocation - length: (scanner->position - tokenLocation)]; + stringWithCharacters: scanner->unicode + tokenLocation + length: (scanner->position - + tokenLocation)]; return identifyReservedWords ? classifyToken(*token) : predTokenIdentifier; } @@ -505,8 +506,9 @@ static int scanToken(predicateScanner *scanner, id *token) { currentExponent = currentExponent * 10 + (code - '0'); else { *token = [NSNumber - numberWithDouble: currentSign * currentReal * - pow(10, exponentSign * currentExponent)]; + numberWithDouble: currentSign * currentReal * + pow(10, + exponentSign * currentExponent)]; return predTokenNumeric; } break; @@ -527,12 +529,14 @@ static int scanToken(predicateScanner *scanner, id *token) { if (code == '\\') { state = STATE_STRING_DOUBLE_ESCAPE; buffer = [NSMutableString - stringWithCharacters: scanner->unicode + tokenLocation - length: (scanner->position - tokenLocation)]; + stringWithCharacters: scanner->unicode + tokenLocation + length: (scanner->position - + tokenLocation)]; } else if (code == '\"') { *token = [NSString - stringWithCharacters: scanner->unicode + tokenLocation - length: (scanner->position - tokenLocation)]; + stringWithCharacters: scanner->unicode + tokenLocation + length: (scanner->position - + tokenLocation)]; scanner->position++; return predTokenString; } @@ -575,8 +579,8 @@ static int scanToken(predicateScanner *scanner, id *token) { state = STATE_STRING_DOUBLE_BUFFERED; } else { scanner->position--; - [buffer - appendFormat: @"x%C", scanner->unicode[scanner->position]]; + [buffer appendFormat: @"x%C", + scanner->unicode[scanner->position]]; state = STATE_STRING_DOUBLE_BUFFERED; } break; @@ -585,12 +589,14 @@ static int scanToken(predicateScanner *scanner, id *token) { if (code == '\\') { state = STATE_STRING_SINGLE_ESCAPE; buffer = [NSMutableString - stringWithCharacters: scanner->unicode + tokenLocation - length: (scanner->position - tokenLocation)]; + stringWithCharacters: scanner->unicode + tokenLocation + length: (scanner->position - + tokenLocation)]; } else if (code == '\'') { *token = [NSString - stringWithCharacters: scanner->unicode + tokenLocation - length: (scanner->position - tokenLocation)]; + stringWithCharacters: scanner->unicode + tokenLocation + length: (scanner->position - + tokenLocation)]; scanner->position++; return predTokenString; } @@ -633,8 +639,8 @@ static int scanToken(predicateScanner *scanner, id *token) { state = STATE_STRING_SINGLE_BUFFERED; } else { scanner->position--; - [buffer - appendFormat: @"x%C", scanner->unicode[scanner->position]]; + [buffer appendFormat: @"x%C", + scanner->unicode[scanner->position]]; state = STATE_STRING_SINGLE_BUFFERED; } break; @@ -763,10 +769,10 @@ static NSExpression *nextFunctionExpression(predicateScanner *scanner, static id nextArgumentFromArray(predicateScanner *scanner) { if (scanner->nextArgument >= [scanner->argumentArray count]) - raiseError( - scanner, - @"Insufficient arguments for conversion characters specified in " - @"format string"); // FIX, the string is actually the reason + raiseError(scanner, + @"Insufficient arguments for conversion characters " + @"specified in " + @"format string"); // FIX, the string is actually the reason return [scanner->argumentArray objectAtIndex: scanner->nextArgument++]; } @@ -801,8 +807,8 @@ static id shortArgument(predicateScanner *scanner) { static id unsignedShortArgument(predicateScanner *scanner) { if (scanner->nextArgument < 0) - return - [NSNumber numberWithUnsignedShort: va_arg(scanner->arguments, int)]; + return [NSNumber + numberWithUnsignedShort: va_arg(scanner->arguments, int)]; else return nextArgumentFromArray(scanner); } @@ -828,32 +834,32 @@ static id longArgument(predicateScanner *scanner) { static id longLongArgument(predicateScanner *scanner) { if (scanner->nextArgument < 0) return [NSNumber - numberWithLongLong: va_arg(scanner->arguments, long long)]; + numberWithLongLong: va_arg(scanner->arguments, long long)]; else return nextArgumentFromArray(scanner); } static id unsignedIntArgument(predicateScanner *scanner) { if (scanner->nextArgument < 0) - return [NSNumber - numberWithUnsignedInt: va_arg(scanner->arguments, unsigned int)]; + return [NSNumber numberWithUnsignedInt: va_arg(scanner->arguments, + unsigned int)]; else return nextArgumentFromArray(scanner); } static id unsignedLongArgument(predicateScanner *scanner) { if (scanner->nextArgument < 0) - return [NSNumber - numberWithUnsignedLong: va_arg(scanner->arguments, unsigned long)]; + return [NSNumber numberWithUnsignedLong: va_arg(scanner->arguments, + unsigned long)]; else return nextArgumentFromArray(scanner); } static id unsignedLongLongArgument(predicateScanner *scanner) { if (scanner->nextArgument < 0) - return - [NSNumber numberWithUnsignedLongLong: va_arg(scanner->arguments, - unsigned long long)]; + return [NSNumber + numberWithUnsignedLongLong: va_arg(scanner->arguments, + unsigned long long)]; else return nextArgumentFromArray(scanner); } @@ -889,8 +895,8 @@ static NSExpression *nextFormatCharacter(predicateScanner *scanner) { for (; scanner->position <= scanner->length;) { unichar unicode = (scanner->position < scanner->length) - ? scanner->unicode[scanner->position++] - : 0xFFFF; + ? scanner->unicode[scanner->position++] + : 0xFFFF; switch (state) { @@ -950,15 +956,15 @@ static NSExpression *nextFormatCharacter(predicateScanner *scanner) { case 'c': return [NSExpression - expressionForConstantValue: charArgument(scanner)]; + expressionForConstantValue: charArgument(scanner)]; case 'C': return [NSExpression - expressionForConstantValue: unicharArgument(scanner)]; + expressionForConstantValue: unicharArgument(scanner)]; case 's': return [NSExpression - expressionForConstantValue: cStringArgument(scanner)]; + expressionForConstantValue: cStringArgument(scanner)]; break; case 'f': { @@ -988,18 +994,18 @@ static NSExpression *nextFormatCharacter(predicateScanner *scanner) { case 'p': return [NSExpression - expressionForConstantValue: objectArgument(scanner)]; + expressionForConstantValue: objectArgument(scanner)]; case '@': return [NSExpression - expressionForConstantValue: objectArgument(scanner)]; + expressionForConstantValue: objectArgument(scanner)]; case '%': return [NSExpression expressionForConstantValue: @"%"]; case 'K': return [NSExpression - expressionForKeyPath: objectArgument(scanner)]; + expressionForKeyPath: objectArgument(scanner)]; default: raiseError(scanner, @"Invalid format character %C", unicode); @@ -1079,12 +1085,12 @@ static NSExpression *nextPrimaryExpression(predicateScanner *scanner) { case predToken_TRUE: skipToken(scanner); return [NSExpression - expressionForConstantValue: [NSNumber numberWithBool: YES]]; + expressionForConstantValue: [NSNumber numberWithBool: YES]]; case predToken_FALSE: skipToken(scanner); return [NSExpression - expressionForConstantValue: [NSNumber numberWithBool: NO]]; + expressionForConstantValue: [NSNumber numberWithBool: NO]]; case predToken_SELF: skipToken(scanner); @@ -1124,9 +1130,10 @@ static NSExpression *nextKeypathExpression(predicateScanner *scanner) { raiseError(scanner, @"Expecting expression after ."); left = [NSExpression_operator - expressionForOperator: NSExpressionOperatorKeypath - arguments: [NSArray - arrayWithObjects: left, right, nil]]; + expressionForOperator: NSExpressionOperatorKeypath + arguments: [NSArray arrayWithObjects: left, + right, + nil]]; break; case predTokenLeftBracket: @@ -1136,30 +1143,30 @@ static NSExpression *nextKeypathExpression(predicateScanner *scanner) { case predToken_FIRST: left = [NSExpression_operator - expressionForOperator: NSExpressionOperatorIndexFirst - arguments: [NSArray arrayWithObject: left]]; + expressionForOperator: NSExpressionOperatorIndexFirst + arguments: [NSArray arrayWithObject: left]]; break; case predToken_LAST: left = [NSExpression_operator - expressionForOperator: NSExpressionOperatorIndexLast - arguments: [NSArray arrayWithObject: left]]; + expressionForOperator: NSExpressionOperatorIndexLast + arguments: [NSArray arrayWithObject: left]]; break; case predToken_SIZE: left = [NSExpression_operator - expressionForOperator: NSExpressionOperatorIndexSize - arguments: [NSArray arrayWithObject: left]]; + expressionForOperator: NSExpressionOperatorIndexSize + arguments: [NSArray arrayWithObject: left]]; break; default: if ((right = nextExpression(scanner)) == nil) raiseError(scanner, @"Expecting expression after ["); left = [NSExpression_operator - expressionForOperator: NSExpressionOperatorIndex - arguments: [NSArray arrayWithObjects: left, - right, - nil]]; + expressionForOperator: NSExpressionOperatorIndex + arguments: [NSArray arrayWithObjects: left, + right, + nil]]; break; } expectTokenType(scanner, predTokenRightBracket); @@ -1185,11 +1192,11 @@ static NSExpression *nextUnaryExpression(predicateScanner *scanner) { if ([(NSExpression_operator *) right expressionType] == (int) NSExpressionOperatorNegate) return [[(NSExpression_operator *) right arguments] - objectAtIndex: 0]; + objectAtIndex: 0]; } return [NSExpression_operator - expressionForOperator: NSExpressionOperatorNegate - arguments: [NSArray arrayWithObject: right]]; + expressionForOperator: NSExpressionOperatorNegate + arguments: [NSArray arrayWithObject: right]]; } return nextKeypathExpression(scanner); @@ -1206,9 +1213,10 @@ static NSExpression *nextExponentiationExpression(predicateScanner *scanner) { if ((right = nextUnaryExpression(scanner)) == nil) raiseError(scanner, @"Expecting expression after **"); left = [NSExpression_operator - expressionForOperator: NSExpressionOperatorExp - arguments: [NSArray - arrayWithObjects: left, right, nil]]; + expressionForOperator: NSExpressionOperatorExp + arguments: [NSArray arrayWithObjects: left, + right, + nil]]; break; default: @@ -1229,9 +1237,10 @@ static NSExpression *nextMultiplicativeExpression(predicateScanner *scanner) { if ((right = nextExponentiationExpression(scanner)) == nil) raiseError(scanner, @"Expecting expression after *"); left = [NSExpression_operator - expressionForOperator: NSExpressionOperatorMultiply - arguments: [NSArray - arrayWithObjects: left, right, nil]]; + expressionForOperator: NSExpressionOperatorMultiply + arguments: [NSArray arrayWithObjects: left, + right, + nil]]; break; case predTokenSlash: @@ -1239,9 +1248,10 @@ static NSExpression *nextMultiplicativeExpression(predicateScanner *scanner) { if ((right = nextExponentiationExpression(scanner)) == nil) raiseError(scanner, @"Expecting expression after /"); left = [NSExpression_operator - expressionForOperator: NSExpressionOperatorDivide - arguments: [NSArray - arrayWithObjects: left, right, nil]]; + expressionForOperator: NSExpressionOperatorDivide + arguments: [NSArray arrayWithObjects: left, + right, + nil]]; break; default: @@ -1262,9 +1272,10 @@ static NSExpression *nextAdditiveExpression(predicateScanner *scanner) { if ((right = nextMultiplicativeExpression(scanner)) == nil) raiseError(scanner, @"Expecting expression after +"); left = [NSExpression_operator - expressionForOperator: NSExpressionOperatorAdd - arguments: [NSArray - arrayWithObjects: left, right, nil]]; + expressionForOperator: NSExpressionOperatorAdd + arguments: [NSArray arrayWithObjects: left, + right, + nil]]; break; case predTokenMinus: @@ -1272,9 +1283,10 @@ static NSExpression *nextAdditiveExpression(predicateScanner *scanner) { if ((right = nextMultiplicativeExpression(scanner)) == nil) raiseError(scanner, @"Expecting expression after -"); left = [NSExpression_operator - expressionForOperator: NSExpressionOperatorSubtract - arguments: [NSArray - arrayWithObjects: left, right, nil]]; + expressionForOperator: NSExpressionOperatorSubtract + arguments: [NSArray arrayWithObjects: left, + right, + nil]]; break; default: @@ -1442,42 +1454,42 @@ static NSPredicate *nextComparisonPredicate(predicateScanner *scanner) { nextOperationOption(scanner, &options); right = nextExpression(scanner); result = [NSComparisonPredicate - predicateWithLeftExpression: left - rightExpression: right - modifier: modifier - type: NSInPredicateOperatorType - options: options]; + predicateWithLeftExpression: left + rightExpression: right + modifier: modifier + type: NSInPredicateOperatorType + options: options]; break; case predToken_BETWEEN: skipToken(scanner); right = nextExpression(scanner); { NSExpression *rightFirst = [NSExpression_operator - expressionForOperator: NSExpressionOperatorIndexFirst - arguments: [NSArray arrayWithObject: right]]; + expressionForOperator: NSExpressionOperatorIndexFirst + arguments: [NSArray + arrayWithObject: right]]; NSPredicate *greaterOrEqual = [NSComparisonPredicate - predicateWithLeftExpression: left - rightExpression: rightFirst - modifier: NSDirectPredicateModifier - type: - NSGreaterThanOrEqualToPredicateOperatorType - options: 0]; + predicateWithLeftExpression: left + rightExpression: rightFirst + modifier: NSDirectPredicateModifier + type: NSGreaterThanOrEqualToPredicateOperatorType + options: 0]; NSExpression *rightLast = [NSExpression_operator - expressionForOperator: NSExpressionOperatorIndexLast - arguments: [NSArray arrayWithObject: right]]; + expressionForOperator: NSExpressionOperatorIndexLast + arguments: [NSArray + arrayWithObject: right]]; NSPredicate *lessOrEqual = [NSComparisonPredicate - predicateWithLeftExpression: left - rightExpression: rightLast - modifier: NSDirectPredicateModifier - type: - NSLessThanOrEqualToPredicateOperatorType - options: 0]; + predicateWithLeftExpression: left + rightExpression: rightLast + modifier: NSDirectPredicateModifier + type: NSLessThanOrEqualToPredicateOperatorType + options: 0]; result = [NSCompoundPredicate - andPredicateWithSubpredicates: - [NSArray arrayWithObjects: greaterOrEqual, lessOrEqual, - nil]]; + andPredicateWithSubpredicates: + [NSArray arrayWithObjects: greaterOrEqual, + lessOrEqual, nil]]; } break; @@ -1487,12 +1499,12 @@ static NSPredicate *nextComparisonPredicate(predicateScanner *scanner) { } right = nextExpression(scanner); - result = - [NSComparisonPredicate predicateWithLeftExpression: left - rightExpression: right - modifier: modifier - type: type - options: options]; + result = [NSComparisonPredicate + predicateWithLeftExpression: left + rightExpression: right + modifier: modifier + type: type + options: options]; break; } @@ -1543,7 +1555,7 @@ static NSPredicate *nextUnaryPredicate(predicateScanner *scanner) { if ([(NSCompoundPredicate *) right compoundPredicateType] == NSNotPredicateType) return [[(NSCompoundPredicate *) right subpredicates] - objectAtIndex: 0]; + objectAtIndex: 0]; } return [NSCompoundPredicate notPredicateWithSubpredicate: right]; @@ -1563,9 +1575,8 @@ static NSPredicate *nextConditionalAndPredicate(predicateScanner *scanner) { skipToken(scanner); right = nextUnaryPredicate(scanner); left = [NSCompoundPredicate - andPredicateWithSubpredicates: [NSArray arrayWithObjects: left, - right, - nil]]; + andPredicateWithSubpredicates: + [NSArray arrayWithObjects: left, right, nil]]; break; default: @@ -1584,9 +1595,8 @@ static NSPredicate *nextConditionalOrPredicate(predicateScanner *scanner) { skipToken(scanner); right = nextConditionalAndPredicate(scanner); left = [NSCompoundPredicate - orPredicateWithSubpredicates: [NSArray arrayWithObjects: left, - right, - nil]]; + orPredicateWithSubpredicates: + [NSArray arrayWithObjects: left, right, nil]]; break; default: @@ -1683,7 +1693,7 @@ static NSPredicate *nextTopLevelPredicate(predicateScanner *scanner) { + (NSPredicate *) predicateWithValue: (BOOL) value { return [[[NSPredicate_BOOL allocWithZone: NULL] initWithBool: value] - autorelease]; + autorelease]; } - (NSString *) predicateFormat { diff --git a/Foundation/NSProcessInfo.m b/Foundation/NSProcessInfo.m index 4ebd8a79..762b5c6d 100644 --- a/Foundation/NSProcessInfo.m +++ b/Foundation/NSProcessInfo.m @@ -116,27 +116,27 @@ const char *const *NSProcessInfoArgv = NULL; return [NSString stringWithFormat: @"Windows 8 %@", servicePack]; break; case -62: - return - [NSString stringWithFormat: @"Windows Server 2012 %@", servicePack]; + return [NSString + stringWithFormat: @"Windows Server 2012 %@", servicePack]; break; case 61: return [NSString stringWithFormat: @"Windows 7 %@", servicePack]; break; case -61: return [NSString - stringWithFormat: @"Windows Server 2008 R2 %@", servicePack]; + stringWithFormat: @"Windows Server 2008 R2 %@", servicePack]; break; case 60: return [NSString stringWithFormat: @"Windows Vista %@", servicePack]; break; case -60: return [NSString - stringWithFormat: @"Windows Server 2003 R2 %@", servicePack]; + stringWithFormat: @"Windows Server 2003 R2 %@", servicePack]; break; case 52: return [NSString - stringWithFormat: @"Windows XP Professional x64 Edition %@", - servicePack]; + stringWithFormat: @"Windows XP Professional x64 Edition %@", + servicePack]; break; case 51: return [NSString stringWithFormat: @"Windows XP %@", servicePack]; @@ -175,7 +175,7 @@ const char *const *NSProcessInfoArgv = NULL; if ([arguments count] > 0) _processName = [[[[[self arguments] objectAtIndex: 0] - lastPathComponent] stringByDeletingPathExtension] retain]; + lastPathComponent] stringByDeletingPathExtension] retain]; if (_processName == nil) { _processName = @""; diff --git a/Foundation/NSPropertyList/NSOldXMLAttribute.m b/Foundation/NSPropertyList/NSOldXMLAttribute.m index 4d856664..d37c758a 100644 --- a/Foundation/NSPropertyList/NSOldXMLAttribute.m +++ b/Foundation/NSPropertyList/NSOldXMLAttribute.m @@ -58,8 +58,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSString *) description { - return - [NSString stringWithFormat: @"<%@ %@=%@>", [self class], _name, _value]; + return [NSString + stringWithFormat: @"<%@ %@=%@>", [self class], _name, _value]; } @end diff --git a/Foundation/NSPropertyList/NSOldXMLReader.m b/Foundation/NSPropertyList/NSOldXMLReader.m index 825730aa..c914f733 100644 --- a/Foundation/NSPropertyList/NSOldXMLReader.m +++ b/Foundation/NSPropertyList/NSOldXMLReader.m @@ -179,8 +179,8 @@ enum { else { NSUInteger length; unichar *buffer = - NSUTF8ToUnicode((const char *) (_bytes + _range.location), - _range.length, &length, NULL); + NSUTF8ToUnicode((const char *) (_bytes + _range.location), + _range.length, &length, NULL); NSString *result = [[NSString alloc] initWithCharacters: buffer length: length]; diff --git a/Foundation/NSPropertyList/NSPropertyList.h b/Foundation/NSPropertyList/NSPropertyList.h index c7b54d4d..bbc7c790 100644 --- a/Foundation/NSPropertyList/NSPropertyList.h +++ b/Foundation/NSPropertyList/NSPropertyList.h @@ -35,15 +35,15 @@ typedef enum { @interface NSPropertyListSerialization : NSObject + (BOOL) propertyList: propertyList - isValidForFormat: (NSPropertyListFormat) format; + isValidForFormat: (NSPropertyListFormat) format; + (NSData *) dataFromPropertyList: plist format: (NSPropertyListFormat) format errorDescription: (NSString **) errorDescriptionp; + propertyListFromData: (NSData *) data - mutabilityOption: (NSPropertyListMutabilityOptions) mutability - format: (NSPropertyListFormat *) format - errorDescription: (NSString **) errorDescriptionp; + mutabilityOption: (NSPropertyListMutabilityOptions) mutability + format: (NSPropertyListFormat *) format + errorDescription: (NSString **) errorDescriptionp; @end diff --git a/Foundation/NSPropertyList/NSPropertyList.m b/Foundation/NSPropertyList/NSPropertyList.m index aa847aad..638f2f3d 100644 --- a/Foundation/NSPropertyList/NSPropertyList.m +++ b/Foundation/NSPropertyList/NSPropertyList.m @@ -27,7 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSPropertyListSerialization + (BOOL) propertyList: propertyList - isValidForFormat: (NSPropertyListFormat) format + isValidForFormat: (NSPropertyListFormat) format { NSUnimplementedMethod(); return NO; @@ -52,9 +52,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + propertyListFromData: (NSData *) data - mutabilityOption: (NSPropertyListMutabilityOptions) mutability - format: (NSPropertyListFormat *) format - errorDescription: (NSString **) errorDescriptionp + mutabilityOption: (NSPropertyListMutabilityOptions) mutability + format: (NSPropertyListFormat *) format + errorDescription: (NSString **) errorDescriptionp { id result; @@ -68,14 +68,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } if ((result = [NSPropertyListReader_binary1 - propertyListFromData: data]) != nil) { + propertyListFromData: data]) != nil) { if (format) *format = NSPropertyListBinaryFormat_v1_0; return result; } if ((result = [NSPropertyListReader_vintage - propertyListFromData: data]) != nil) { + propertyListFromData: data]) != nil) { if (format) *format = NSPropertyListOpenStepFormat; return result; diff --git a/Foundation/NSPropertyList/NSPropertyListReader.m b/Foundation/NSPropertyList/NSPropertyListReader.m index f36100dc..1c858b6c 100644 --- a/Foundation/NSPropertyList/NSPropertyListReader.m +++ b/Foundation/NSPropertyList/NSPropertyListReader.m @@ -47,10 +47,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } @catch (NSException *exception) { // Don't use NSLog here as we might be called from some early NSLog, // when formating the timestamp... - fprintf( - stderr, - "propertyListFromData: error while decoding plist content : %s\n", - [[exception description] UTF8String]); + fprintf(stderr, + "propertyListFromData: error while decoding plist content : " + "%s\n", + [[exception description] UTF8String]); result = nil; } @finally { } diff --git a/Foundation/NSPropertyList/NSPropertyListReader_binary1.m b/Foundation/NSPropertyList/NSPropertyListReader_binary1.m index 38a79e82..9444ad92 100644 --- a/Foundation/NSPropertyList/NSPropertyListReader_binary1.m +++ b/Foundation/NSPropertyList/NSPropertyListReader_binary1.m @@ -119,15 +119,15 @@ static inline double _readFloatOfSize(NSPropertyListReader_binary1 *self, NSUInteger trailerStart = _length - TRAILER_SIZE; _trailerOffsetIntSize = - _readIntOfSize(self, sizeof(_trailerOffsetIntSize), &trailerStart); + _readIntOfSize(self, sizeof(_trailerOffsetIntSize), &trailerStart); _trailerOffsetRefSize = - _readIntOfSize(self, sizeof(_trailerOffsetRefSize), &trailerStart); + _readIntOfSize(self, sizeof(_trailerOffsetRefSize), &trailerStart); _trailerNumObjects = - _readIntOfSize(self, sizeof(_trailerNumObjects), &trailerStart); + _readIntOfSize(self, sizeof(_trailerNumObjects), &trailerStart); _trailerTopObject = - _readIntOfSize(self, sizeof(_trailerTopObject), &trailerStart); - _trailerOffsetTableOffset = - _readIntOfSize(self, sizeof(_trailerOffsetTableOffset), &trailerStart); + _readIntOfSize(self, sizeof(_trailerTopObject), &trailerStart); + _trailerOffsetTableOffset = _readIntOfSize( + self, sizeof(_trailerOffsetTableOffset), &trailerStart); } static uint64_t ReadSizedInt(NSPropertyListReader_binary1 *bplist, @@ -225,7 +225,7 @@ static id _readObjectAtOffset(NSPropertyListReader_binary1 *self, if (topNibble == 0x1) { return [[NSNumber alloc] - initWithLongLong: _readIntOfSize(self, 1 << botNibble, offset)]; + initWithLongLong: _readIntOfSize(self, 1 << botNibble, offset)]; } if (topNibble == 0x2) { size_t size = 1 << botNibble; @@ -244,8 +244,9 @@ static id _readObjectAtOffset(NSPropertyListReader_binary1 *self, } if (topNibble == 0x3) { return [[NSDate alloc] - initWithTimeIntervalSinceReferenceDate: _readFloatOfSize(self, 8, - offset)]; + initWithTimeIntervalSinceReferenceDate: _readFloatOfSize( + self, 8, + offset)]; } if (topNibble == 0x4 || topNibble == 0x5 || topNibble == 0x6 || topNibble == 0x8 || topNibble == 0xA || topNibble == 0xD) { @@ -260,7 +261,7 @@ static id _readObjectAtOffset(NSPropertyListReader_binary1 *self, if (topNibble == 0x4) { return [[self->_data subdataWithRange: NSMakeRange(*offset, length)] - copy]; + copy]; } if (topNibble == 0x5) { return [[NSString alloc] initWithBytes: self->_bytes + *offset @@ -269,9 +270,9 @@ static id _readObjectAtOffset(NSPropertyListReader_binary1 *self, } if (topNibble == 0x6) { return [[NSString alloc] - initWithBytes: self->_bytes + *offset - length: length * 2 - encoding: NSUTF16BigEndianStringEncoding]; + initWithBytes: self->_bytes + *offset + length: length * 2 + encoding: NSUTF16BigEndianStringEncoding]; } if (topNibble == 0x8) { return ExtractUID(self, (*offset) - 1); @@ -328,7 +329,7 @@ static id _readInlineObjectAtOffset(NSPropertyListReader_binary1 *self, { // first read the offset table index out of the file NSUInteger objOffset = - _readIntOfSize(self, self->_trailerOffsetRefSize, offset); + _readIntOfSize(self, self->_trailerOffsetRefSize, offset); // then transform the index into an offset in the file which points to // that offset table entry diff --git a/Foundation/NSPropertyList/NSPropertyListReader_vintage.m b/Foundation/NSPropertyList/NSPropertyListReader_vintage.m index 61931fb3..98cd647e 100644 --- a/Foundation/NSPropertyList/NSPropertyListReader_vintage.m +++ b/Foundation/NSPropertyList/NSPropertyListReader_vintage.m @@ -67,22 +67,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } static BOOL _NSPropertyListNameSet[128] = { - NO, NO, NO, NO, NO, NO, NO, NO, - NO, NO, NO, NO, NO, NO, NO, NO, // 0 - NO, NO, NO, NO, NO, NO, NO, NO, - NO, NO, NO, NO, NO, NO, NO, NO, // 16 - NO, NO, NO, NO, YES, NO, NO, NO, - NO, NO, NO, NO, NO, NO, YES, YES, // 32 - YES, YES, YES, YES, YES, YES, YES, YES, - YES, YES, NO, NO, NO, NO, NO, NO, // 48 - NO, YES, YES, YES, YES, YES, YES, YES, - YES, YES, YES, YES, YES, YES, YES, YES, // 64 - YES, YES, YES, YES, YES, YES, YES, YES, - YES, YES, YES, NO, NO, NO, NO, YES, // 80 - NO, YES, YES, YES, YES, YES, YES, YES, - YES, YES, YES, YES, YES, YES, YES, YES, // 96 - YES, YES, YES, YES, YES, YES, YES, YES, - YES, YES, YES, NO, NO, NO, NO, NO, // 112 + NO, NO, NO, NO, NO, NO, NO, NO, + NO, NO, NO, NO, NO, NO, NO, NO, // 0 + NO, NO, NO, NO, NO, NO, NO, NO, + NO, NO, NO, NO, NO, NO, NO, NO, // 16 + NO, NO, NO, NO, YES, NO, NO, NO, + NO, NO, NO, NO, NO, NO, YES, YES, // 32 + YES, YES, YES, YES, YES, YES, YES, YES, + YES, YES, NO, NO, NO, NO, NO, NO, // 48 + NO, YES, YES, YES, YES, YES, YES, YES, + YES, YES, YES, YES, YES, YES, YES, YES, // 64 + YES, YES, YES, YES, YES, YES, YES, YES, + YES, YES, YES, NO, NO, NO, NO, YES, // 80 + NO, YES, YES, YES, YES, YES, YES, YES, + YES, YES, YES, YES, YES, YES, YES, YES, // 96 + YES, YES, YES, YES, YES, YES, YES, YES, + YES, YES, YES, NO, NO, NO, NO, NO, // 112 }; - (id) internalError: (id) class { @@ -91,11 +91,10 @@ static BOOL _NSPropertyListNameSet[128] = { for (i = 0; i < _stackSize; i++) [_stack[i] release]; - [NSException - raise: NSParseErrorException - format: - @"*** Parse error at position %d,line %d, expecting %@ on stack", - _index, _lineNumber, [class description]]; + [NSException raise: NSParseErrorException + format: @"*** Parse error at position %d,line %d, expecting %@ " + @"on stack", + _index, _lineNumber, [class description]]; return nil; } @@ -157,8 +156,8 @@ static inline void appendByte(NSPropertyListReader_vintage *self, uint8_t c) { if (self->_dataBufferSize >= self->_dataBufferCapacity) { self->_dataBufferCapacity *= 2; self->_dataBuffer = - NSZoneRealloc(NULL, self->_dataBuffer, - self->_dataBufferCapacity * sizeof(unichar)); + NSZoneRealloc(NULL, self->_dataBuffer, + self->_dataBufferCapacity * sizeof(unichar)); } self->_dataBuffer[self->_dataBufferSize++] = c; } @@ -350,8 +349,8 @@ static inline void appendByte(NSPropertyListReader_vintage *self, uint8_t c) { appendCharacter(self, code); else { NSString *string = [[NSString allocWithZone: NULL] - initWithCharacters: _buffer - length: _bufferSize]; + initWithCharacters: _buffer + length: _bufferSize]; pushObject(self, string); _index--; state = STATE_WHITESPACE; @@ -570,7 +569,7 @@ static inline void appendByte(NSPropertyListReader_vintage *self, uint8_t c) { + (NSObject *) propertyListFromData: (NSData *) data { NSPropertyListReader_vintage *reader = [[self alloc] initWithData: data]; NSObject *result = - [[[reader propertyListWithInfo: nil] retain] autorelease]; + [[[reader propertyListWithInfo: nil] retain] autorelease]; [reader release]; diff --git a/Foundation/NSPropertyList/NSPropertyListReader_xml1.m b/Foundation/NSPropertyList/NSPropertyListReader_xml1.m index 5ad2c1cf..e6cc2878 100644 --- a/Foundation/NSPropertyList/NSPropertyListReader_xml1.m +++ b/Foundation/NSPropertyList/NSPropertyListReader_xml1.m @@ -43,34 +43,34 @@ NSDate *NSDateFromPlistString(NSString *string) { NSString *str; [sc scanInt: &y]; [sc scanCharactersFromSet: [NSCharacterSet - characterSetWithCharactersInString: @"-"] + characterSetWithCharactersInString: @"-"] intoString: &str]; [sc scanInt: &mo]; [sc scanCharactersFromSet: [NSCharacterSet - characterSetWithCharactersInString: @"-"] + characterSetWithCharactersInString: @"-"] intoString: &str]; [sc scanInt: &d]; - [sc scanCharactersFromSet: [NSCharacterSet - characterSetWithCharactersInString: @"T "] + [sc scanCharactersFromSet: + [NSCharacterSet characterSetWithCharactersInString: @"T "] intoString: &str]; [sc scanInt: &h]; [sc scanCharactersFromSet: [NSCharacterSet - characterSetWithCharactersInString: @":"] + characterSetWithCharactersInString: @":"] intoString: &str]; [sc scanInt: &mi]; [sc scanCharactersFromSet: [NSCharacterSet - characterSetWithCharactersInString: @":"] + characterSetWithCharactersInString: @":"] intoString: &str]; [sc scanInt: &s]; NSCalendarDate *date = - [NSCalendarDate dateWithYear: y - month: mo - day: d - 1 - hour: h - minute: mi - second: s - timeZone: [NSTimeZone localTimeZone]]; + [NSCalendarDate dateWithYear: y + month: mo + day: d - 1 + hour: h + minute: mi + second: s + timeZone: [NSTimeZone localTimeZone]]; return date; } @@ -190,8 +190,8 @@ NSDate *NSDateFromPlistString(NSString *string) { NSInteger i, count = [strings count]; for (i = 0; i < count; i++) - [result appendData: [self dataFromBase64String: [strings - objectAtIndex: i]]]; + [result appendData: [self dataFromBase64String: + [strings objectAtIndex: i]]]; return result; } diff --git a/Foundation/NSPropertyList/NSPropertyListWriter_vintage.m b/Foundation/NSPropertyList/NSPropertyListWriter_vintage.m index 1027c252..c3140a38 100644 --- a/Foundation/NSPropertyList/NSPropertyListWriter_vintage.m +++ b/Foundation/NSPropertyList/NSPropertyListWriter_vintage.m @@ -27,22 +27,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSPropertyListWriter_vintage static BOOL _NSPropertyListNameSet[128] = { - NO, NO, NO, NO, NO, NO, NO, NO, - NO, NO, NO, NO, NO, NO, NO, NO, // 0 - NO, NO, NO, NO, NO, NO, NO, NO, - NO, NO, NO, NO, NO, NO, NO, NO, // 16 - NO, NO, NO, NO, YES, NO, NO, NO, - NO, NO, NO, NO, NO, NO, YES, YES, // 32 - YES, YES, YES, YES, YES, YES, YES, YES, - YES, YES, NO, NO, NO, NO, NO, NO, // 48 - NO, YES, YES, YES, YES, YES, YES, YES, - YES, YES, YES, YES, YES, YES, YES, YES, // 64 - YES, YES, YES, YES, YES, YES, YES, YES, - YES, YES, YES, NO, NO, NO, NO, YES, // 80 - NO, YES, YES, YES, YES, YES, YES, YES, - YES, YES, YES, YES, YES, YES, YES, YES, // 96 - YES, YES, YES, YES, YES, YES, YES, YES, - YES, YES, YES, NO, NO, NO, NO, NO, // 112 + NO, NO, NO, NO, NO, NO, NO, NO, + NO, NO, NO, NO, NO, NO, NO, NO, // 0 + NO, NO, NO, NO, NO, NO, NO, NO, + NO, NO, NO, NO, NO, NO, NO, NO, // 16 + NO, NO, NO, NO, YES, NO, NO, NO, + NO, NO, NO, NO, NO, NO, YES, YES, // 32 + YES, YES, YES, YES, YES, YES, YES, YES, + YES, YES, NO, NO, NO, NO, NO, NO, // 48 + NO, YES, YES, YES, YES, YES, YES, YES, + YES, YES, YES, YES, YES, YES, YES, YES, // 64 + YES, YES, YES, YES, YES, YES, YES, YES, + YES, YES, YES, NO, NO, NO, NO, YES, // 80 + NO, YES, YES, YES, YES, YES, YES, YES, + YES, YES, YES, YES, YES, YES, YES, YES, // 96 + YES, YES, YES, YES, YES, YES, YES, YES, + YES, YES, YES, NO, NO, NO, NO, NO, // 112 }; static NSInteger keySort(id key1, id key2, void *context) { @@ -213,7 +213,7 @@ static NSInteger keySort(id key1, id key2, void *context) { + (NSData *) nullTerminatedASCIIDataWithString: (NSString *) string { NSPropertyListWriter_vintage *writer = [[self alloc] init]; NSData *result = [[[writer nullTerminatedASCIIDataWithString: string] - retain] autorelease]; + retain] autorelease]; [writer release]; @@ -229,7 +229,7 @@ static NSInteger keySort(id key1, id key2, void *context) { + (NSData *) nullTerminatedASCIIDataWithPropertyList: plist { NSPropertyListWriter_vintage *writer = [[self alloc] init]; NSData *result = [[[writer nullTerminatedASCIIDataWithPropertyList: plist] - retain] autorelease]; + retain] autorelease]; [writer release]; @@ -249,8 +249,8 @@ static NSInteger keySort(id key1, id key2, void *context) { NSPropertyListWriter_vintage *writer = [[self alloc] init]; NSData *data = [writer dataForRootObject: plist]; NSString *result = [[[NSString allocWithZone: NULL] - initWithData: data - encoding: NSASCIIStringEncoding] autorelease]; + initWithData: data + encoding: NSASCIIStringEncoding] autorelease]; [writer release]; diff --git a/Foundation/NSPropertyList/NSPropertyListWriter_xml1.m b/Foundation/NSPropertyList/NSPropertyListWriter_xml1.m index e315a233..65893b7f 100644 --- a/Foundation/NSPropertyList/NSPropertyListWriter_xml1.m +++ b/Foundation/NSPropertyList/NSPropertyListWriter_xml1.m @@ -96,8 +96,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) encodeReal: (NSNumber *) number { [_data appendBytes: "" length: 6]; - [self _encodeString: [NSString - stringWithFormat: @"%.16f", [number doubleValue]]]; + [self _encodeString: [NSString stringWithFormat: @"%.16f", + [number doubleValue]]]; [_data appendBytes: "\n" length: 8]; } @@ -164,8 +164,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) encodeDictionary: (NSDictionary *) dictionary indent: (NSInteger) indent { - NSArray *allKeys = - [[dictionary allKeys] sortedArrayUsingSelector: @selector(compare:)]; + NSArray *allKeys = [[dictionary allKeys] + sortedArrayUsingSelector: @selector(compare:)]; NSUInteger i, count = [allKeys count]; @@ -188,7 +188,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) encodeData: (NSData *) data indent: (NSInteger) indent { static const char b64[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; NSUInteger y, n; const NSUInteger len = [data length]; @@ -199,7 +199,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ indent++; const NSUInteger numRows = - 1 + len / 45; // 60 chars per output row -> 45 input bytes per row + 1 + len / 45; // 60 chars per output row -> 45 input bytes per row uint8_t srcBuf[48]; uint8_t dstBuf[64]; @@ -220,18 +220,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ int x; for (x = 0; x < rowSrcLen; x += 3) { const NSInteger blockLen = - (x + 3 < rowSrcLen) ? 3 : (rowSrcLen - x); + (x + 3 < rowSrcLen) ? 3 : (rowSrcLen - x); // base64 encode outBuf[0] = b64[inBuf[0] >> 2]; outBuf[1] = - b64[((inBuf[0] & 0x03) << 4) | ((inBuf[1] & 0xf0) >> 4)]; - outBuf[2] = - (unsigned char) (blockLen > 1) - ? b64[((inBuf[1] & 0x0f) << 2) | ((inBuf[2] & 0xc0) >> 6)] - : '='; + b64[((inBuf[0] & 0x03) << 4) | ((inBuf[1] & 0xf0) >> 4)]; + outBuf[2] = (unsigned char) (blockLen > 1) + ? b64[((inBuf[1] & 0x0f) << 2) | + ((inBuf[2] & 0xc0) >> 6)] + : '='; outBuf[3] = - (unsigned char) (blockLen > 2) ? b64[inBuf[2] & 0x3f] : '='; + (unsigned char) (blockLen > 2) ? b64[inBuf[2] & 0x3f] : '='; inBuf += 3; outBuf += 4; } @@ -264,9 +264,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSData *) dataForRootObject: (id) object { const char header[] = - "\n" - "\n"; + "\n" + "\n"; [_data appendBytes: header length: strlen(header)]; [_data appendBytes: "\n" length: 22]; diff --git a/Foundation/NSProxy.m b/Foundation/NSProxy.m index 8c23a9c1..ef0d797c 100644 --- a/Foundation/NSProxy.m +++ b/Foundation/NSProxy.m @@ -27,7 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @interface NSInvocation (private) + (NSInvocation *) invocationWithMethodSignature: - (NSMethodSignature *) signature + (NSMethodSignature *) signature arguments: (void *) arguments; @end @@ -90,8 +90,8 @@ exception, so we may not, either return nil; } else { NSInvocation *invocation = - [NSInvocation invocationWithMethodSignature: signature - arguments: arguments]; + [NSInvocation invocationWithMethodSignature: signature + arguments: arguments]; // char result[[signature methodReturnLength]]; id result; @@ -162,7 +162,7 @@ exception, so we may not, either - (BOOL) isKindOfClass: (Class) class { NSMethodSignature *signature = [self methodSignatureForSelector: _cmd]; NSInvocation *invocation = - [NSInvocation invocationWithMethodSignature: signature]; + [NSInvocation invocationWithMethodSignature: signature]; BOOL returnValue; [self forwardInvocation: invocation]; @@ -175,7 +175,7 @@ exception, so we may not, either - (BOOL) isMemberOfClass: (Class) class { NSMethodSignature *signature = [self methodSignatureForSelector: _cmd]; NSInvocation *invocation = - [NSInvocation invocationWithMethodSignature: signature]; + [NSInvocation invocationWithMethodSignature: signature]; BOOL returnValue; [self forwardInvocation: invocation]; @@ -188,7 +188,7 @@ exception, so we may not, either - (BOOL) conformsToProtocol: (Protocol *) protocol { NSMethodSignature *signature = [self methodSignatureForSelector: _cmd]; NSInvocation *invocation = - [NSInvocation invocationWithMethodSignature: signature]; + [NSInvocation invocationWithMethodSignature: signature]; BOOL returnValue; [self forwardInvocation: invocation]; @@ -201,7 +201,7 @@ exception, so we may not, either - (BOOL) respondsToSelector: (SEL) selector { NSMethodSignature *signature = [self methodSignatureForSelector: _cmd]; NSInvocation *invocation = - [NSInvocation invocationWithMethodSignature: signature]; + [NSInvocation invocationWithMethodSignature: signature]; BOOL returnValue; [self forwardInvocation: invocation]; diff --git a/Foundation/NSRunLoop/NSRunLoop.m b/Foundation/NSRunLoop/NSRunLoop.m index 382abdc3..0effb56d 100644 --- a/Foundation/NSRunLoop/NSRunLoop.m +++ b/Foundation/NSRunLoop/NSRunLoop.m @@ -48,7 +48,7 @@ NSString *const NSRunLoopCommonModes = @"kCFRunLoopCommonModes"; NSInputSource *parentDeath; _modes = NSCreateMapTableWithZone( - NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 0, [self zone]); + NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 0, [self zone]); _commonModes = [[NSMutableArray alloc] init]; [_commonModes addObject: NSDefaultRunLoopMode]; _currentMode = NSDefaultRunLoopMode; @@ -187,8 +187,8 @@ NSString *const NSRunLoopCommonModes = @"kCFRunLoopCommonModes"; NSString *mode; NSRunLoopState *modeState; - while ( - NSNextMapEnumeratorPair(&state, (void **) &mode, (void **) &modeState)) + while (NSNextMapEnumeratorPair(&state, (void **) &mode, + (void **) &modeState)) [modeState invalidateTimerWithDelayedPerform: delayed]; } @@ -213,7 +213,7 @@ NSString *const NSRunLoopCommonModes = @"kCFRunLoopCommonModes"; NSRunLoopState *state = [self stateForMode: mode]; if ([[NSNotificationQueue defaultQueue] - hasIdleNotificationsInMode: mode]) { + hasIdleNotificationsInMode: mode]) { if ([state pollInputForMode: mode]) { [pool release]; return YES; @@ -302,11 +302,11 @@ NSString *const NSRunLoopCommonModes = @"kCFRunLoopCommonModes"; modes: (NSArray *) modes { NSOrderedPerform *perform = [NSOrderedPerform - orderedPerformWithSelector: selector - target: target - argument: argument - order: order - modes: [self resolveCommonModes: modes]]; + orderedPerformWithSelector: selector + target: target + argument: argument + order: order + modes: [self resolveCommonModes: modes]]; @synchronized(_orderedPerforms) { NSInteger count = [_orderedPerforms count]; @@ -361,18 +361,18 @@ NSString *const NSRunLoopCommonModes = @"kCFRunLoopCommonModes"; object: argument { NSDelayedPerform *delayed = - [NSDelayedPerform delayedPerformWithObject: target - selector: selector - argument: argument]; + [NSDelayedPerform delayedPerformWithObject: target + selector: selector + argument: argument]; [[NSRunLoop currentRunLoop] invalidateTimerWithDelayedPerform: delayed]; } + (void) cancelPreviousPerformRequestsWithTarget: target { NSDelayedPerform *delayed = - [NSDelayedPerform delayedPerformWithObject: target - selector: NULL - argument: nil]; + [NSDelayedPerform delayedPerformWithObject: target + selector: NULL + argument: nil]; [[NSRunLoop currentRunLoop] invalidateTimerWithDelayedPerform: delayed]; } @@ -384,15 +384,15 @@ NSString *const NSRunLoopCommonModes = @"kCFRunLoopCommonModes"; } + (void) object: object - performSelector: (SEL) selector - withObject: argument - afterDelay: (NSTimeInterval) delay - inModes: (NSArray *) modes + performSelector: (SEL) selector + withObject: argument + afterDelay: (NSTimeInterval) delay + inModes: (NSArray *) modes { NSDelayedPerform *delayed = - [NSDelayedPerform delayedPerformWithObject: object - selector: selector - argument: argument]; + [NSDelayedPerform delayedPerformWithObject: object + selector: selector + argument: argument]; NSTimer *timer = [NSTimer timerWithTimeInterval: delay target: [NSObject class] selector: @selector(_delayedPerform:) @@ -410,10 +410,10 @@ NSString *const NSRunLoopCommonModes = @"kCFRunLoopCommonModes"; afterDelay: (NSTimeInterval) delay { [[self class] object: self - performSelector: selector - withObject: object - afterDelay: delay - inModes: [NSArray arrayWithObject: NSDefaultRunLoopMode]]; + performSelector: selector + withObject: object + afterDelay: delay + inModes: [NSArray arrayWithObject: NSDefaultRunLoopMode]]; } - (void) performSelector: (SEL) selector @@ -422,10 +422,10 @@ NSString *const NSRunLoopCommonModes = @"kCFRunLoopCommonModes"; inModes: (NSArray *) modes { [[self class] object: self - performSelector: selector - withObject: object - afterDelay: delay - inModes: modes]; + performSelector: selector + withObject: object + afterDelay: delay + inModes: modes]; } @end diff --git a/Foundation/NSRunLoop/NSRunLoopState.m b/Foundation/NSRunLoop/NSRunLoopState.m index ed29f8e2..22afdd2d 100644 --- a/Foundation/NSRunLoop/NSRunLoopState.m +++ b/Foundation/NSRunLoop/NSRunLoopState.m @@ -169,7 +169,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (i = 0; i < count; i++) if ([[_asyncInputSourceSets objectAtIndex: i] - fireSingleImmediateInputInMode: mode]) + fireSingleImmediateInputInMode: mode]) return YES; return [_inputSourceSet fireSingleImmediateInputInMode: mode]; @@ -185,7 +185,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (i = 0; i < count; i++) [[_asyncInputSourceSets objectAtIndex: i] - waitInBackgroundInMode: mode]; + waitInBackgroundInMode: mode]; return [_inputSourceSet waitForInputInMode: mode beforeDate: date]; } @@ -196,9 +196,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (id) description { - return - [NSString stringWithFormat: @"%@, %i inputSources", [super description], - [_inputSourceSet count]]; + return [NSString stringWithFormat: @"%@, %i inputSources", + [super description], + [_inputSourceSet count]]; } @end diff --git a/Foundation/NSScanner/NSScanner_concrete.m b/Foundation/NSScanner/NSScanner_concrete.m index 7fb25917..fe34ebe7 100644 --- a/Foundation/NSScanner/NSScanner_concrete.m +++ b/Foundation/NSScanner/NSScanner_concrete.m @@ -88,9 +88,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSUInteger currentLocation = _location; for (; currentLocation < length; currentLocation++) { - if ([_skipSet - characterIsMember: [_string - characterAtIndex: currentLocation]] == + if ([_skipSet characterIsMember: + [_string characterAtIndex: currentLocation]] == YES) { continue; } else { @@ -223,7 +222,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ unichar decimalSeperator = '.'; if (_locale) { NSString *separatorString = - [_locale objectForKey: NSLocaleDecimalSeparator]; + [_locale objectForKey: NSLocaleDecimalSeparator]; if ([separatorString length] > 0) { decimalSeperator = [separatorString characterAtIndex: 0]; } @@ -621,8 +620,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (scanStarted) { if (stringp != NULL) *stringp = - [[NSString alloc] initWithCharacters: result - length: resultLength]; + [[NSString alloc] initWithCharacters: result + length: resultLength]; [pool drain]; if (stringp != NULL) @@ -636,9 +635,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ continue; } else { if (stringp != NULL) - *stringp = - [[NSString alloc] initWithCharacters: result - length: resultLength]; + *stringp = [[NSString alloc] + initWithCharacters: result + length: resultLength]; [pool drain]; if (stringp != NULL) diff --git a/Foundation/NSSet/NSEnumerator_set.m b/Foundation/NSSet/NSEnumerator_set.m index d606d2e1..c91a1a47 100644 --- a/Foundation/NSSet/NSEnumerator_set.m +++ b/Foundation/NSSet/NSEnumerator_set.m @@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSEnumerator_set *NSEnumerator_setNew(NSZone *zone, id set, NSSetTable *table) { NSEnumerator_set *self = - NSAllocateObject([NSEnumerator_set class], 0, zone); + NSAllocateObject([NSEnumerator_set class], 0, zone); if (self) { self->_set = [set retain]; self->_table = table; diff --git a/Foundation/NSSet/NSInlineSetTable.m b/Foundation/NSSet/NSInlineSetTable.m index 4a2f3257..2cb8aa70 100644 --- a/Foundation/NSSet/NSInlineSetTable.m +++ b/Foundation/NSSet/NSInlineSetTable.m @@ -27,7 +27,7 @@ void NSSetTableInit(NSSetTable *table, NSUInteger capacity, NSZone *zone) { table->count = 0; table->numBuckets = NSSetTableRoundCount(capacity); table->buckets = - NSZoneCalloc(zone, table->numBuckets, sizeof(NSSetBucket *)); + NSZoneCalloc(zone, table->numBuckets, sizeof(NSSetBucket *)); } void NSSetTableFreeObjects(NSSetTable *table) { @@ -160,7 +160,7 @@ void NSSetTableAddObjectCount(NSSetTable *table, id object) { void NSSetTableRemoveObjectCount(NSSetTable *table, id object) { NSUInteger index = [object hash] % table->numBuckets; NSCountBucket *current, *last, - *bucket = (NSCountBucket *) table->buckets[index]; + *bucket = (NSCountBucket *) table->buckets[index]; for (current = last = bucket; current != NULL; last = current, current = current->next) diff --git a/Foundation/NSSet/NSMutableSet.m b/Foundation/NSSet/NSMutableSet.m index 78bd75c6..07ab7dfe 100644 --- a/Foundation/NSSet/NSMutableSet.m +++ b/Foundation/NSSet/NSMutableSet.m @@ -74,7 +74,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + setWithObject: object { if (self == [NSMutableSet class]) return NSAutorelease( - NSMutableSet_concreteNewWithObjects(NULL, &object, 1)); + NSMutableSet_concreteNewWithObjects(NULL, &object, 1)); return [[[self allocWithZone: NULL] initWithObjects: &object count: 1] autorelease]; @@ -102,7 +102,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (self == [NSMutableSet class]) { return NSAutorelease( - NSMutableSet_concreteNewWithObjects(NULL, objects, count)); + NSMutableSet_concreteNewWithObjects(NULL, objects, count)); } return [[[self allocWithZone: NULL] initWithObjects: objects @@ -118,8 +118,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (self == [NSMutableSet class]) return NSAutorelease(NSMutableSet_concreteNew(NULL, capacity)); - return - [[[self allocWithZone: NULL] initWithCapacity: capacity] autorelease]; + return [[[self allocWithZone: NULL] initWithCapacity: capacity] + autorelease]; } - (void) addObject: object { diff --git a/Foundation/NSSet/NSMutableSet_concrete.m b/Foundation/NSSet/NSMutableSet_concrete.m index d04ac9bd..4df8748d 100644 --- a/Foundation/NSSet/NSMutableSet_concrete.m +++ b/Foundation/NSSet/NSMutableSet_concrete.m @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSSet *NSMutableSet_concreteNew(NSZone *zone, NSUInteger capacity) { NSMutableSet_concrete *self = - NSAllocateObject([NSMutableSet_concrete class], 0, zone); + NSAllocateObject([NSMutableSet_concrete class], 0, zone); if (self) { NSSetTableInit(&(self->_table), capacity, zone); } @@ -37,7 +37,7 @@ NSSet *NSMutableSet_concreteNewWithObjects(NSZone *zone, id *objects, NSUInteger count) { NSMutableSet_concrete *self = - NSAllocateObject([NSMutableSet_concrete class], 0, zone); + NSAllocateObject([NSMutableSet_concrete class], 0, zone); if (self) { NSUInteger i; diff --git a/Foundation/NSSet/NSSet_concrete.m b/Foundation/NSSet/NSSet_concrete.m index 1ac25447..99a96e91 100644 --- a/Foundation/NSSet/NSSet_concrete.m +++ b/Foundation/NSSet/NSSet_concrete.m @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSSet *NSSet_concreteNew(NSZone *zone, id *objects, NSUInteger count) { NSUInteger i, capacity = NSSetTableRoundCount(count); NSSet_concrete *self = NSAllocateObject( - [NSSet_concrete class], sizeof(NSSetBucket *) * capacity, zone); + [NSSet_concrete class], sizeof(NSSetBucket *) * capacity, zone); if (self) { self->_table.count = 0; self->_table.numBuckets = capacity; diff --git a/Foundation/NSSortDescriptor.h b/Foundation/NSSortDescriptor.h index f38f4c21..558efa66 100644 --- a/Foundation/NSSortDescriptor.h +++ b/Foundation/NSSortDescriptor.h @@ -32,8 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithKey: (NSString *) key ascending: (BOOL) ascending; - initWithKey: (NSString *) key - ascending: (BOOL) ascending - selector: (SEL) selector; + ascending: (BOOL) ascending + selector: (SEL) selector; - (NSString *) key; - (BOOL) ascending; diff --git a/Foundation/NSSortDescriptor.m b/Foundation/NSSortDescriptor.m index c6d4ce46..0446dec2 100644 --- a/Foundation/NSSortDescriptor.m +++ b/Foundation/NSSortDescriptor.m @@ -30,7 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return [[[NSSortDescriptor allocWithZone: NULL] initWithKey: key ascending: ascending selector: NULL] - autorelease]; + autorelease]; } + sortDescriptorWithKey: (NSString *) key @@ -40,7 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return [[[NSSortDescriptor allocWithZone: NULL] initWithKey: key ascending: ascending selector: selector] - autorelease]; + autorelease]; } - initWithKey: (NSString *) key ascending: (BOOL) ascending { @@ -48,8 +48,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithKey: (NSString *) key - ascending: (BOOL) ascending - selector: (SEL) selector + ascending: (BOOL) ascending + selector: (SEL) selector { _key = [key copy]; _ascending = ascending; @@ -122,7 +122,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _key = [[keyed decodeObjectForKey: @"Key"] copy]; _ascending = [keyed decodeBoolForKey: @"Ascending"]; _selector = - NSSelectorFromString([keyed decodeObjectForKey: @"Selector"]); + NSSelectorFromString([keyed decodeObjectForKey: @"Selector"]); } else { diff --git a/Foundation/NSSpellEngine.m b/Foundation/NSSpellEngine.m index 94a7fb57..85ca70a4 100644 --- a/Foundation/NSSpellEngine.m +++ b/Foundation/NSSpellEngine.m @@ -19,8 +19,8 @@ static NSMutableArray *_allSpellEngines = nil; if (self == [NSSpellEngine class]) { NSArray *allPaths = [[NSBundle bundleForClass: self] - pathsForResourcesOfType: @"spellEngine" - inDirectory: nil]; + pathsForResourcesOfType: @"spellEngine" + inDirectory: nil]; int i, count = [allPaths count]; _allSpellEngines = [[NSMutableArray alloc] init]; @@ -105,9 +105,9 @@ static NSMutableArray *_allSpellEngines = nil; } - (NSRange) spellServer: (NSSpellServer *) sender - checkGrammarInString: (NSString *) string - language: (NSString *) language - details: (NSArray **) outDetails + checkGrammarInString: (NSString *) string + language: (NSString *) language + details: (NSArray **) outDetails { return [self checkGrammarInString: string language: language @@ -131,8 +131,8 @@ static NSMutableArray *_allSpellEngines = nil; } - (void) spellServer: (NSSpellServer *) sender - didForgetWord: (NSString *) word - inLanguage: (NSString *) language + didForgetWord: (NSString *) word + inLanguage: (NSString *) language { return [self didForgetWord: word inLanguage: language]; } @@ -145,10 +145,10 @@ static NSMutableArray *_allSpellEngines = nil; } - (NSRange) spellServer: (NSSpellServer *) sender - findMisspelledWordInString: (NSString *) stringToCheck - language: (NSString *) language - wordCount: (NSInteger *) wordCount - countOnly: (BOOL) countOnly + findMisspelledWordInString: (NSString *) stringToCheck + language: (NSString *) language + wordCount: (NSInteger *) wordCount + countOnly: (BOOL) countOnly { return [self findMisspelledWordInString: stringToCheck language: language @@ -157,9 +157,9 @@ static NSMutableArray *_allSpellEngines = nil; } - (NSArray *) spellServer: (NSSpellServer *) sender - suggestCompletionsForPartialWordRange: (NSRange) range - inString: (NSString *) string - language: (NSString *) language + suggestCompletionsForPartialWordRange: (NSRange) range + inString: (NSString *) string + language: (NSString *) language { return [self suggestCompletionsForPartialWordRange: range inString: string @@ -167,8 +167,8 @@ static NSMutableArray *_allSpellEngines = nil; } - (NSArray *) spellServer: (NSSpellServer *) sender - suggestGuessesForWord: (NSString *) word - inLanguage: (NSString *) language + suggestGuessesForWord: (NSString *) word + inLanguage: (NSString *) language { return [self suggestGuessesForWord: word inLanguage: language]; } diff --git a/Foundation/NSSpellServer.h b/Foundation/NSSpellServer.h index 469ac0d4..84222ba9 100644 --- a/Foundation/NSSpellServer.h +++ b/Foundation/NSSpellServer.h @@ -12,9 +12,9 @@ FOUNDATION_EXPORT NSString *const NSGrammarCorrections; //@optional - (NSRange) spellServer: (NSSpellServer *) sender - checkGrammarInString: (NSString *) string - language: (NSString *) language - details: (NSArray **) outDetails; + checkGrammarInString: (NSString *) string + language: (NSString *) language + details: (NSArray **) outDetails; - (NSArray *) spellServer: (NSSpellServer *) sender checkString: (NSString *) stringToCheck @@ -25,27 +25,27 @@ FOUNDATION_EXPORT NSString *const NSGrammarCorrections; wordCount: (NSInteger *) wordCount; - (void) spellServer: (NSSpellServer *) sender - didForgetWord: (NSString *) word - inLanguage: (NSString *) language; + didForgetWord: (NSString *) word + inLanguage: (NSString *) language; - (void) spellServer: (NSSpellServer *) sender didLearnWord: (NSString *) word inLanguage: (NSString *) language; - (NSRange) spellServer: (NSSpellServer *) sender - findMisspelledWordInString: (NSString *) stringToCheck - language: (NSString *) language - wordCount: (NSInteger *) wordCount - countOnly: (BOOL) countOnly; + findMisspelledWordInString: (NSString *) stringToCheck + language: (NSString *) language + wordCount: (NSInteger *) wordCount + countOnly: (BOOL) countOnly; - (NSArray *) spellServer: (NSSpellServer *) sender - suggestCompletionsForPartialWordRange: (NSRange) range - inString: (NSString *) string - language: (NSString *) language; + suggestCompletionsForPartialWordRange: (NSRange) range + inString: (NSString *) string + language: (NSString *) language; - (NSArray *) spellServer: (NSSpellServer *) sender - suggestGuessesForWord: (NSString *) word - inLanguage: (NSString *) language; + suggestGuessesForWord: (NSString *) word + inLanguage: (NSString *) language; @end diff --git a/Foundation/NSStream/NSFileHandle.h b/Foundation/NSStream/NSFileHandle.h index 90b9a7b6..69b593fa 100644 --- a/Foundation/NSStream/NSFileHandle.h +++ b/Foundation/NSStream/NSFileHandle.h @@ -25,7 +25,7 @@ FOUNDATION_EXPORT NSString *const NSFileHandleConnectionAcceptedNotification; FOUNDATION_EXPORT NSString *const NSFileHandleDataAvailableNotification; FOUNDATION_EXPORT NSString *const NSFileHandleReadCompletionNotification; FOUNDATION_EXPORT NSString - *const NSFileHandleReadToEndOfFileCompletionNotification; + *const NSFileHandleReadToEndOfFileCompletionNotification; FOUNDATION_EXPORT NSString *const NSFileHandleNotificationDataItem; FOUNDATION_EXPORT NSString *const NSFileHandleNotificationFileHandleItem; diff --git a/Foundation/NSStream/NSFileHandle.m b/Foundation/NSStream/NSFileHandle.m index 4795d06e..92b44757 100644 --- a/Foundation/NSStream/NSFileHandle.m +++ b/Foundation/NSStream/NSFileHandle.m @@ -24,24 +24,24 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSFileHandleConnectionAcceptedNotification = - @"NSFileHandleConnectionAcceptedNotification"; + @"NSFileHandleConnectionAcceptedNotification"; NSString *const NSFileHandleDataAvailableNotification = - @"NSFileHandleDataAvailableNotification"; + @"NSFileHandleDataAvailableNotification"; NSString *const NSFileHandleReadCompletionNotification = - @"NSFileHandleReadCompletionNotification"; + @"NSFileHandleReadCompletionNotification"; NSString *const NSFileHandleReadToEndOfFileCompletionNotification = - @"NSFileHandleReadToEndOfFileCompletionNotification"; + @"NSFileHandleReadToEndOfFileCompletionNotification"; NSString *const NSFileHandleNotificationDataItem = - @"NSFileHandleNotificationDataItem"; + @"NSFileHandleNotificationDataItem"; NSString *const NSFileHandleNotificationFileHandleItem = - @"NSFileHandleNotificationFileHandleItem"; + @"NSFileHandleNotificationFileHandleItem"; NSString *const NSFileHandleNotificationMonitorModes = - @"NSFileHandleNotificationMonitorModes"; + @"NSFileHandleNotificationMonitorModes"; NSString *const NSFileHandleOperationException = - @"NSFileHandleOperationException"; + @"NSFileHandleOperationException"; @interface NSFileHandle (ImplementedInPlatform) + (Class) concreteSubclass; @@ -92,7 +92,7 @@ NSString *const NSFileHandleOperationException = closeOnDealloc: (BOOL) closeOnDealloc { NSSocket *socket = - [[[NSSocket alloc] initWithFileDescriptor: descriptor] autorelease]; + [[[NSSocket alloc] initWithFileDescriptor: descriptor] autorelease]; [self dealloc]; if (socket == nil) @@ -158,7 +158,7 @@ NSString *const NSFileHandleOperationException = - (void) readInBackgroundAndNotify { [self readInBackgroundAndNotifyForModes: - [NSArray arrayWithObject: NSDefaultRunLoopMode]]; + [NSArray arrayWithObject: NSDefaultRunLoopMode]]; } - (void) readToEndOfFileInBackgroundAndNotifyForModes: (NSArray *) modes { @@ -167,7 +167,7 @@ NSString *const NSFileHandleOperationException = - (void) readToEndOfFileInBackgroundAndNotify { [self readToEndOfFileInBackgroundAndNotifyForModes: - [NSArray arrayWithObject: NSDefaultRunLoopMode]]; + [NSArray arrayWithObject: NSDefaultRunLoopMode]]; } - (void) acceptConnectionInBackgroundAndNotifyForModes: (NSArray *) modes { @@ -176,7 +176,7 @@ NSString *const NSFileHandleOperationException = - (void) acceptConnectionInBackgroundAndNotify { [self acceptConnectionInBackgroundAndNotifyForModes: - [NSArray arrayWithObject: NSDefaultRunLoopMode]]; + [NSArray arrayWithObject: NSDefaultRunLoopMode]]; } - (void) waitForDataInBackgroundAndNotifyForModes: (NSArray *) modes { @@ -185,7 +185,7 @@ NSString *const NSFileHandleOperationException = - (void) waitForDataInBackgroundAndNotify { [self waitForDataInBackgroundAndNotifyForModes: - [NSArray arrayWithObject: NSDefaultRunLoopMode]]; + [NSArray arrayWithObject: NSDefaultRunLoopMode]]; } @end diff --git a/Foundation/NSStream/NSFileHandle_stream.m b/Foundation/NSStream/NSFileHandle_stream.m index 555f4d0f..3c995759 100644 --- a/Foundation/NSStream/NSFileHandle_stream.m +++ b/Foundation/NSStream/NSFileHandle_stream.m @@ -22,12 +22,12 @@ enum { - initWithSocket: (NSSocket *) socket closeOnDealloc: (BOOL) closeOnDealloc { _inputStream = - [[NSInputStream_socket alloc] initWithSocket: socket - streamStatus: NSStreamStatusOpen]; + [[NSInputStream_socket alloc] initWithSocket: socket + streamStatus: NSStreamStatusOpen]; [_inputStream setDelegate: self]; _outputStream = - [[NSOutputStream_socket alloc] initWithSocket: socket - streamStatus: NSStreamStatusOpen]; + [[NSOutputStream_socket alloc] initWithSocket: socket + streamStatus: NSStreamStatusOpen]; [_outputStream setDelegate: self]; _closeOnDealloc = closeOnDealloc; _asyncState = NSFileHandleStateNone; @@ -70,21 +70,21 @@ enum { - (uint64_t) offsetInFile { [NSException - raise: NSFileHandleOperationException - format: @"-[%@ %s]: Illegal seek", [self class], sel_getName(_cmd)]; + raise: NSFileHandleOperationException + format: @"-[%@ %s]: Illegal seek", [self class], sel_getName(_cmd)]; return 0; } - (void) seekToFileOffset: (uint64_t) offset { [NSException - raise: NSFileHandleOperationException - format: @"-[%@ %s]: Illegal seek", [self class], sel_getName(_cmd)]; + raise: NSFileHandleOperationException + format: @"-[%@ %s]: Illegal seek", [self class], sel_getName(_cmd)]; } - (uint64_t) seekToEndOfFile { [NSException - raise: NSFileHandleOperationException - format: @"-[%@ %s]: Illegal seek", [self class], sel_getName(_cmd)]; + raise: NSFileHandleOperationException + format: @"-[%@ %s]: Illegal seek", [self class], sel_getName(_cmd)]; return 0; } @@ -173,8 +173,8 @@ enum { notificationName = NSFileHandleReadCompletionNotification; // FIX, need error key too userInfo = [NSDictionary - dictionaryWithObject: data - forKey: NSFileHandleNotificationDataItem]; + dictionaryWithObject: data + forKey: NSFileHandleNotificationDataItem]; [self _setAsyncState: NSFileHandleStateNone forModes: nil]; } break; @@ -188,11 +188,11 @@ enum { [_endOfFileBuffer appendData: data]; } else { notificationName = - NSFileHandleReadToEndOfFileCompletionNotification; + NSFileHandleReadToEndOfFileCompletionNotification; // FIX, need error key too userInfo = [NSDictionary - dictionaryWithObject: _endOfFileBuffer - forKey: NSFileHandleNotificationDataItem]; + dictionaryWithObject: _endOfFileBuffer + forKey: NSFileHandleNotificationDataItem]; [_endOfFileBuffer release]; _endOfFileBuffer = nil; @@ -203,7 +203,7 @@ enum { case NSFileHandleStateAccept: { NSError *error; NSSocket *socket = [[(NSInputStream_socket *) _inputStream socket] - acceptWithError: &error]; + acceptWithError: &error]; notificationName = NSFileHandleConnectionAcceptedNotification; @@ -211,13 +211,12 @@ enum { // FIX, need error key } else { NSFileHandle *other = [[[NSFileHandle_stream alloc] - initWithSocket: socket - closeOnDealloc: YES] autorelease]; + initWithSocket: socket + closeOnDealloc: YES] autorelease]; userInfo = [NSDictionary - dictionaryWithObject: other - forKey: - NSFileHandleNotificationFileHandleItem]; + dictionaryWithObject: other + forKey: NSFileHandleNotificationFileHandleItem]; } [self _setAsyncState: NSFileHandleStateNone forModes: nil]; } break; @@ -230,9 +229,9 @@ enum { if (notificationName != nil) [[NSNotificationCenter defaultCenter] - postNotificationName: notificationName - object: self - userInfo: userInfo]; + postNotificationName: notificationName + object: self + userInfo: userInfo]; } } diff --git a/Foundation/NSStream/NSInputStream_socket.m b/Foundation/NSStream/NSInputStream_socket.m index 8a8e0d4e..be542710 100644 --- a/Foundation/NSStream/NSInputStream_socket.m +++ b/Foundation/NSStream/NSInputStream_socket.m @@ -88,9 +88,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - propertyForKey: (NSString *) key { if ([key isEqualToString: (NSString *) - kCFStreamPropertySocketNativeHandle]) { + kCFStreamPropertySocketNativeHandle]) { CFSocketNativeHandle value = - (_socket == nil) ? -1 : [_socket fileDescriptor]; + (_socket == nil) ? -1 : [_socket fileDescriptor]; return [NSData dataWithBytes: &value length: sizeof(value)]; } @@ -237,7 +237,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } } else { if ([_delegate respondsToSelector: @selector(stream: - handleEvent:)]) { + handleEvent:)]) { [_delegate stream: self handleEvent: event]; } } diff --git a/Foundation/NSStream/NSOutputStream_socket.m b/Foundation/NSStream/NSOutputStream_socket.m index 2a839ad0..c7c738c7 100644 --- a/Foundation/NSStream/NSOutputStream_socket.m +++ b/Foundation/NSStream/NSOutputStream_socket.m @@ -83,9 +83,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - propertyForKey: (NSString *) key { if ([key isEqualToString: (NSString *) - kCFStreamPropertySocketNativeHandle]) { + kCFStreamPropertySocketNativeHandle]) { CFSocketNativeHandle value = - (_socket == nil) ? -1 : [_socket fileDescriptor]; + (_socket == nil) ? -1 : [_socket fileDescriptor]; return [NSData dataWithBytes: &value length: sizeof(value)]; } @@ -236,7 +236,7 @@ static BOOL socketHasSpaceAvailable(NSSocket *socket) { } } else { if ([_delegate respondsToSelector: @selector(stream: - handleEvent:)]) { + handleEvent:)]) { [_delegate stream: self handleEvent: event]; } } diff --git a/Foundation/NSStream/NSSelectInputSourceSet.m b/Foundation/NSStream/NSSelectInputSourceSet.m index ef1cd7a1..6723c7af 100644 --- a/Foundation/NSStream/NSSelectInputSourceSet.m +++ b/Foundation/NSStream/NSSelectInputSourceSet.m @@ -33,10 +33,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [super init]; _outputSet = nil; [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(selectSetOutputNotification:) - name: NSSelectSetOutputNotification - object: nil]; + addObserver: self + selector: @selector(selectSetOutputNotification:) + name: NSSelectSetOutputNotification + object: nil]; return self; } diff --git a/Foundation/NSStream/NSSelectSet.m b/Foundation/NSStream/NSSelectSet.m index d869c281..fb7efdbf 100644 --- a/Foundation/NSStream/NSSelectSet.m +++ b/Foundation/NSStream/NSSelectSet.m @@ -22,7 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSSelectSetOutputNotification = - @"NSSelectSetOutputNotification"; + @"NSSelectSetOutputNotification"; @implementation NSSelectSet diff --git a/Foundation/NSStream/NSSocket.h b/Foundation/NSStream/NSSocket.h index f118b1e8..c6d8695a 100644 --- a/Foundation/NSStream/NSSocket.h +++ b/Foundation/NSStream/NSSocket.h @@ -51,4 +51,5 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @end NSData *NSSocketAddressDataForNetworkOrderAddressBytesAndPort( - const void *address, NSUInteger length, uint16_t port, uint32_t interface); + const void *address, NSUInteger length, uint16_t port, + uint32_t interface); diff --git a/Foundation/NSStream/NSStream.m b/Foundation/NSStream/NSStream.m index 79ef9f23..c33a3c2e 100644 --- a/Foundation/NSStream/NSStream.m +++ b/Foundation/NSStream/NSStream.m @@ -24,24 +24,24 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSStreamDataWrittenToMemoryStreamKey = - @"kCFStreamPropertyDataWritten"; + @"kCFStreamPropertyDataWritten"; NSString *const NSStreamFileCurrentOffsetKey = - @"kCFStreamPropertyFileCurrentOffset"; + @"kCFStreamPropertyFileCurrentOffset"; /************* These values are also in CFStream, keep in sync */ NSString *const NSStreamSocketSecurityLevelKey = @"kCFStreamSSLLevel"; NSString *const NSStreamSocketSecurityLevelNone = - @"kCFStreamSocketSecurityLevelNone"; + @"kCFStreamSocketSecurityLevelNone"; NSString *const NSStreamSocketSecurityLevelSSLv2 = - @"kCFStreamSocketSecurityLevelSSLv2"; + @"kCFStreamSocketSecurityLevelSSLv2"; NSString *const NSStreamSocketSecurityLevelSSLv3 = - @"kCFStreamSocketSecurityLevelSSLv3"; + @"kCFStreamSocketSecurityLevelSSLv3"; NSString *const NSStreamSocketSecurityLevelTLSv1 = - @"kCFStreamSocketSecurityLevelTLSv1"; + @"kCFStreamSocketSecurityLevelTLSv1"; NSString *const NSStreamSocketSecurityLevelNegotiatedSSL = - @"kCFStreamSocketSecurityLevelNegotiatedSSL"; + @"kCFStreamSocketSecurityLevelNegotiatedSSL"; @implementation NSStream @@ -66,12 +66,12 @@ NSString *const NSStreamSocketSecurityLevelNegotiatedSSL = if (inputStreamp) *inputStreamp = input = [[[NSInputStream_socket alloc] - initWithSocket: socket - streamStatus: NSStreamStatusNotOpen] autorelease]; + initWithSocket: socket + streamStatus: NSStreamStatusNotOpen] autorelease]; if (outputStreamp) *outputStreamp = output = [[[NSOutputStream_socket alloc] - initWithSocket: socket - streamStatus: NSStreamStatusNotOpen] autorelease]; + initWithSocket: socket + streamStatus: NSStreamStatusNotOpen] autorelease]; } - delegate { diff --git a/Foundation/NSString/NSMutableString.m b/Foundation/NSString/NSMutableString.m index 5ca3f8dc..eafde545 100644 --- a/Foundation/NSString/NSMutableString.m +++ b/Foundation/NSString/NSMutableString.m @@ -62,12 +62,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + stringWithCString: (const char *) bytes length: (NSUInteger) length { return NSAutorelease( - NSMutableString_unicodePtrNewWithCString(NULL, bytes, length)); + NSMutableString_unicodePtrNewWithCString(NULL, bytes, length)); } + stringWithCString: (const char *) bytes { - return NSAutorelease( - NSMutableString_unicodePtrNewWithCString(NULL, bytes, strlen(bytes))); + return NSAutorelease(NSMutableString_unicodePtrNewWithCString( + NULL, bytes, strlen(bytes))); } + stringWithFormat: (NSString *) format, ... { @@ -81,7 +81,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ va_end(arguments); return NSAutorelease( - NSMutableString_unicodePtrNewNoCopy(NULL, unicode, length)); + NSMutableString_unicodePtrNewNoCopy(NULL, unicode, length)); } + stringWithContentsOfFile: (NSString *) path { @@ -92,7 +92,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return nil; return NSAutorelease( - NSMutableString_unicodePtrNewNoCopy(NULL, unicode, length)); + NSMutableString_unicodePtrNewNoCopy(NULL, unicode, length)); } + localizedStringWithFormat: (NSString *) format, ... { @@ -106,12 +106,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ va_end(arguments); return NSAutorelease( - NSMutableString_unicodePtrNewNoCopy(NULL, unicode, length)); + NSMutableString_unicodePtrNewNoCopy(NULL, unicode, length)); } + stringWithCapacity: (NSUInteger) capacity { return NSAutorelease( - NSMutableString_unicodePtrNewWithCapacity(NULL, capacity)); + NSMutableString_unicodePtrNewWithCapacity(NULL, capacity)); } - (void) appendString: (NSString *) string { @@ -195,12 +195,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ while ((subrange = [self rangeOfString: target options: opts range: searchRange]) - .location != NSNotFound) { + .location != NSNotFound) { [self replaceCharactersInRange: subrange withString: replacement]; if (!isBackwards) { - searchRange.length -= - (subrange.location - searchRange.location) + subrange.length; + searchRange.length -= (subrange.location - searchRange.location) + + subrange.length; searchRange.location = subrange.location + replacementLen; } else { searchRange.length = subrange.location - searchRange.location; diff --git a/Foundation/NSString/NSMutableString_unicodePtr.m b/Foundation/NSString/NSMutableString_unicodePtr.m index 883d85e8..ed5fdd7c 100644 --- a/Foundation/NSString/NSMutableString_unicodePtr.m +++ b/Foundation/NSString/NSMutableString_unicodePtr.m @@ -133,7 +133,7 @@ NSMutableString_unicodePtrInitWithCString(NSMutableString_unicodePtr *self, NSUInteger length, NSZone *zone) { self->_unicode = - NSCharactersFromCString(cString, length, &(self->_length), zone); + NSCharactersFromCString(cString, length, &(self->_length), zone); self->_capacity = self->_length; return self; @@ -184,7 +184,7 @@ NSString *NSMutableString_unicodePtrNewWithCString(NSZone *zone, NSUInteger length) { NSMutableString_unicodePtr *self = NSAllocateObject( - objc_lookUpClass("NSMutableString_unicodePtr"), 0, zone); + objc_lookUpClass("NSMutableString_unicodePtr"), 0, zone); if (self) { self = NSMutableString_unicodePtrInitWithCString(self, cString, length, zone); @@ -196,7 +196,7 @@ NSString *NSMutableString_unicodePtrNew(NSZone *zone, const unichar *unicode, NSUInteger length) { NSMutableString_unicodePtr *self = NSAllocateObject( - objc_lookUpClass("NSMutableString_unicodePtr"), 0, zone); + objc_lookUpClass("NSMutableString_unicodePtr"), 0, zone); if (self) { self = NSMutableString_unicodePtrInit(self, unicode, length, zone); } @@ -211,8 +211,8 @@ NSString *NSMutableString_unicodePtrNewNoCopy(NSZone *zone, unichar *unicode, self = NSAllocateObject(objc_lookUpClass("NSMutableString_unicodePtr"), 0, zone); if (self) { - self = - NSMutableString_unicodePtrInitNoCopy(self, unicode, length, zone); + self = NSMutableString_unicodePtrInitNoCopy(self, unicode, length, + zone); } return self; } @@ -247,7 +247,7 @@ NSString *NSMutableString_unicodePtrNewWithCapacity(NSZone *zone, freeWhenDone: (BOOL) freeWhenDone { NSMutableString_unicodePtr *string = NSMutableString_unicodePtrInit( - self, characters, length, NSZoneFromPointer(self)); + self, characters, length, NSZoneFromPointer(self)); if (freeWhenDone) { NSZoneFree(NSZoneFromPointer(characters), characters); @@ -266,8 +266,8 @@ NSString *NSMutableString_unicodePtrNewWithCapacity(NSZone *zone, freeWhenDone: (BOOL) freeWhenDone { NSMutableString_unicodePtr *string = - NSMutableString_unicodePtrInitWithCString(self, bytes, length, - NSZoneFromPointer(self)); + NSMutableString_unicodePtrInitWithCString(self, bytes, length, + NSZoneFromPointer(self)); if (freeWhenDone) { NSZoneFree(NSZoneFromPointer(bytes), bytes); @@ -346,22 +346,22 @@ NSString *NSMutableString_unicodePtrNewWithCapacity(NSZone *zone, } - initWithBytes: (const void *) bytes - length: (NSUInteger) length - encoding: (NSStringEncoding) encoding + length: (NSUInteger) length + encoding: (NSStringEncoding) encoding { NSUInteger resultLength; unichar *characters; characters = NSString_anyCStringToUnicode( - encoding, bytes, length, &resultLength, NSZoneFromPointer(self)); + encoding, bytes, length, &resultLength, NSZoneFromPointer(self)); return NSMutableString_unicodePtrInitNoCopy(self, characters, resultLength, NSZoneFromPointer(self)); } - initWithFormat: (NSString *) format - locale: (NSDictionary *) locale - arguments: (va_list) arguments + locale: (NSDictionary *) locale + arguments: (va_list) arguments { NSUInteger length; unichar *unicode; @@ -384,7 +384,7 @@ NSString *NSMutableString_unicodePtrNewWithCapacity(NSZone *zone, unichar *unicode; if ((unicode = NSCharactersWithContentsOfFile( - path, &length, NSZoneFromPointer(self))) == NULL) { + path, &length, NSZoneFromPointer(self))) == NULL) { NSDeallocateObject(self); return nil; } diff --git a/Foundation/NSString/NSPathUtilities.m b/Foundation/NSString/NSPathUtilities.m index 2c8f7e1d..d518460a 100644 --- a/Foundation/NSString/NSPathUtilities.m +++ b/Foundation/NSString/NSPathUtilities.m @@ -314,13 +314,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (const char *) fileSystemRepresentation { - return - [[NSFileManager defaultManager] fileSystemRepresentationWithPath: self]; + return [[NSFileManager defaultManager] + fileSystemRepresentationWithPath: self]; } - (const uint16_t *) fileSystemRepresentationW { return [[NSFileManager defaultManager] - fileSystemRepresentationWithPathW: self]; + fileSystemRepresentationWithPathW: self]; } @end @@ -348,7 +348,7 @@ NSArray *NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, if (directory == NSCachesDirectory) { NSString *path = [[[NSPlatform currentPlatform] libraryDirectory] - stringByAppendingPathComponent: @"Caches"]; + stringByAppendingPathComponent: @"Caches"]; [[NSFileManager defaultManager] createDirectoryAtPath: path withIntermediateDirectories: YES @@ -360,7 +360,7 @@ NSArray *NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, if (directory == NSApplicationSupportDirectory) { NSString *path = [[[NSPlatform currentPlatform] libraryDirectory] - stringByAppendingPathComponent: @"Application Support"]; + stringByAppendingPathComponent: @"Application Support"]; [[NSFileManager defaultManager] createDirectoryAtPath: path withIntermediateDirectories: YES diff --git a/Foundation/NSString/NSString.h b/Foundation/NSString/NSString.h index c75ed25f..aa442c73 100644 --- a/Foundation/NSString/NSString.h +++ b/Foundation/NSString/NSString.h @@ -115,8 +115,8 @@ FOUNDATION_EXPORT const NSUInteger NSMaximumStringLength; - initWithString: (NSString *) string; - initWithFormat: (NSString *) format - locale: (id) locale - arguments: (va_list) arguments; + locale: (id) locale + arguments: (va_list) arguments; - initWithFormat: (NSString *) format locale: (id) locale, ...; - initWithFormat: (NSString *) format arguments: (va_list) arguments; - initWithFormat: (NSString *) format, ...; @@ -124,8 +124,8 @@ FOUNDATION_EXPORT const NSUInteger NSMaximumStringLength; - initWithData: (NSData *) data encoding: (NSStringEncoding) encoding; - initWithUTF8String: (const char *) utf8; - initWithBytes: (const void *) bytes - length: (NSUInteger) length - encoding: (NSStringEncoding) encoding; + length: (NSUInteger) length + encoding: (NSStringEncoding) encoding; - initWithBytesNoCopy: (void *) bytes length: (NSUInteger) length encoding: (NSStringEncoding) encoding @@ -232,11 +232,11 @@ FOUNDATION_EXPORT const NSUInteger NSMaximumStringLength; withString: (NSString *) substitute; - (NSString *) stringByReplacingOccurrencesOfString: (NSString *) original withString: (NSString *) substitute; -- (NSString *) stringByReplacingOccurrencesOfString: (NSString *) original - withString: (NSString *) substitute - options: - (NSStringCompareOptions) options - range: (NSRange) range; +- (NSString *) + stringByReplacingOccurrencesOfString: (NSString *) original + withString: (NSString *) substitute + options: (NSStringCompareOptions) options + range: (NSRange) range; - (NSString *) stringByFoldingWithOptions: (NSStringCompareOptions) options locale: (NSLocale *) locale; @@ -274,19 +274,19 @@ FOUNDATION_EXPORT const NSUInteger NSMaximumStringLength; - (NSData *) dataUsingEncoding: (NSStringEncoding) encoding; - (BOOL) getBytes: (void *) buffer - maxLength: (NSUInteger) maxLength - usedLength: (NSUInteger *) usedLength - encoding: (NSStringEncoding) encoding - options: (NSStringEncodingConversionOptions) options - range: (NSRange) range - remainingRange: (NSRange *) remainingRange; + maxLength: (NSUInteger) maxLength + usedLength: (NSUInteger *) usedLength + encoding: (NSStringEncoding) encoding + options: (NSStringEncodingConversionOptions) options + range: (NSRange) range + remainingRange: (NSRange *) remainingRange; - (const char *) UTF8String; - (NSString *) stringByReplacingPercentEscapesUsingEncoding: - (NSStringEncoding) encoding; + (NSStringEncoding) encoding; - (NSString *) stringByAddingPercentEscapesUsingEncoding: - (NSStringEncoding) encoding; + (NSStringEncoding) encoding; - (NSString *) stringByTrimmingCharactersInSet: (NSCharacterSet *) set; @@ -300,9 +300,9 @@ FOUNDATION_EXPORT const NSUInteger NSMaximumStringLength; + (NSStringEncoding) defaultCStringEncoding; - (void) getCString: (char *) buffer - maxLength: (NSUInteger) maxLength - range: (NSRange) range - remainingRange: (NSRange *) remainingRange; + maxLength: (NSUInteger) maxLength + range: (NSRange) range + remainingRange: (NSRange *) remainingRange; - (void) getCString: (char *) buffer maxLength: (NSUInteger) maxLength; - (void) getCString: (char *) buffer; diff --git a/Foundation/NSString/NSString.m b/Foundation/NSString/NSString.m index bfc8620b..7e0f4502 100644 --- a/Foundation/NSString/NSString.m +++ b/Foundation/NSString/NSString.m @@ -79,7 +79,7 @@ extern BOOL NSObjectIsKindOfClass(id object, Class kindOf); const NSUInteger NSMaximumStringLength = INT_MAX - 1; NSString *const NSCharacterConversionException = - @"NSCharacterConversionException"; + @"NSCharacterConversionException"; // only needed for Darwin ppc struct objc_class _NSConstantStringClassReference; @@ -166,8 +166,8 @@ int __CFConstantStringClassReference[1]; } - initWithFormat: (NSString *) format - locale: (id) locale - arguments: (va_list) arguments + locale: (id) locale + arguments: (va_list) arguments { NSInvalidAbstractInvocation(); return nil; @@ -221,8 +221,8 @@ int __CFConstantStringClassReference[1]; } - initWithFileData: (NSData *) data - usedEncoding: (NSStringEncoding *) encodingp - error: (NSError **) error + usedEncoding: (NSStringEncoding *) encodingp + error: (NSError **) error { NSStringEncoding encoding = NSNEXTSTEPStringEncoding; NSString *string; @@ -258,8 +258,8 @@ int __CFConstantStringClassReference[1]; } - initWithBytes: (const void *) bytes - length: (NSUInteger) length - encoding: (NSStringEncoding) encoding + length: (NSUInteger) length + encoding: (NSStringEncoding) encoding { NSInvalidAbstractInvocation(); return 0; @@ -349,14 +349,14 @@ int __CFConstantStringClassReference[1]; if (!stringEncodings) { NSString *path = [[NSBundle bundleForClass: self] - pathForResource: @"NSStringEncodingNames" - ofType: @"plist"]; + pathForResource: @"NSStringEncodingNames" + ofType: @"plist"]; if (path != nil) { NSDictionary *plist = - [[NSDictionary alloc] initWithContentsOfFile: path]; + [[NSDictionary alloc] initWithContentsOfFile: path]; stringEncodings = - malloc(sizeof(NSStringEncoding) * [plist count] + 1); + malloc(sizeof(NSStringEncoding) * [plist count] + 1); NSEnumerator *keyEnumerator = [plist keyEnumerator]; int index = 0; @@ -381,12 +381,12 @@ int __CFConstantStringClassReference[1]; + (NSString *) localizedNameOfStringEncoding: (NSStringEncoding) encoding { NSString *result = [NSString stringWithFormat: @"0x%08X", encoding]; NSString *path = [[NSBundle bundleForClass: self] - pathForResource: @"NSStringEncodingNames" - ofType: @"plist"]; + pathForResource: @"NSStringEncodingNames" + ofType: @"plist"]; if (path != nil) { NSDictionary *plist = - [[NSDictionary alloc] initWithContentsOfFile: path]; + [[NSDictionary alloc] initWithContentsOfFile: path]; NSString *check = [plist objectForKey: result]; if (check != nil) @@ -399,9 +399,9 @@ int __CFConstantStringClassReference[1]; } + stringWithCharacters: (const unichar *) unicode length: (NSUInteger) length { - return - [[[self allocWithZone: NULL] initWithCharacters: unicode - length: length] autorelease]; + return [[[self allocWithZone: NULL] initWithCharacters: unicode + length: length] + autorelease]; } + string { @@ -434,9 +434,9 @@ int __CFConstantStringClassReference[1]; va_start(arguments, format); id result; - result = - [[[self allocWithZone: NULL] initWithFormat: format - arguments: arguments] autorelease]; + result = [[[self allocWithZone: NULL] initWithFormat: format + arguments: arguments] + autorelease]; va_end(arguments); @@ -444,8 +444,8 @@ int __CFConstantStringClassReference[1]; } + stringWithContentsOfFile: (NSString *) path { - return - [[[self allocWithZone: NULL] initWithContentsOfFile: path] autorelease]; + return [[[self allocWithZone: NULL] initWithContentsOfFile: path] + autorelease]; } + stringWithContentsOfFile: (NSString *) path @@ -455,7 +455,7 @@ int __CFConstantStringClassReference[1]; return [[[self allocWithZone: NULL] initWithContentsOfFile: path encoding: encoding error: error] - autorelease]; + autorelease]; } + stringWithContentsOfFile: (NSString *) path @@ -465,32 +465,32 @@ int __CFConstantStringClassReference[1]; return [[[self allocWithZone: NULL] initWithContentsOfFile: path usedEncoding: encoding error: error] - autorelease]; + autorelease]; } + stringWithContentsOfURL: (NSURL *) url encoding: (NSStringEncoding) encoding error: (NSError **) error { - return - [[[self allocWithZone: NULL] initWithContentsOfURL: url - encoding: encoding - error: error] autorelease]; + return [[[self allocWithZone: NULL] initWithContentsOfURL: url + encoding: encoding + error: error] + autorelease]; } + stringWithContentsOfURL: (NSURL *) url usedEncoding: (NSStringEncoding *) encoding error: (NSError **) error { - return - [[[self allocWithZone: NULL] initWithContentsOfURL: url - usedEncoding: encoding - error: error] autorelease]; + return [[[self allocWithZone: NULL] initWithContentsOfURL: url + usedEncoding: encoding + error: error] + autorelease]; } + stringWithUTF8String: (const char *) utf8 { - return - [[[NSString allocWithZone: NULL] initWithUTF8String: utf8] autorelease]; + return [[[NSString allocWithZone: NULL] initWithUTF8String: utf8] + autorelease]; } + localizedStringWithFormat: (NSString *) format, ... { @@ -499,7 +499,7 @@ int __CFConstantStringClassReference[1]; va_start(arguments, format); id result = NSAutorelease(NSStringNewWithFormat( - format, [NSLocale currentLocale], arguments, NULL)); + format, [NSLocale currentLocale], arguments, NULL)); va_end(arguments); @@ -545,7 +545,7 @@ int __CFConstantStringClassReference[1]; else { NSUInteger resultLength; unichar *characters = - NSUTF8ToUnicode(bytes, length, &resultLength, NULL); + NSUTF8ToUnicode(bytes, length, &resultLength, NULL); return NSString_unicodePtrNewNoCopy(NULL, characters, resultLength, YES); @@ -931,7 +931,7 @@ static inline void reverseString(unichar *buf, NSUInteger len) { computeNext(next, patbuffer, patlength); NSRange foundRange = - rangeOfPatternNext(buffer, patbuffer, next, patlength, range); + rangeOfPatternNext(buffer, patbuffer, next, patlength, range); if (options & NSAnchoredSearch && foundRange.location != 0) { NSZoneFree(NULL, buffer); NSZoneFree(NULL, patbuffer); @@ -1505,10 +1505,10 @@ static inline void reverseString(unichar *buf, NSUInteger len) { where = rangeOfPatternNext(buffer, patbuffer, next, patlength, search); if (where.length > 0) { - NSString *piece = - [self substringWithRange: NSMakeRange(search.location, - where.location - - search.location)]; + NSString *piece = [self + substringWithRange: NSMakeRange(search.location, + where.location - + search.location)]; [result addObject: piece]; search.location = where.location + where.length; @@ -1533,8 +1533,8 @@ static inline void reverseString(unichar *buf, NSUInteger len) { BOOL found, sepFound; [scanner setCharactersToBeSkipped: nil]; sepFound = [scanner - scanCharactersFromSet: set - intoString: &sepScan]; // skip any preceding separators + scanCharactersFromSet: set + intoString: &sepScan]; // skip any preceding separators if (sepFound) { // if initial separator(s), start with empty component(s) NSInteger sepCount = [sepScan length]; while (sepCount--) { @@ -1584,7 +1584,7 @@ static inline void reverseString(unichar *buf, NSUInteger len) { NSString *last = [self substringFromIndex: NSMaxRange(range)]; return [[first stringByAppendingString: substitute] - stringByAppendingString: last]; + stringByAppendingString: last]; } - (NSString *) stringByReplacingOccurrencesOfString: (NSString *) original @@ -1601,11 +1601,11 @@ static inline void reverseString(unichar *buf, NSUInteger len) { return ret; } -- (NSString *) stringByReplacingOccurrencesOfString: (NSString *) original - withString: (NSString *) substitute - options: - (NSStringCompareOptions) options - range: (NSRange) range +- (NSString *) + stringByReplacingOccurrencesOfString: (NSString *) original + withString: (NSString *) substitute + options: (NSStringCompareOptions) options + range: (NSRange) range { NSMutableString *s = [self mutableCopy]; [s replaceOccurrencesOfString: original @@ -1756,24 +1756,24 @@ static inline void reverseString(unichar *buf, NSUInteger len) { } - (BOOL) getBytes: (void *) buffer - maxLength: (NSUInteger) maxLength - usedLength: (NSUInteger *) usedLength - encoding: (NSStringEncoding) encoding - options: (NSStringEncodingConversionOptions) options - range: (NSRange) range - remainingRange: (NSRange *) remainingRange + maxLength: (NSUInteger) maxLength + usedLength: (NSUInteger *) usedLength + encoding: (NSStringEncoding) encoding + options: (NSStringEncodingConversionOptions) options + range: (NSRange) range + remainingRange: (NSRange *) remainingRange { unichar *unibuffer = - NSZoneMalloc(NULL, (1 + range.length) * sizeof(unichar)); + NSZoneMalloc(NULL, (1 + range.length) * sizeof(unichar)); char *bytes = NULL; NSUInteger byteLength = 0; [self getCharacters: unibuffer range: range]; bytes = NSString_unicodeToAnyCString( - encoding, unibuffer, range.length, - options & NSStringEncodingConversionAllowLossy ? YES : NO, &byteLength, - [self zone], NO); + encoding, unibuffer, range.length, + options & NSStringEncodingConversionAllowLossy ? YES : NO, + &byteLength, [self zone], NO); if (bytes == NULL) { NSZoneFree(NULL, unibuffer); return NO; @@ -1788,7 +1788,7 @@ static inline void reverseString(unichar *buf, NSUInteger len) { remainingRange->length = byteLength - maxLength; } remainingRange->location = - range.location + range.length - remainingRange->length; + range.location + range.length - remainingRange->length; } memcpy(buffer, bytes, maxLength < byteLength ? maxLength : byteLength); @@ -1822,7 +1822,7 @@ static inline void reverseString(unichar *buf, NSUInteger len) { } - (NSString *) stringByReplacingPercentEscapesUsingEncoding: - (NSStringEncoding) encoding + (NSStringEncoding) encoding { // Note : this is supposed to return nil if the escaped char don't make a // valid string for the encoding - this is not checked @@ -1840,8 +1840,8 @@ static inline void reverseString(unichar *buf, NSUInteger len) { NSUInteger length = [data length], resultLength = 0; const unsigned char *buffer = [data bytes]; unsigned char firstCharacter = 0, firstNibble = 0; - unsigned char *result = - NSZoneMalloc(NULL, sizeof(unsigned char) * length); // We can't grow + unsigned char *result = NSZoneMalloc( + NULL, sizeof(unsigned char) * length); // We can't grow if (result == NULL) { NSLog(@"%@: failed to allocate buffer of size %d", NSStringFromSelector(_cmd), length); @@ -1880,10 +1880,10 @@ static inline void reverseString(unichar *buf, NSUInteger len) { result[resultLength++] = firstNibble * 16 + check - '0'; else if (check >= 'a' && check <= 'f') result[resultLength++] = - firstNibble * 16 + (check - 'a') + 10; + firstNibble * 16 + (check - 'a') + 10; else if (check >= 'A' && check <= 'F') result[resultLength++] = - firstNibble * 16 + (check - 'A') + 10; + firstNibble * 16 + (check - 'A') + 10; else { result[resultLength++] = '%'; result[resultLength++] = firstCharacter; @@ -1903,7 +1903,7 @@ static inline void reverseString(unichar *buf, NSUInteger len) { } - (NSString *) stringByAddingPercentEscapesUsingEncoding: - (NSStringEncoding) encoding + (NSStringEncoding) encoding { const char *hex = "0123456789ABCDEF"; @@ -1934,7 +1934,7 @@ static inline void reverseString(unichar *buf, NSUInteger len) { string = [[[NSString alloc] initWithBytes: result length: resultLength encoding: NSASCIIStringEncoding] - autorelease]; + autorelease]; } return string; } @@ -2008,9 +2008,9 @@ static inline void reverseString(unichar *buf, NSUInteger len) { } - (void) getCString: (char *) cString - maxLength: (NSUInteger) maxLength - range: (NSRange) range - remainingRange: (NSRange *) leftoverRange + maxLength: (NSUInteger) maxLength + range: (NSRange) range + remainingRange: (NSRange *) leftoverRange { unichar *unicode = NSZoneMalloc(NULL, range.length * sizeof(unichar)); NSUInteger location; @@ -2036,9 +2036,9 @@ static inline void reverseString(unichar *buf, NSUInteger len) { - (void) getCString: (char *) cString maxLength: (NSUInteger) maxLength { NSRange range = {0, [self length]}; [self getCString: cString - maxLength: maxLength + 1 - range: range - remainingRange: NULL]; + maxLength: maxLength + 1 + range: range + remainingRange: NULL]; } - (void) getCString: (char *) cString { diff --git a/Foundation/NSString/NSStringEncoder.m b/Foundation/NSString/NSStringEncoder.m index 15a91332..96712d06 100644 --- a/Foundation/NSString/NSStringEncoder.m +++ b/Foundation/NSString/NSStringEncoder.m @@ -119,7 +119,7 @@ static const uint16_t *tableForCFEncoding(CFStringEncoding encoding) { static const uint16_t *tableForNSEncoding(NSStringEncoding encoding) { CFStringEncoding cfencoding = - CFStringConvertNSStringEncodingToEncoding(encoding); + CFStringConvertNSStringEncodingToEncoding(encoding); return tableForCFEncoding(cfencoding); } @@ -137,9 +137,10 @@ static NSDictionary *dictionaryForEncoding(NSStringEncoding encoding) { dict = [NSMutableDictionary dictionary]; for (int i = 0; table[i] != (uint16_t) -1; i += 2) { [dict setObject: [NSNumber - numberWithUnsignedShort: table[i + 1]] - forKey: [NSNumber - numberWithUnsignedShort: table[i]]]; + numberWithUnsignedShort: table[i + + 1]] + forKey: [NSNumber numberWithUnsignedShort: + table[i]]]; } [sAllDicts setObject: dict forKey: [NSNumber numberWithInteger: encoding]]; @@ -163,12 +164,10 @@ static NSDictionary *dictionaryForDecoding(NSStringEncoding encoding) { dict = [NSMutableDictionary dictionary]; for (int i = 0; table[i] != (uint16_t) -1; i += 2) { if (table[i] != 0xffff) { - [dict - setObject: [NSNumber - numberWithUnsignedShort: table[i]] - forKey: [NSNumber - numberWithUnsignedShort: table[i + - 1]]]; + [dict setObject: [NSNumber numberWithUnsignedShort: + table[i]] + forKey: [NSNumber numberWithUnsignedShort: + table[i + 1]]]; } } [sAllDicts setObject: dict @@ -193,7 +192,7 @@ unichar *NSBytesToUnicode(const unsigned char *bytes, NSUInteger length, // mask the byte with any pending one (for 2-bytes char translation) current |= bytes[i]; NSNumber *n = [dict - objectForKey: [NSNumber numberWithUnsignedShort: current]]; + objectForKey: [NSNumber numberWithUnsignedShort: current]]; if (n) { uint16_t u = [n unsignedShortValue]; if (u == (uint16_t) -1) { @@ -237,7 +236,7 @@ unsigned char *NSBytesFromUnicode(const unichar *characters, NSUInteger length, if (dict) { NSUInteger charLength = 0; unsigned char *buffer = - NSZoneMalloc(NULL, sizeof(unsigned char) * (length * 2)); + NSZoneMalloc(NULL, sizeof(unsigned char) * (length * 2)); if (buffer == NULL) { NSCLog("NSBytesFromUnicode: can't allocate buffer of size %d", length * 2); @@ -245,9 +244,8 @@ unsigned char *NSBytesFromUnicode(const unichar *characters, NSUInteger length, } for (NSUInteger i = 0; i < length; ++i) { // mask the byte with any pending one (for 2-bytes char translation) - NSNumber *n = [dict - objectForKey: [NSNumber - numberWithUnsignedShort: characters[i]]]; + NSNumber *n = [dict objectForKey: [NSNumber numberWithUnsignedShort: + characters[i]]]; if (n) { uint16_t u = [n unsignedShortValue]; if (u >= 0x100) { diff --git a/Foundation/NSString/NSStringFormatter.m b/Foundation/NSString/NSStringFormatter.m index 2493c4f5..e830c9a2 100644 --- a/Foundation/NSString/NSStringFormatter.m +++ b/Foundation/NSString/NSStringFormatter.m @@ -40,7 +40,7 @@ static inline void prepForUse(NSStringBuffer *buffer, NSZone *zone) { buffer->max = 1024; buffer->length = 0; buffer->characters = - NSZoneMalloc(buffer->zone, sizeof(unichar) * buffer->max); + NSZoneMalloc(buffer->zone, sizeof(unichar) * buffer->max); } static inline void makeRoomForNcharacters(NSStringBuffer *buffer, NSUInteger n) @@ -293,8 +293,8 @@ static inline void appendFloat(NSStringBuffer *buffer, double value, unichar characters[100]; // copysign will give the correct result for negatve zero unichar sign = (copysign(1.0, value) < 0) - ? '-' - : plusSign ? '+' : spaceSign ? ' ' : '\0'; + ? '-' + : plusSign ? '+' : spaceSign ? ' ' : '\0'; NSUInteger groupingLength = [groupingSeparator length]; unichar groupingBuffer[groupingLength]; @@ -335,8 +335,8 @@ static inline void appendFloat(NSStringBuffer *buffer, double value, if (groupingSize) { if ((numberOfIntegralDigits % groupingSize) == 0) { NSInteger count = - groupingLength; // we append backwards because the - // string gets reversed + groupingLength; // we append backwards because the + // string gets reversed while (--count >= 0) characters[length++] = groupingBuffer[count]; @@ -360,14 +360,14 @@ static inline void appendFloat(NSStringBuffer *buffer, double value, if (locale) seperatorString = - [locale objectForKey: NSLocaleDecimalSeparator]; + [locale objectForKey: NSLocaleDecimalSeparator]; else seperatorString = [[NSLocale systemLocale] - objectForKey: NSLocaleDecimalSeparator]; + objectForKey: NSLocaleDecimalSeparator]; decimalSeperator = ([seperatorString length] > 0) - ? [seperatorString characterAtIndex: 0] - : '.'; + ? [seperatorString characterAtIndex: 0] + : '.'; unsigned start = length; BOOL fractZero = YES; @@ -375,7 +375,7 @@ static inline void appendFloat(NSStringBuffer *buffer, double value, for (i = 0, j = 0; i < precision; i++, j++, length++) { fractional *= 10.0; if ((characters[length] = - (unichar) fmod(fractional, 10.0) + '0') != '0') + (unichar) fmod(fractional, 10.0) + '0') != '0') fractZero = NO; else if (gFormat && intZero && fractZero && (j - i) < 5) i--; @@ -782,7 +782,7 @@ NSString *NSStringNewWithFormat(NSString *format, NSDictionary *locale, unichar *unicode; unicode = - NSCharactersNewWithFormat(format, locale, arguments, &length, NULL); + NSCharactersNewWithFormat(format, locale, arguments, &length, NULL); return NSString_unicodePtrNewNoCopy(zone, unicode, length, YES); } @@ -793,7 +793,7 @@ NSString *NSStringWithFormat(NSString *format, ...) { va_start(arguments, format); NSString *result = - NSAutorelease(NSStringNewWithFormat(format, nil, arguments, NULL)); + NSAutorelease(NSStringNewWithFormat(format, nil, arguments, NULL)); va_end(arguments); return result; } @@ -809,8 +809,8 @@ NSString *NSStringWithFormatAndLocale(NSString *format, NSDictionary *locale, va_start(arguments, locale); - NSString *result = - NSAutorelease(NSStringNewWithFormat(format, locale, arguments, NULL)); + NSString *result = NSAutorelease( + NSStringNewWithFormat(format, locale, arguments, NULL)); va_end(arguments); diff --git a/Foundation/NSString/NSStringHashing.h b/Foundation/NSString/NSStringHashing.h index fd7e7bc0..4d326c17 100644 --- a/Foundation/NSString/NSStringHashing.h +++ b/Foundation/NSString/NSStringHashing.h @@ -41,7 +41,7 @@ static inline NSUInteger NSStringHashASCII(const char *buffer, for (i = 0; i < length; i++) result = - ((result << 5) + result) + (NSUInteger)(buffer[i]); // hash*33+c + ((result << 5) + result) + (NSUInteger)(buffer[i]); // hash*33+c return result; } @@ -51,7 +51,7 @@ static inline NSUInteger NSStringHashZeroTerminatedASCII(const char *buffer) { for (i = 0; buffer[i] != '\0'; i++) result = - ((result << 5) + result) + (NSUInteger)(buffer[i]); // hash*33+c + ((result << 5) + result) + (NSUInteger)(buffer[i]); // hash*33+c return result; } diff --git a/Foundation/NSString/NSStringSymbol.m b/Foundation/NSString/NSStringSymbol.m index adb3d621..5faf59fc 100644 --- a/Foundation/NSString/NSStringSymbol.m +++ b/Foundation/NSString/NSStringSymbol.m @@ -21,35 +21,35 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import static const unichar SymbolToUnicode[256] = { - 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, - 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, - 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, - 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0020, 0x0021, 0x2200, 0x0023, - 0x2203, 0x0025, 0x0026, 0x220B, 0x0028, 0x0029, 0x2217, 0x002B, 0x002C, - 0x2212, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, - 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, - 0x003F, 0x2245, 0x0391, 0x0392, 0x03A7, 0x0394, 0x0395, 0x03A6, 0x0393, - 0x0397, 0x0399, 0x03D1, 0x039A, 0x039B, 0x039C, 0x039D, 0x039F, 0x03A0, - 0x0398, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03C2, 0x03A9, 0x039E, 0x03A8, - 0x0396, 0x005B, 0x2234, 0x005D, 0x22A5, 0x005F, 0x203E, 0x03B1, 0x03B2, - 0x03C7, 0x03B4, 0x03B5, 0x03C6, 0x03B3, 0x03B7, 0x03B9, 0x03D5, 0x03BA, - 0x03BB, 0x03BC, 0x03BD, 0x03BF, 0x03C0, 0x03B8, 0x03C1, 0x03C3, 0x03C4, - 0x03C5, 0x03D6, 0x03C9, 0x03BE, 0x03C8, 0x03B6, 0x007B, 0x007C, 0x007D, - 0x223C, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, - 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, - 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, - 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x03D2, - 0x2032, 0x2264, 0x2215, 0x221E, 0x0192, 0x2663, 0x2666, 0x2665, 0x2660, - 0x2194, 0x2190, 0x2191, 0x2192, 0x2193, 0x00B0, 0x00B1, 0x2033, 0x2265, - 0x00D7, 0x221D, 0x2202, 0x2022, 0x00F7, 0x2260, 0x2261, 0x2248, 0x2026, - 0xFFFD, 0xFFFD, 0x21B5, 0x2135, 0x2111, 0x211C, 0x2118, 0x2297, 0x2295, - 0x2205, 0x2229, 0x222A, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, - 0x2209, 0x2220, 0x2207, 0x00AE, 0x00A9, 0x2122, 0x220F, 0x221A, 0x22C5, - 0x00AC, 0x2227, 0x2228, 0x21D4, 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x25CA, - 0x2329, 0x00AE, 0x00A9, 0x2122, 0x2211, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, - 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x232A, 0x222B, - 0x2320, 0xFFFD, 0x2321, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, - 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0020, 0x0021, 0x2200, 0x0023, + 0x2203, 0x0025, 0x0026, 0x220B, 0x0028, 0x0029, 0x2217, 0x002B, 0x002C, + 0x2212, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, + 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, + 0x003F, 0x2245, 0x0391, 0x0392, 0x03A7, 0x0394, 0x0395, 0x03A6, 0x0393, + 0x0397, 0x0399, 0x03D1, 0x039A, 0x039B, 0x039C, 0x039D, 0x039F, 0x03A0, + 0x0398, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03C2, 0x03A9, 0x039E, 0x03A8, + 0x0396, 0x005B, 0x2234, 0x005D, 0x22A5, 0x005F, 0x203E, 0x03B1, 0x03B2, + 0x03C7, 0x03B4, 0x03B5, 0x03C6, 0x03B3, 0x03B7, 0x03B9, 0x03D5, 0x03BA, + 0x03BB, 0x03BC, 0x03BD, 0x03BF, 0x03C0, 0x03B8, 0x03C1, 0x03C3, 0x03C4, + 0x03C5, 0x03D6, 0x03C9, 0x03BE, 0x03C8, 0x03B6, 0x007B, 0x007C, 0x007D, + 0x223C, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x03D2, + 0x2032, 0x2264, 0x2215, 0x221E, 0x0192, 0x2663, 0x2666, 0x2665, 0x2660, + 0x2194, 0x2190, 0x2191, 0x2192, 0x2193, 0x00B0, 0x00B1, 0x2033, 0x2265, + 0x00D7, 0x221D, 0x2202, 0x2022, 0x00F7, 0x2260, 0x2261, 0x2248, 0x2026, + 0xFFFD, 0xFFFD, 0x21B5, 0x2135, 0x2111, 0x211C, 0x2118, 0x2297, 0x2295, + 0x2205, 0x2229, 0x222A, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, + 0x2209, 0x2220, 0x2207, 0x00AE, 0x00A9, 0x2122, 0x220F, 0x221A, 0x22C5, + 0x00AC, 0x2227, 0x2228, 0x21D4, 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x25CA, + 0x2329, 0x00AE, 0x00A9, 0x2122, 0x2211, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x232A, 0x222B, + 0x2320, 0xFFFD, 0x2321, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, }; unichar *NSSymbolToUnicode(const char *symbols, NSUInteger length, @@ -70,7 +70,7 @@ char *NSUnicodeToSymbol(const unichar *characters, NSUInteger length, BOOL zeroTerminate) { char *symbols = NSZoneMalloc( - zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); + zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); int i, j; for (i = 0; i < length; i++) { diff --git a/Foundation/NSString/NSStringUTF8.m b/Foundation/NSString/NSStringUTF8.m index e3ac6026..59f45797 100644 --- a/Foundation/NSString/NSStringUTF8.m +++ b/Foundation/NSString/NSStringUTF8.m @@ -134,12 +134,12 @@ char *NSUnicodeToUTF8(const unichar *characters, NSUInteger length, BOOL lossy, BOOL zeroTerminate) { NSUInteger utf8Length = _NSGetUTF8CStringWithMaxLength( - characters, length, NULL, NULL, UINT_MAX, NO); + characters, length, NULL, NULL, UINT_MAX, NO); NSUInteger maxLength = utf8Length + (zeroTerminate ? 1 : 0); char *utf8 = NSZoneMalloc(NULL, maxLength * sizeof(unsigned char)); *resultLength = _NSGetUTF8CStringWithMaxLength( - characters, length, NULL, utf8, maxLength, zeroTerminate); + characters, length, NULL, utf8, maxLength, zeroTerminate); if (zeroTerminate) { (*resultLength)++; } @@ -201,7 +201,7 @@ unichar *NSUTF8ToUnicode(const char *utf8, NSUInteger length, NSUInteger *resultLength, NSZone *zone) { NSUInteger utf16Length = - NSConvertUTF8toUTF16((unsigned char *) utf8, length, NULL); + NSConvertUTF8toUTF16((unsigned char *) utf8, length, NULL); unichar *utf16 = NSZoneMalloc(NULL, utf16Length * sizeof(unichar)); *resultLength = NSConvertUTF8toUTF16((unsigned char *) utf8, length, utf16); diff --git a/Foundation/NSString/NSString_cString.m b/Foundation/NSString/NSString_cString.m index 5846a6fe..c8509282 100644 --- a/Foundation/NSString/NSString_cString.m +++ b/Foundation/NSString/NSString_cString.m @@ -141,7 +141,7 @@ unichar *NSString_anyCStringToUnicode(NSStringEncoding encoding, return NSUTF8ToUnicode(cString, length, resultLength, zone); default: { unichar *chars = - NSBytesToUnicode(cString, length, encoding, resultLength, zone); + NSBytesToUnicode(cString, length, encoding, resultLength, zone); if (chars) { return chars; } @@ -216,11 +216,11 @@ NSString *NSString_anyCStringNewWithBytes(NSStringEncoding encoding, default: { NSUInteger decodedLength = 0; unichar *chars = - NSBytesToUnicode(bytes, length, encoding, &decodedLength, zone); + NSBytesToUnicode(bytes, length, encoding, &decodedLength, zone); if (chars) { NSString *result = [[NSString allocWithZone: zone] - initWithCharacters: chars - length: decodedLength]; + initWithCharacters: chars + length: decodedLength]; NSZoneFree(zone, chars); return result; } @@ -304,7 +304,7 @@ NSUInteger NSGetAnyCStringWithMaxLength(NSStringEncoding encoding, logEncodingError(encoding); // we're using an unsupported default encoding - assuming NextSTEP return NSGetNEXTSTEPCStringWithMaxLength( - characters, length, location, cString, maxLength, lossy); + characters, length, location, cString, maxLength, lossy); } else { NSUInteger len = MIN(decodedLength, maxLength); memcpy(cString, bytes, len); diff --git a/Foundation/NSString/NSString_isoLatin1.m b/Foundation/NSString/NSString_isoLatin1.m index 1f92ce24..27b17c85 100644 --- a/Foundation/NSString/NSString_isoLatin1.m +++ b/Foundation/NSString/NSString_isoLatin1.m @@ -38,7 +38,7 @@ char *NSUnicodeToISOLatin1(const unichar *characters, NSUInteger length, BOOL zeroTerminate) { char *isolatin1 = NSZoneMalloc( - zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); + zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); int i; for (i = 0; i < length; i++) { @@ -101,8 +101,8 @@ NSString *NSISOLatin1CStringNewWithCharacters(NSZone *zone, NSUInteger bytesLength; char *bytes; - bytes = - NSUnicodeToISOLatin1(characters, length, lossy, &bytesLength, zone, NO); + bytes = NSUnicodeToISOLatin1(characters, length, lossy, &bytesLength, zone, + NO); if (bytes == NULL) string = nil; diff --git a/Foundation/NSString/NSString_isoLatin2.m b/Foundation/NSString/NSString_isoLatin2.m index 2d6445da..dc82c691 100644 --- a/Foundation/NSString/NSString_isoLatin2.m +++ b/Foundation/NSString/NSString_isoLatin2.m @@ -27,182 +27,184 @@ typedef struct { } CharMapping; static CharMapping mapping_array[] = { - {(const unsigned char) 0xA1, - (const unichar) 0x0104}, // LATIN CAPITAL LETTER A WITH OGONEK - {(const unsigned char) 0xA2, (const unichar) 0x02D8}, // BREVE - {(const unsigned char) 0xA3, - (const unichar) 0x0141}, // LATIN CAPITAL LETTER L WITH STROKE - {(const unsigned char) 0xA4, (const unichar) 0x00A4}, // CURRENCY SIGN - {(const unsigned char) 0xA5, - (const unichar) 0x013D}, // LATIN CAPITAL LETTER L WITH CARON - {(const unsigned char) 0xA6, - (const unichar) 0x015A}, // LATIN CAPITAL LETTER S WITH ACUTE - {(const unsigned char) 0xA7, (const unichar) 0x00A7}, // SECTION SIGN - {(const unsigned char) 0xA8, (const unichar) 0x00A8}, // DIAERESIS - {(const unsigned char) 0xA9, - (const unichar) 0x0160}, // LATIN CAPITAL LETTER S WITH CARON - {(const unsigned char) 0xAA, - (const unichar) 0x015E}, // LATIN CAPITAL LETTER S WITH CEDILLA - {(const unsigned char) 0xAB, - (const unichar) 0x0164}, // LATIN CAPITAL LETTER T WITH CARON - {(const unsigned char) 0xAC, - (const unichar) 0x0179}, // LATIN CAPITAL LETTER Z WITH ACUTE - {(const unsigned char) 0xAD, (const unichar) 0x00AD}, // SOFT HYPHEN - {(const unsigned char) 0xAE, - (const unichar) 0x017D}, // LATIN CAPITAL LETTER Z WITH CARON - {(const unsigned char) 0xAF, - (const unichar) 0x017B}, // LATIN CAPITAL LETTER Z WITH DOT ABOVE - {(const unsigned char) 0xB0, (const unichar) 0x00B0}, // DEGREE SIGN - {(const unsigned char) 0xB1, - (const unichar) 0x0105}, // LATIN SMALL LETTER A WITH OGONEK - {(const unsigned char) 0xB2, (const unichar) 0x02DB}, // OGONEK - {(const unsigned char) 0xB3, - (const unichar) 0x0142}, // LATIN SMALL LETTER L WITH STROKE - {(const unsigned char) 0xB4, (const unichar) 0x00B4}, // ACUTE ACCENT - {(const unsigned char) 0xB5, - (const unichar) 0x013E}, // LATIN SMALL LETTER L WITH CARON - {(const unsigned char) 0xB6, - (const unichar) 0x015B}, // LATIN SMALL LETTER S WITH ACUTE - {(const unsigned char) 0xB7, (const unichar) 0x02C7}, // CARON - {(const unsigned char) 0xB8, (const unichar) 0x00B8}, // CEDILLA - {(const unsigned char) 0xB9, - (const unichar) 0x0161}, // LATIN SMALL LETTER S WITH CARON - {(const unsigned char) 0xBA, - (const unichar) 0x015F}, // LATIN SMALL LETTER S WITH CEDILLA - {(const unsigned char) 0xBB, - (const unichar) 0x0165}, // LATIN SMALL LETTER T WITH CARON - {(const unsigned char) 0xBC, - (const unichar) 0x017A}, // LATIN SMALL LETTER Z WITH ACUTE - {(const unsigned char) 0xBD, (const unichar) 0x02DD}, // DOUBLE ACUTE ACCENT - {(const unsigned char) 0xBE, - (const unichar) 0x017E}, // LATIN SMALL LETTER Z WITH CARON - {(const unsigned char) 0xBF, - (const unichar) 0x017C}, // LATIN SMALL LETTER Z WITH DOT ABOVE - {(const unsigned char) 0xC0, - (const unichar) 0x0154}, // LATIN CAPITAL LETTER R WITH ACUTE - {(const unsigned char) 0xC1, - (const unichar) 0x00C1}, // LATIN CAPITAL LETTER A WITH ACUTE - {(const unsigned char) 0xC2, - (const unichar) 0x00C2}, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX - {(const unsigned char) 0xC3, - (const unichar) 0x0102}, // LATIN CAPITAL LETTER A WITH BREVE - {(const unsigned char) 0xC4, - (const unichar) 0x00C4}, // LATIN CAPITAL LETTER A WITH DIAERESIS - {(const unsigned char) 0xC5, - (const unichar) 0x0139}, // LATIN CAPITAL LETTER L WITH ACUTE - {(const unsigned char) 0xC6, - (const unichar) 0x0106}, // LATIN CAPITAL LETTER C WITH ACUTE - {(const unsigned char) 0xC7, - (const unichar) 0x00C7}, // LATIN CAPITAL LETTER C WITH CEDILLA - {(const unsigned char) 0xC8, - (const unichar) 0x010C}, // LATIN CAPITAL LETTER C WITH CARON - {(const unsigned char) 0xC9, - (const unichar) 0x00C9}, // LATIN CAPITAL LETTER E WITH ACUTE - {(const unsigned char) 0xCA, - (const unichar) 0x0118}, // LATIN CAPITAL LETTER E WITH OGONEK - {(const unsigned char) 0xCB, - (const unichar) 0x00CB}, // LATIN CAPITAL LETTER E WITH DIAERESIS - {(const unsigned char) 0xCC, - (const unichar) 0x011A}, // LATIN CAPITAL LETTER E WITH CARON - {(const unsigned char) 0xCD, - (const unichar) 0x00CD}, // LATIN CAPITAL LETTER I WITH ACUTE - {(const unsigned char) 0xCE, - (const unichar) 0x00CE}, // LATIN CAPITAL LETTER I WITH CIRCUMFLEX - {(const unsigned char) 0xCF, - (const unichar) 0x010E}, // LATIN CAPITAL LETTER D WITH CARON - {(const unsigned char) 0xD0, - (const unichar) 0x0110}, // LATIN CAPITAL LETTER D WITH STROKE - {(const unsigned char) 0xD1, - (const unichar) 0x0143}, // LATIN CAPITAL LETTER N WITH ACUTE - {(const unsigned char) 0xD2, - (const unichar) 0x0147}, // LATIN CAPITAL LETTER N WITH CARON - {(const unsigned char) 0xD3, - (const unichar) 0x00D3}, // LATIN CAPITAL LETTER O WITH ACUTE - {(const unsigned char) 0xD4, - (const unichar) 0x00D4}, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX - {(const unsigned char) 0xD5, - (const unichar) 0x0150}, // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE - {(const unsigned char) 0xD6, - (const unichar) 0x00D6}, // LATIN CAPITAL LETTER O WITH DIAERESIS - {(const unsigned char) 0xD7, (const unichar) 0x00D7}, // MULTIPLICATION SIGN - {(const unsigned char) 0xD8, - (const unichar) 0x0158}, // LATIN CAPITAL LETTER R WITH CARON - {(const unsigned char) 0xD9, - (const unichar) 0x016E}, // LATIN CAPITAL LETTER U WITH RING ABOVE - {(const unsigned char) 0xDA, - (const unichar) 0x00DA}, // LATIN CAPITAL LETTER U WITH ACUTE - {(const unsigned char) 0xDB, - (const unichar) 0x0170}, // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE - {(const unsigned char) 0xDC, - (const unichar) 0x00DC}, // LATIN CAPITAL LETTER U WITH DIAERESIS - {(const unsigned char) 0xDD, - (const unichar) 0x00DD}, // LATIN CAPITAL LETTER Y WITH ACUTE - {(const unsigned char) 0xDE, - (const unichar) 0x0162}, // LATIN CAPITAL LETTER T WITH CEDILLA - {(const unsigned char) 0xDF, - (const unichar) 0x00DF}, // LATIN SMALL LETTER SHARP S - {(const unsigned char) 0xE0, - (const unichar) 0x0155}, // LATIN SMALL LETTER R WITH ACUTE - {(const unsigned char) 0xE1, - (const unichar) 0x00E1}, // LATIN SMALL LETTER A WITH ACUTE - {(const unsigned char) 0xE2, - (const unichar) 0x00E2}, // LATIN SMALL LETTER A WITH CIRCUMFLEX - {(const unsigned char) 0xE3, - (const unichar) 0x0103}, // LATIN SMALL LETTER A WITH BREVE - {(const unsigned char) 0xE4, - (const unichar) 0x00E4}, // LATIN SMALL LETTER A WITH DIAERESIS - {(const unsigned char) 0xE5, - (const unichar) 0x013A}, // LATIN SMALL LETTER L WITH ACUTE - {(const unsigned char) 0xE6, - (const unichar) 0x0107}, // LATIN SMALL LETTER C WITH ACUTE - {(const unsigned char) 0xE7, - (const unichar) 0x00E7}, // LATIN SMALL LETTER C WITH CEDILLA - {(const unsigned char) 0xE8, - (const unichar) 0x010D}, // LATIN SMALL LETTER C WITH CARON - {(const unsigned char) 0xE9, - (const unichar) 0x00E9}, // LATIN SMALL LETTER E WITH ACUTE - {(const unsigned char) 0xEA, - (const unichar) 0x0119}, // LATIN SMALL LETTER E WITH OGONEK - {(const unsigned char) 0xEB, - (const unichar) 0x00EB}, // LATIN SMALL LETTER E WITH DIAERESIS - {(const unsigned char) 0xEC, - (const unichar) 0x011B}, // LATIN SMALL LETTER E WITH CARON - {(const unsigned char) 0xED, - (const unichar) 0x00ED}, // LATIN SMALL LETTER I WITH ACUTE - {(const unsigned char) 0xEE, - (const unichar) 0x00EE}, // LATIN SMALL LETTER I WITH CIRCUMFLEX - {(const unsigned char) 0xEF, - (const unichar) 0x010F}, // LATIN SMALL LETTER D WITH CARON - {(const unsigned char) 0xF0, - (const unichar) 0x0111}, // LATIN SMALL LETTER D WITH STROKE - {(const unsigned char) 0xF1, - (const unichar) 0x0144}, // LATIN SMALL LETTER N WITH ACUTE - {(const unsigned char) 0xF2, - (const unichar) 0x0148}, // LATIN SMALL LETTER N WITH CARON - {(const unsigned char) 0xF3, - (const unichar) 0x00F3}, // LATIN SMALL LETTER O WITH ACUTE - {(const unsigned char) 0xF4, - (const unichar) 0x00F4}, // LATIN SMALL LETTER O WITH CIRCUMFLEX - {(const unsigned char) 0xF5, - (const unichar) 0x0151}, // LATIN SMALL LETTER O WITH DOUBLE ACUTE - {(const unsigned char) 0xF6, - (const unichar) 0x00F6}, // LATIN SMALL LETTER O WITH DIAERESIS - {(const unsigned char) 0xF7, (const unichar) 0x00F7}, // DIVISION SIGN - {(const unsigned char) 0xF8, - (const unichar) 0x0159}, // LATIN SMALL LETTER R WITH CARON - {(const unsigned char) 0xF9, - (const unichar) 0x016F}, // LATIN SMALL LETTER U WITH RING ABOVE - {(const unsigned char) 0xFA, - (const unichar) 0x00FA}, // LATIN SMALL LETTER U WITH ACUTE - {(const unsigned char) 0xFB, - (const unichar) 0x0171}, // LATIN SMALL LETTER U WITH DOUBLE ACUTE - {(const unsigned char) 0xFC, - (const unichar) 0x00FC}, // LATIN SMALL LETTER U WITH DIAERESIS - {(const unsigned char) 0xFD, - (const unichar) 0x00FD}, // LATIN SMALL LETTER Y WITH ACUTE - {(const unsigned char) 0xFE, - (const unichar) 0x0163}, // LATIN SMALL LETTER T WITH CEDILLA - {(const unsigned char) 0xFF, (const unichar) 0x02D9} // DOT ABOVE + {(const unsigned char) 0xA1, + (const unichar) 0x0104}, // LATIN CAPITAL LETTER A WITH OGONEK + {(const unsigned char) 0xA2, (const unichar) 0x02D8}, // BREVE + {(const unsigned char) 0xA3, + (const unichar) 0x0141}, // LATIN CAPITAL LETTER L WITH STROKE + {(const unsigned char) 0xA4, (const unichar) 0x00A4}, // CURRENCY SIGN + {(const unsigned char) 0xA5, + (const unichar) 0x013D}, // LATIN CAPITAL LETTER L WITH CARON + {(const unsigned char) 0xA6, + (const unichar) 0x015A}, // LATIN CAPITAL LETTER S WITH ACUTE + {(const unsigned char) 0xA7, (const unichar) 0x00A7}, // SECTION SIGN + {(const unsigned char) 0xA8, (const unichar) 0x00A8}, // DIAERESIS + {(const unsigned char) 0xA9, + (const unichar) 0x0160}, // LATIN CAPITAL LETTER S WITH CARON + {(const unsigned char) 0xAA, + (const unichar) 0x015E}, // LATIN CAPITAL LETTER S WITH CEDILLA + {(const unsigned char) 0xAB, + (const unichar) 0x0164}, // LATIN CAPITAL LETTER T WITH CARON + {(const unsigned char) 0xAC, + (const unichar) 0x0179}, // LATIN CAPITAL LETTER Z WITH ACUTE + {(const unsigned char) 0xAD, (const unichar) 0x00AD}, // SOFT HYPHEN + {(const unsigned char) 0xAE, + (const unichar) 0x017D}, // LATIN CAPITAL LETTER Z WITH CARON + {(const unsigned char) 0xAF, + (const unichar) 0x017B}, // LATIN CAPITAL LETTER Z WITH DOT ABOVE + {(const unsigned char) 0xB0, (const unichar) 0x00B0}, // DEGREE SIGN + {(const unsigned char) 0xB1, + (const unichar) 0x0105}, // LATIN SMALL LETTER A WITH OGONEK + {(const unsigned char) 0xB2, (const unichar) 0x02DB}, // OGONEK + {(const unsigned char) 0xB3, + (const unichar) 0x0142}, // LATIN SMALL LETTER L WITH STROKE + {(const unsigned char) 0xB4, (const unichar) 0x00B4}, // ACUTE ACCENT + {(const unsigned char) 0xB5, + (const unichar) 0x013E}, // LATIN SMALL LETTER L WITH CARON + {(const unsigned char) 0xB6, + (const unichar) 0x015B}, // LATIN SMALL LETTER S WITH ACUTE + {(const unsigned char) 0xB7, (const unichar) 0x02C7}, // CARON + {(const unsigned char) 0xB8, (const unichar) 0x00B8}, // CEDILLA + {(const unsigned char) 0xB9, + (const unichar) 0x0161}, // LATIN SMALL LETTER S WITH CARON + {(const unsigned char) 0xBA, + (const unichar) 0x015F}, // LATIN SMALL LETTER S WITH CEDILLA + {(const unsigned char) 0xBB, + (const unichar) 0x0165}, // LATIN SMALL LETTER T WITH CARON + {(const unsigned char) 0xBC, + (const unichar) 0x017A}, // LATIN SMALL LETTER Z WITH ACUTE + {(const unsigned char) 0xBD, + (const unichar) 0x02DD}, // DOUBLE ACUTE ACCENT + {(const unsigned char) 0xBE, + (const unichar) 0x017E}, // LATIN SMALL LETTER Z WITH CARON + {(const unsigned char) 0xBF, + (const unichar) 0x017C}, // LATIN SMALL LETTER Z WITH DOT ABOVE + {(const unsigned char) 0xC0, + (const unichar) 0x0154}, // LATIN CAPITAL LETTER R WITH ACUTE + {(const unsigned char) 0xC1, + (const unichar) 0x00C1}, // LATIN CAPITAL LETTER A WITH ACUTE + {(const unsigned char) 0xC2, + (const unichar) 0x00C2}, // LATIN CAPITAL LETTER A WITH CIRCUMFLEX + {(const unsigned char) 0xC3, + (const unichar) 0x0102}, // LATIN CAPITAL LETTER A WITH BREVE + {(const unsigned char) 0xC4, + (const unichar) 0x00C4}, // LATIN CAPITAL LETTER A WITH DIAERESIS + {(const unsigned char) 0xC5, + (const unichar) 0x0139}, // LATIN CAPITAL LETTER L WITH ACUTE + {(const unsigned char) 0xC6, + (const unichar) 0x0106}, // LATIN CAPITAL LETTER C WITH ACUTE + {(const unsigned char) 0xC7, + (const unichar) 0x00C7}, // LATIN CAPITAL LETTER C WITH CEDILLA + {(const unsigned char) 0xC8, + (const unichar) 0x010C}, // LATIN CAPITAL LETTER C WITH CARON + {(const unsigned char) 0xC9, + (const unichar) 0x00C9}, // LATIN CAPITAL LETTER E WITH ACUTE + {(const unsigned char) 0xCA, + (const unichar) 0x0118}, // LATIN CAPITAL LETTER E WITH OGONEK + {(const unsigned char) 0xCB, + (const unichar) 0x00CB}, // LATIN CAPITAL LETTER E WITH DIAERESIS + {(const unsigned char) 0xCC, + (const unichar) 0x011A}, // LATIN CAPITAL LETTER E WITH CARON + {(const unsigned char) 0xCD, + (const unichar) 0x00CD}, // LATIN CAPITAL LETTER I WITH ACUTE + {(const unsigned char) 0xCE, + (const unichar) 0x00CE}, // LATIN CAPITAL LETTER I WITH CIRCUMFLEX + {(const unsigned char) 0xCF, + (const unichar) 0x010E}, // LATIN CAPITAL LETTER D WITH CARON + {(const unsigned char) 0xD0, + (const unichar) 0x0110}, // LATIN CAPITAL LETTER D WITH STROKE + {(const unsigned char) 0xD1, + (const unichar) 0x0143}, // LATIN CAPITAL LETTER N WITH ACUTE + {(const unsigned char) 0xD2, + (const unichar) 0x0147}, // LATIN CAPITAL LETTER N WITH CARON + {(const unsigned char) 0xD3, + (const unichar) 0x00D3}, // LATIN CAPITAL LETTER O WITH ACUTE + {(const unsigned char) 0xD4, + (const unichar) 0x00D4}, // LATIN CAPITAL LETTER O WITH CIRCUMFLEX + {(const unsigned char) 0xD5, + (const unichar) 0x0150}, // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE + {(const unsigned char) 0xD6, + (const unichar) 0x00D6}, // LATIN CAPITAL LETTER O WITH DIAERESIS + {(const unsigned char) 0xD7, + (const unichar) 0x00D7}, // MULTIPLICATION SIGN + {(const unsigned char) 0xD8, + (const unichar) 0x0158}, // LATIN CAPITAL LETTER R WITH CARON + {(const unsigned char) 0xD9, + (const unichar) 0x016E}, // LATIN CAPITAL LETTER U WITH RING ABOVE + {(const unsigned char) 0xDA, + (const unichar) 0x00DA}, // LATIN CAPITAL LETTER U WITH ACUTE + {(const unsigned char) 0xDB, + (const unichar) 0x0170}, // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE + {(const unsigned char) 0xDC, + (const unichar) 0x00DC}, // LATIN CAPITAL LETTER U WITH DIAERESIS + {(const unsigned char) 0xDD, + (const unichar) 0x00DD}, // LATIN CAPITAL LETTER Y WITH ACUTE + {(const unsigned char) 0xDE, + (const unichar) 0x0162}, // LATIN CAPITAL LETTER T WITH CEDILLA + {(const unsigned char) 0xDF, + (const unichar) 0x00DF}, // LATIN SMALL LETTER SHARP S + {(const unsigned char) 0xE0, + (const unichar) 0x0155}, // LATIN SMALL LETTER R WITH ACUTE + {(const unsigned char) 0xE1, + (const unichar) 0x00E1}, // LATIN SMALL LETTER A WITH ACUTE + {(const unsigned char) 0xE2, + (const unichar) 0x00E2}, // LATIN SMALL LETTER A WITH CIRCUMFLEX + {(const unsigned char) 0xE3, + (const unichar) 0x0103}, // LATIN SMALL LETTER A WITH BREVE + {(const unsigned char) 0xE4, + (const unichar) 0x00E4}, // LATIN SMALL LETTER A WITH DIAERESIS + {(const unsigned char) 0xE5, + (const unichar) 0x013A}, // LATIN SMALL LETTER L WITH ACUTE + {(const unsigned char) 0xE6, + (const unichar) 0x0107}, // LATIN SMALL LETTER C WITH ACUTE + {(const unsigned char) 0xE7, + (const unichar) 0x00E7}, // LATIN SMALL LETTER C WITH CEDILLA + {(const unsigned char) 0xE8, + (const unichar) 0x010D}, // LATIN SMALL LETTER C WITH CARON + {(const unsigned char) 0xE9, + (const unichar) 0x00E9}, // LATIN SMALL LETTER E WITH ACUTE + {(const unsigned char) 0xEA, + (const unichar) 0x0119}, // LATIN SMALL LETTER E WITH OGONEK + {(const unsigned char) 0xEB, + (const unichar) 0x00EB}, // LATIN SMALL LETTER E WITH DIAERESIS + {(const unsigned char) 0xEC, + (const unichar) 0x011B}, // LATIN SMALL LETTER E WITH CARON + {(const unsigned char) 0xED, + (const unichar) 0x00ED}, // LATIN SMALL LETTER I WITH ACUTE + {(const unsigned char) 0xEE, + (const unichar) 0x00EE}, // LATIN SMALL LETTER I WITH CIRCUMFLEX + {(const unsigned char) 0xEF, + (const unichar) 0x010F}, // LATIN SMALL LETTER D WITH CARON + {(const unsigned char) 0xF0, + (const unichar) 0x0111}, // LATIN SMALL LETTER D WITH STROKE + {(const unsigned char) 0xF1, + (const unichar) 0x0144}, // LATIN SMALL LETTER N WITH ACUTE + {(const unsigned char) 0xF2, + (const unichar) 0x0148}, // LATIN SMALL LETTER N WITH CARON + {(const unsigned char) 0xF3, + (const unichar) 0x00F3}, // LATIN SMALL LETTER O WITH ACUTE + {(const unsigned char) 0xF4, + (const unichar) 0x00F4}, // LATIN SMALL LETTER O WITH CIRCUMFLEX + {(const unsigned char) 0xF5, + (const unichar) 0x0151}, // LATIN SMALL LETTER O WITH DOUBLE ACUTE + {(const unsigned char) 0xF6, + (const unichar) 0x00F6}, // LATIN SMALL LETTER O WITH DIAERESIS + {(const unsigned char) 0xF7, (const unichar) 0x00F7}, // DIVISION SIGN + {(const unsigned char) 0xF8, + (const unichar) 0x0159}, // LATIN SMALL LETTER R WITH CARON + {(const unsigned char) 0xF9, + (const unichar) 0x016F}, // LATIN SMALL LETTER U WITH RING ABOVE + {(const unsigned char) 0xFA, + (const unichar) 0x00FA}, // LATIN SMALL LETTER U WITH ACUTE + {(const unsigned char) 0xFB, + (const unichar) 0x0171}, // LATIN SMALL LETTER U WITH DOUBLE ACUTE + {(const unsigned char) 0xFC, + (const unichar) 0x00FC}, // LATIN SMALL LETTER U WITH DIAERESIS + {(const unsigned char) 0xFD, + (const unichar) 0x00FD}, // LATIN SMALL LETTER Y WITH ACUTE + {(const unsigned char) 0xFE, + (const unichar) 0x0163}, // LATIN SMALL LETTER T WITH CEDILLA + {(const unsigned char) 0xFF, (const unichar) 0x02D9} // DOT ABOVE }; const unichar _mapISOLatin2ToUnichar(const unsigned char c) { @@ -231,7 +233,7 @@ char *NSUnicodeToISOLatin2(const unichar *characters, NSUInteger length, BOOL zeroTerminate) { char *isolatin2 = NSZoneMalloc( - zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); + zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); int i; for (i = 0; i < length; i++) { @@ -277,8 +279,8 @@ NSString *NSISOLatin2CStringNewWithCharacters(NSZone *zone, NSUInteger bytesLength; char *bytes; - bytes = - NSUnicodeToISOLatin2(characters, length, lossy, &bytesLength, zone, NO); + bytes = NSUnicodeToISOLatin2(characters, length, lossy, &bytesLength, zone, + NO); if (bytes == NULL) string = nil; diff --git a/Foundation/NSString/NSString_macOSRoman.h b/Foundation/NSString/NSString_macOSRoman.h index e8429a3e..419c58b9 100644 --- a/Foundation/NSString/NSString_macOSRoman.h +++ b/Foundation/NSString/NSString_macOSRoman.h @@ -42,5 +42,5 @@ NSString *NSMacOSRomanCStringNewWithCharacters(NSZone *zone, NSUInteger length, BOOL lossy); NSUInteger NSGetMacOSRomanCStringWithMaxLength( - const unichar *characters, NSUInteger length, NSUInteger *location, - char *cString, NSUInteger maxLength, BOOL lossy); + const unichar *characters, NSUInteger length, NSUInteger *location, + char *cString, NSUInteger maxLength, BOOL lossy); diff --git a/Foundation/NSString/NSString_macOSRoman.m b/Foundation/NSString/NSString_macOSRoman.m index b4b78425..f72271d7 100644 --- a/Foundation/NSString/NSString_macOSRoman.m +++ b/Foundation/NSString/NSString_macOSRoman.m @@ -27,134 +27,134 @@ typedef struct { } CharMapping; static CharMapping mapping_array[] = { - {(const unsigned char) 0x80, (const unichar) 0x00C4}, - {(const unsigned char) 0x81, (const unichar) 0x00C5}, - {(const unsigned char) 0x82, (const unichar) 0x00C7}, - {(const unsigned char) 0x83, (const unichar) 0x00C9}, - {(const unsigned char) 0x84, (const unichar) 0x00D1}, - {(const unsigned char) 0x85, (const unichar) 0x00D6}, - {(const unsigned char) 0x86, (const unichar) 0x00DC}, - {(const unsigned char) 0x87, (const unichar) 0x00E1}, - {(const unsigned char) 0x88, (const unichar) 0x00E0}, - {(const unsigned char) 0x89, (const unichar) 0x00E2}, - {(const unsigned char) 0x8A, (const unichar) 0x00E4}, - {(const unsigned char) 0x8B, (const unichar) 0x00E3}, - {(const unsigned char) 0x8C, (const unichar) 0x00E5}, - {(const unsigned char) 0x8D, (const unichar) 0x00E7}, - {(const unsigned char) 0x8E, (const unichar) 0x00E9}, - {(const unsigned char) 0x8F, (const unichar) 0x00E8}, - {(const unsigned char) 0x90, (const unichar) 0x00EA}, - {(const unsigned char) 0x91, (const unichar) 0x00EB}, - {(const unsigned char) 0x92, (const unichar) 0x00ED}, - {(const unsigned char) 0x93, (const unichar) 0x00EC}, - {(const unsigned char) 0x94, (const unichar) 0x00EE}, - {(const unsigned char) 0x95, (const unichar) 0x00EF}, - {(const unsigned char) 0x96, (const unichar) 0x00F1}, - {(const unsigned char) 0x97, (const unichar) 0x00F3}, - {(const unsigned char) 0x98, (const unichar) 0x00F2}, - {(const unsigned char) 0x99, (const unichar) 0x00F4}, - {(const unsigned char) 0x9A, (const unichar) 0x00F6}, - {(const unsigned char) 0x9B, (const unichar) 0x00F5}, - {(const unsigned char) 0x9C, (const unichar) 0x00FA}, - {(const unsigned char) 0x9D, (const unichar) 0x00F9}, - {(const unsigned char) 0x9E, (const unichar) 0x00FB}, - {(const unsigned char) 0x9F, (const unichar) 0x00FC}, - {(const unsigned char) 0xA0, (const unichar) 0x2020}, - {(const unsigned char) 0xA1, (const unichar) 0x00B0}, - {(const unsigned char) 0xA2, (const unichar) 0x00A2}, - {(const unsigned char) 0xA3, (const unichar) 0x00A3}, - {(const unsigned char) 0xA4, (const unichar) 0x00A7}, - {(const unsigned char) 0xA5, (const unichar) 0x2022}, - {(const unsigned char) 0xA6, (const unichar) 0x00B6}, - {(const unsigned char) 0xA7, (const unichar) 0x00DF}, - {(const unsigned char) 0xA8, (const unichar) 0x00AE}, - {(const unsigned char) 0xA9, (const unichar) 0x00A9}, - {(const unsigned char) 0xAA, (const unichar) 0x2122}, - {(const unsigned char) 0xAB, (const unichar) 0x00B4}, - {(const unsigned char) 0xAC, (const unichar) 0x00A8}, - {(const unsigned char) 0xAD, (const unichar) 0x2260}, - {(const unsigned char) 0xAE, (const unichar) 0x00C6}, - {(const unsigned char) 0xAF, (const unichar) 0x00D8}, - {(const unsigned char) 0xB0, (const unichar) 0x221E}, - {(const unsigned char) 0xB1, (const unichar) 0x00B1}, - {(const unsigned char) 0xB2, (const unichar) 0x2264}, - {(const unsigned char) 0xB3, (const unichar) 0x2265}, - {(const unsigned char) 0xB4, (const unichar) 0x00A5}, - {(const unsigned char) 0xB5, (const unichar) 0x00B5}, - {(const unsigned char) 0xB6, (const unichar) 0x2202}, - {(const unsigned char) 0xB7, (const unichar) 0x2211}, - {(const unsigned char) 0xB8, (const unichar) 0x220F}, - {(const unsigned char) 0xB9, (const unichar) 0x03C0}, - {(const unsigned char) 0xBA, (const unichar) 0x222B}, - {(const unsigned char) 0xBB, (const unichar) 0x00AA}, - {(const unsigned char) 0xBC, (const unichar) 0x00BA}, - {(const unsigned char) 0xBD, (const unichar) 0x03A9}, - {(const unsigned char) 0xBE, (const unichar) 0x00E6}, - {(const unsigned char) 0xBF, (const unichar) 0x00F8}, - {(const unsigned char) 0xC0, (const unichar) 0x00BF}, - {(const unsigned char) 0xC1, (const unichar) 0x00A1}, - {(const unsigned char) 0xC2, (const unichar) 0x00AC}, - {(const unsigned char) 0xC3, (const unichar) 0x221A}, - {(const unsigned char) 0xC4, (const unichar) 0x0192}, - {(const unsigned char) 0xC5, (const unichar) 0x2248}, - {(const unsigned char) 0xC6, (const unichar) 0x2206}, - {(const unsigned char) 0xC7, (const unichar) 0x00AB}, - {(const unsigned char) 0xC8, (const unichar) 0x00BB}, - {(const unsigned char) 0xC9, (const unichar) 0x2026}, - {(const unsigned char) 0xCA, (const unichar) 0x00A0}, - {(const unsigned char) 0xCB, (const unichar) 0x00C0}, - {(const unsigned char) 0xCC, (const unichar) 0x00C3}, - {(const unsigned char) 0xCD, (const unichar) 0x00D5}, - {(const unsigned char) 0xCE, (const unichar) 0x0152}, - {(const unsigned char) 0xCF, (const unichar) 0x0153}, - {(const unsigned char) 0xD0, (const unichar) 0x2013}, - {(const unsigned char) 0xD1, (const unichar) 0x2014}, - {(const unsigned char) 0xD2, (const unichar) 0x201C}, - {(const unsigned char) 0xD3, (const unichar) 0x201D}, - {(const unsigned char) 0xD4, (const unichar) 0x2018}, - {(const unsigned char) 0xD5, (const unichar) 0x2019}, - {(const unsigned char) 0xD6, (const unichar) 0x00F7}, - {(const unsigned char) 0xD7, (const unichar) 0x25CA}, - {(const unsigned char) 0xD8, (const unichar) 0x00FF}, - {(const unsigned char) 0xD9, (const unichar) 0x0178}, - {(const unsigned char) 0xDA, (const unichar) 0x2044}, - {(const unsigned char) 0xDB, (const unichar) 0x20AC}, - {(const unsigned char) 0xDC, (const unichar) 0x2039}, - {(const unsigned char) 0xDD, (const unichar) 0x203A}, - {(const unsigned char) 0xDE, (const unichar) 0xFB01}, - {(const unsigned char) 0xDF, (const unichar) 0xFB02}, - {(const unsigned char) 0xE0, (const unichar) 0x2021}, - {(const unsigned char) 0xE1, (const unichar) 0x00B7}, - {(const unsigned char) 0xE2, (const unichar) 0x201A}, - {(const unsigned char) 0xE3, (const unichar) 0x201E}, - {(const unsigned char) 0xE4, (const unichar) 0x2030}, - {(const unsigned char) 0xE5, (const unichar) 0x00C2}, - {(const unsigned char) 0xE6, (const unichar) 0x00CA}, - {(const unsigned char) 0xE7, (const unichar) 0x00C1}, - {(const unsigned char) 0xE8, (const unichar) 0x00CB}, - {(const unsigned char) 0xE9, (const unichar) 0x00C8}, - {(const unsigned char) 0xEA, (const unichar) 0x00CD}, - {(const unsigned char) 0xEB, (const unichar) 0x00CE}, - {(const unsigned char) 0xEC, (const unichar) 0x00CF}, - {(const unsigned char) 0xED, (const unichar) 0x00CC}, - {(const unsigned char) 0xEE, (const unichar) 0x00D3}, - {(const unsigned char) 0xEF, (const unichar) 0x00D4}, - {(const unsigned char) 0xF0, (const unichar) 0xF8FF}, - {(const unsigned char) 0xF1, (const unichar) 0x00D2}, - {(const unsigned char) 0xF2, (const unichar) 0x00DA}, - {(const unsigned char) 0xF3, (const unichar) 0x00DB}, - {(const unsigned char) 0xF4, (const unichar) 0x00D9}, - {(const unsigned char) 0xF5, (const unichar) 0x0131}, - {(const unsigned char) 0xF6, (const unichar) 0x02C6}, - {(const unsigned char) 0xF7, (const unichar) 0x02DC}, - {(const unsigned char) 0xF8, (const unichar) 0x00AF}, - {(const unsigned char) 0xF9, (const unichar) 0x02D8}, - {(const unsigned char) 0xFA, (const unichar) 0x02D9}, - {(const unsigned char) 0xFB, (const unichar) 0x02DA}, - {(const unsigned char) 0xFC, (const unichar) 0x00B8}, - {(const unsigned char) 0xFD, (const unichar) 0x02DD}, - {(const unsigned char) 0xFE, (const unichar) 0x02DB}, - {(const unsigned char) 0xFF, (const unichar) 0x02C7}}; + {(const unsigned char) 0x80, (const unichar) 0x00C4}, + {(const unsigned char) 0x81, (const unichar) 0x00C5}, + {(const unsigned char) 0x82, (const unichar) 0x00C7}, + {(const unsigned char) 0x83, (const unichar) 0x00C9}, + {(const unsigned char) 0x84, (const unichar) 0x00D1}, + {(const unsigned char) 0x85, (const unichar) 0x00D6}, + {(const unsigned char) 0x86, (const unichar) 0x00DC}, + {(const unsigned char) 0x87, (const unichar) 0x00E1}, + {(const unsigned char) 0x88, (const unichar) 0x00E0}, + {(const unsigned char) 0x89, (const unichar) 0x00E2}, + {(const unsigned char) 0x8A, (const unichar) 0x00E4}, + {(const unsigned char) 0x8B, (const unichar) 0x00E3}, + {(const unsigned char) 0x8C, (const unichar) 0x00E5}, + {(const unsigned char) 0x8D, (const unichar) 0x00E7}, + {(const unsigned char) 0x8E, (const unichar) 0x00E9}, + {(const unsigned char) 0x8F, (const unichar) 0x00E8}, + {(const unsigned char) 0x90, (const unichar) 0x00EA}, + {(const unsigned char) 0x91, (const unichar) 0x00EB}, + {(const unsigned char) 0x92, (const unichar) 0x00ED}, + {(const unsigned char) 0x93, (const unichar) 0x00EC}, + {(const unsigned char) 0x94, (const unichar) 0x00EE}, + {(const unsigned char) 0x95, (const unichar) 0x00EF}, + {(const unsigned char) 0x96, (const unichar) 0x00F1}, + {(const unsigned char) 0x97, (const unichar) 0x00F3}, + {(const unsigned char) 0x98, (const unichar) 0x00F2}, + {(const unsigned char) 0x99, (const unichar) 0x00F4}, + {(const unsigned char) 0x9A, (const unichar) 0x00F6}, + {(const unsigned char) 0x9B, (const unichar) 0x00F5}, + {(const unsigned char) 0x9C, (const unichar) 0x00FA}, + {(const unsigned char) 0x9D, (const unichar) 0x00F9}, + {(const unsigned char) 0x9E, (const unichar) 0x00FB}, + {(const unsigned char) 0x9F, (const unichar) 0x00FC}, + {(const unsigned char) 0xA0, (const unichar) 0x2020}, + {(const unsigned char) 0xA1, (const unichar) 0x00B0}, + {(const unsigned char) 0xA2, (const unichar) 0x00A2}, + {(const unsigned char) 0xA3, (const unichar) 0x00A3}, + {(const unsigned char) 0xA4, (const unichar) 0x00A7}, + {(const unsigned char) 0xA5, (const unichar) 0x2022}, + {(const unsigned char) 0xA6, (const unichar) 0x00B6}, + {(const unsigned char) 0xA7, (const unichar) 0x00DF}, + {(const unsigned char) 0xA8, (const unichar) 0x00AE}, + {(const unsigned char) 0xA9, (const unichar) 0x00A9}, + {(const unsigned char) 0xAA, (const unichar) 0x2122}, + {(const unsigned char) 0xAB, (const unichar) 0x00B4}, + {(const unsigned char) 0xAC, (const unichar) 0x00A8}, + {(const unsigned char) 0xAD, (const unichar) 0x2260}, + {(const unsigned char) 0xAE, (const unichar) 0x00C6}, + {(const unsigned char) 0xAF, (const unichar) 0x00D8}, + {(const unsigned char) 0xB0, (const unichar) 0x221E}, + {(const unsigned char) 0xB1, (const unichar) 0x00B1}, + {(const unsigned char) 0xB2, (const unichar) 0x2264}, + {(const unsigned char) 0xB3, (const unichar) 0x2265}, + {(const unsigned char) 0xB4, (const unichar) 0x00A5}, + {(const unsigned char) 0xB5, (const unichar) 0x00B5}, + {(const unsigned char) 0xB6, (const unichar) 0x2202}, + {(const unsigned char) 0xB7, (const unichar) 0x2211}, + {(const unsigned char) 0xB8, (const unichar) 0x220F}, + {(const unsigned char) 0xB9, (const unichar) 0x03C0}, + {(const unsigned char) 0xBA, (const unichar) 0x222B}, + {(const unsigned char) 0xBB, (const unichar) 0x00AA}, + {(const unsigned char) 0xBC, (const unichar) 0x00BA}, + {(const unsigned char) 0xBD, (const unichar) 0x03A9}, + {(const unsigned char) 0xBE, (const unichar) 0x00E6}, + {(const unsigned char) 0xBF, (const unichar) 0x00F8}, + {(const unsigned char) 0xC0, (const unichar) 0x00BF}, + {(const unsigned char) 0xC1, (const unichar) 0x00A1}, + {(const unsigned char) 0xC2, (const unichar) 0x00AC}, + {(const unsigned char) 0xC3, (const unichar) 0x221A}, + {(const unsigned char) 0xC4, (const unichar) 0x0192}, + {(const unsigned char) 0xC5, (const unichar) 0x2248}, + {(const unsigned char) 0xC6, (const unichar) 0x2206}, + {(const unsigned char) 0xC7, (const unichar) 0x00AB}, + {(const unsigned char) 0xC8, (const unichar) 0x00BB}, + {(const unsigned char) 0xC9, (const unichar) 0x2026}, + {(const unsigned char) 0xCA, (const unichar) 0x00A0}, + {(const unsigned char) 0xCB, (const unichar) 0x00C0}, + {(const unsigned char) 0xCC, (const unichar) 0x00C3}, + {(const unsigned char) 0xCD, (const unichar) 0x00D5}, + {(const unsigned char) 0xCE, (const unichar) 0x0152}, + {(const unsigned char) 0xCF, (const unichar) 0x0153}, + {(const unsigned char) 0xD0, (const unichar) 0x2013}, + {(const unsigned char) 0xD1, (const unichar) 0x2014}, + {(const unsigned char) 0xD2, (const unichar) 0x201C}, + {(const unsigned char) 0xD3, (const unichar) 0x201D}, + {(const unsigned char) 0xD4, (const unichar) 0x2018}, + {(const unsigned char) 0xD5, (const unichar) 0x2019}, + {(const unsigned char) 0xD6, (const unichar) 0x00F7}, + {(const unsigned char) 0xD7, (const unichar) 0x25CA}, + {(const unsigned char) 0xD8, (const unichar) 0x00FF}, + {(const unsigned char) 0xD9, (const unichar) 0x0178}, + {(const unsigned char) 0xDA, (const unichar) 0x2044}, + {(const unsigned char) 0xDB, (const unichar) 0x20AC}, + {(const unsigned char) 0xDC, (const unichar) 0x2039}, + {(const unsigned char) 0xDD, (const unichar) 0x203A}, + {(const unsigned char) 0xDE, (const unichar) 0xFB01}, + {(const unsigned char) 0xDF, (const unichar) 0xFB02}, + {(const unsigned char) 0xE0, (const unichar) 0x2021}, + {(const unsigned char) 0xE1, (const unichar) 0x00B7}, + {(const unsigned char) 0xE2, (const unichar) 0x201A}, + {(const unsigned char) 0xE3, (const unichar) 0x201E}, + {(const unsigned char) 0xE4, (const unichar) 0x2030}, + {(const unsigned char) 0xE5, (const unichar) 0x00C2}, + {(const unsigned char) 0xE6, (const unichar) 0x00CA}, + {(const unsigned char) 0xE7, (const unichar) 0x00C1}, + {(const unsigned char) 0xE8, (const unichar) 0x00CB}, + {(const unsigned char) 0xE9, (const unichar) 0x00C8}, + {(const unsigned char) 0xEA, (const unichar) 0x00CD}, + {(const unsigned char) 0xEB, (const unichar) 0x00CE}, + {(const unsigned char) 0xEC, (const unichar) 0x00CF}, + {(const unsigned char) 0xED, (const unichar) 0x00CC}, + {(const unsigned char) 0xEE, (const unichar) 0x00D3}, + {(const unsigned char) 0xEF, (const unichar) 0x00D4}, + {(const unsigned char) 0xF0, (const unichar) 0xF8FF}, + {(const unsigned char) 0xF1, (const unichar) 0x00D2}, + {(const unsigned char) 0xF2, (const unichar) 0x00DA}, + {(const unsigned char) 0xF3, (const unichar) 0x00DB}, + {(const unsigned char) 0xF4, (const unichar) 0x00D9}, + {(const unsigned char) 0xF5, (const unichar) 0x0131}, + {(const unsigned char) 0xF6, (const unichar) 0x02C6}, + {(const unsigned char) 0xF7, (const unichar) 0x02DC}, + {(const unsigned char) 0xF8, (const unichar) 0x00AF}, + {(const unsigned char) 0xF9, (const unichar) 0x02D8}, + {(const unsigned char) 0xFA, (const unichar) 0x02D9}, + {(const unsigned char) 0xFB, (const unichar) 0x02DA}, + {(const unsigned char) 0xFC, (const unichar) 0x00B8}, + {(const unsigned char) 0xFD, (const unichar) 0x02DD}, + {(const unsigned char) 0xFE, (const unichar) 0x02DB}, + {(const unsigned char) 0xFF, (const unichar) 0x02C7}}; const unichar _mapMacOSRomanToUnichar(const unsigned char c) { if (c >= 0x80) { @@ -182,7 +182,7 @@ char *NSUnicodeToMacOSRoman(const unichar *characters, NSUInteger length, BOOL zeroTerminate) { char *macOSRoman = NSZoneMalloc( - zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); + zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); int i; for (i = 0; i < length; i++) { diff --git a/Foundation/NSString/NSString_nextstep.m b/Foundation/NSString/NSString_nextstep.m index a1ae4fef..4427ec4b 100644 --- a/Foundation/NSString/NSString_nextstep.m +++ b/Foundation/NSString/NSString_nextstep.m @@ -23,37 +23,37 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import static const unichar NEXTSTEPToUnicode[256] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, - 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, - 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, - 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, - 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, - 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, - 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, - 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, - 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, - 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, - 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, - 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, - 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, - 0x007e, 0x007f, + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, + 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, + 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, + 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, + 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, + 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, + 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, + 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, + 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, + 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, + 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, + 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, + 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, + 0x007e, 0x007f, - 0x00a0, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c7, 0x00c8, - 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, - 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d9, 0x00da, 0x00db, 0x00dc, - 0x00dd, 0x00de, 0x00b5, 0x00d7, 0x00f7, 0x00a9, 0x00a1, 0x00a2, 0x00a3, - 0x2044, 0x00a5, 0x0192, 0x00a7, 0x00a4, 0x2019, 0x201c, 0x00ab, 0x2039, - 0x203a, 0xfb01, 0xfb02, 0x00ae, 0x2013, 0x2020, 0x2021, 0x00b7, 0x00a6, - 0x00b6, 0x2022, 0x201a, 0x201e, 0x201d, 0x00bb, 0x2026, 0x2030, 0x00ac, - 0x00bf, 0x00b9, 0x02cb, 0x00b4, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9, - 0x00a8, 0x00b2, 0x02da, 0x00b8, 0x00b3, 0x02dd, 0x02db, 0x02c7, 0x2014, - 0x00b1, 0x00bc, 0x00bd, 0x00be, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, - 0x00e5, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00c6, 0x00ed, - 0x00aa, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x0141, 0x00d8, 0x0152, 0x00ba, - 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00e6, 0x00f9, 0x00fa, 0x00fb, - 0x0131, 0x00fc, 0x00fd, 0x0142, 0x00f8, 0x0153, 0x00df, 0x00fe, 0x00ff, - 0xfffd, 0xfffd}; + 0x00a0, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c7, 0x00c8, + 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, + 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d9, 0x00da, 0x00db, 0x00dc, + 0x00dd, 0x00de, 0x00b5, 0x00d7, 0x00f7, 0x00a9, 0x00a1, 0x00a2, 0x00a3, + 0x2044, 0x00a5, 0x0192, 0x00a7, 0x00a4, 0x2019, 0x201c, 0x00ab, 0x2039, + 0x203a, 0xfb01, 0xfb02, 0x00ae, 0x2013, 0x2020, 0x2021, 0x00b7, 0x00a6, + 0x00b6, 0x2022, 0x201a, 0x201e, 0x201d, 0x00bb, 0x2026, 0x2030, 0x00ac, + 0x00bf, 0x00b9, 0x02cb, 0x00b4, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9, + 0x00a8, 0x00b2, 0x02da, 0x00b8, 0x00b3, 0x02dd, 0x02db, 0x02c7, 0x2014, + 0x00b1, 0x00bc, 0x00bd, 0x00be, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, + 0x00e5, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00c6, 0x00ed, + 0x00aa, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x0141, 0x00d8, 0x0152, 0x00ba, + 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00e6, 0x00f9, 0x00fa, 0x00fb, + 0x0131, 0x00fc, 0x00fd, 0x0142, 0x00f8, 0x0153, 0x00df, 0x00fe, 0x00ff, + 0xfffd, 0xfffd}; unichar *NSNEXTSTEPToUnicode(const char *cString, NSUInteger length, NSUInteger *resultLength, NSZone *zone) @@ -73,7 +73,7 @@ char *NSUnicodeToNEXTSTEP(const unichar *characters, NSUInteger length, BOOL zeroTerminate) { char *nextstep = NSZoneMalloc( - zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); + zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); int i, j; for (i = 0; i < length; i++) { diff --git a/Foundation/NSString/NSString_nextstepCString.m b/Foundation/NSString/NSString_nextstepCString.m index 000ff269..212def52 100644 --- a/Foundation/NSString/NSString_nextstepCString.m +++ b/Foundation/NSString/NSString_nextstepCString.m @@ -37,9 +37,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) getCString: (char *) buffer - maxLength: (NSUInteger) maxLength - range: (NSRange) range - remainingRange: (NSRange *) leftoverRange + maxLength: (NSUInteger) maxLength + range: (NSRange) range + remainingRange: (NSRange *) leftoverRange { NSInteger i, rloc; @@ -64,8 +64,8 @@ NSString *NSNEXTSTEPCStringNewWithBytes(NSZone *zone, const char *bytes, NSUInteger length) { NSString_nextstepCString *self = - NSAllocateObject(objc_lookUpClass("NSString_nextstepCString"), - length * sizeof(char), zone); + NSAllocateObject(objc_lookUpClass("NSString_nextstepCString"), + length * sizeof(char), zone); if (self) { self->_length = length; @@ -85,8 +85,8 @@ NSString *NSNEXTSTEPCStringNewWithCharacters(NSZone *zone, NSUInteger bytesLength; char *bytes; - bytes = - NSUnicodeToNEXTSTEP(characters, length, lossy, &bytesLength, zone, NO); + bytes = NSUnicodeToNEXTSTEP(characters, length, lossy, &bytesLength, zone, + NO); if (bytes == NULL) string = nil; @@ -102,8 +102,8 @@ NSString *NSNEXTSTEPCStringNewWithCapacity(NSZone *zone, NSUInteger capacity, char **ptr) { NSString_nextstepCString *self = - NSAllocateObject(objc_lookUpClass("NSString_nextstepCString"), - capacity * sizeof(char), zone); + NSAllocateObject(objc_lookUpClass("NSString_nextstepCString"), + capacity * sizeof(char), zone); if (self) { self->_length = capacity; diff --git a/Foundation/NSString/NSString_placeholder.h b/Foundation/NSString/NSString_placeholder.h index ca1dffae..8dbf8ac7 100644 --- a/Foundation/NSString/NSString_placeholder.h +++ b/Foundation/NSString/NSString_placeholder.h @@ -23,13 +23,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // For maximum compatibility with Mac OS X, this is the minimum set: - initWithBytes: (const void *) bytes - length: (NSUInteger) length - encoding: (NSStringEncoding) encoding; + length: (NSUInteger) length + encoding: (NSStringEncoding) encoding; - initWithCharactersNoCopy: (unichar *) characters length: (NSUInteger) length freeWhenDone: (BOOL) freeWhenDone; - initWithFormat: (NSString *) format - locale: (NSDictionary *) locale - arguments: (va_list) arguments; + locale: (NSDictionary *) locale + arguments: (va_list) arguments; @end diff --git a/Foundation/NSString/NSString_placeholder.m b/Foundation/NSString/NSString_placeholder.m index 569dc2e9..2b8ae635 100644 --- a/Foundation/NSString/NSString_placeholder.m +++ b/Foundation/NSString/NSString_placeholder.m @@ -55,20 +55,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ { NSDeallocateObject(self); return (NSString_placeholder *) NSString_unicodePtrNewNoCopy( - NULL, characters, length, freeWhenDone); + NULL, characters, length, freeWhenDone); } // Copied from former -initWithData:(NSData *)data // encoding:(NSStringEncoding)encoding; - initWithBytes: (const void *) bytes - length: (NSUInteger) length - encoding: (NSStringEncoding) encoding + length: (NSUInteger) length + encoding: (NSStringEncoding) encoding { NSDeallocateObject(self); if (encoding == defaultEncoding()) { return (NSString_placeholder *) NSString_cStringNewWithBytes( - NULL, bytes, length); + NULL, bytes, length); } switch (encoding) { @@ -78,59 +78,59 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ case NSUnicodeStringEncoding: characters = NSUnicodeFromBytes(bytes, length, &resultLength); return (NSString_placeholder *) NSString_unicodePtrNewNoCopy( - NULL, characters, resultLength, YES); + NULL, characters, resultLength, YES); case NSNEXTSTEPStringEncoding: return (NSString_placeholder *) NSNEXTSTEPStringNewWithBytes( - NULL, bytes, length); + NULL, bytes, length); // FIX, not nextstep case NSASCIIStringEncoding: case NSNonLossyASCIIStringEncoding: return (NSString_placeholder *) NSNEXTSTEPStringNewWithBytes( - NULL, bytes, length); + NULL, bytes, length); case NSISOLatin1StringEncoding: return (NSString_placeholder *) NSString_isoLatin1NewWithBytes( - NULL, bytes, length); + NULL, bytes, length); case NSSymbolStringEncoding: characters = NSSymbolToUnicode(bytes, length, &resultLength, NULL); return (NSString_placeholder *) NSString_unicodePtrNewNoCopy( - NULL, characters, resultLength, YES); + NULL, characters, resultLength, YES); case NSUTF8StringEncoding: characters = NSUTF8ToUnicode(bytes, length, &resultLength, NULL); return (NSString_placeholder *) NSString_unicodePtrNewNoCopy( - NULL, characters, resultLength, YES); + NULL, characters, resultLength, YES); case NSWindowsCP1252StringEncoding: return (NSString_placeholder *) NSString_win1252NewWithBytes( - NULL, bytes, length); + NULL, bytes, length); case NSMacOSRomanStringEncoding: return (NSString_placeholder *) NSString_macOSRomanNewWithBytes( - NULL, bytes, length); + NULL, bytes, length); case NSUTF16LittleEndianStringEncoding: - characters = - NSUnicodeFromBytesUTF16LittleEndian(bytes, length, &resultLength); + characters = NSUnicodeFromBytesUTF16LittleEndian(bytes, length, + &resultLength); return (NSString_placeholder *) NSString_unicodePtrNewNoCopy( - NULL, characters, resultLength, YES); + NULL, characters, resultLength, YES); case NSUTF16BigEndianStringEncoding: characters = - NSUnicodeFromBytesUTF16BigEndian(bytes, length, &resultLength); + NSUnicodeFromBytesUTF16BigEndian(bytes, length, &resultLength); return (NSString_placeholder *) NSString_unicodePtrNewNoCopy( - NULL, characters, resultLength, YES); + NULL, characters, resultLength, YES); default: { // Let's convert the encoding to unicode and use that unichar *unicodePtr = - NSBytesToUnicode(bytes, length, encoding, &resultLength, NULL); + NSBytesToUnicode(bytes, length, encoding, &resultLength, NULL); if (unicodePtr) { return (NSString_placeholder *) NSString_unicodePtrNewNoCopy( - NULL, unicodePtr, resultLength, YES); + NULL, unicodePtr, resultLength, YES); } } break; } @@ -141,8 +141,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithFormat: (NSString *) format - locale: (NSDictionary *) locale - arguments: (va_list) arguments + locale: (NSDictionary *) locale + arguments: (va_list) arguments { NSDeallocateObject(self); diff --git a/Foundation/NSString/NSString_unicode.m b/Foundation/NSString/NSString_unicode.m index 0945a972..ada729a2 100644 --- a/Foundation/NSString/NSString_unicode.m +++ b/Foundation/NSString/NSString_unicode.m @@ -61,7 +61,7 @@ char *NSUnicodeToUnicode(const unichar *characters, NSUInteger length, BOOL zeroTerminate) { unichar *unicode = NSZoneMalloc( - zone, sizeof(unichar) * (length + (zeroTerminate ? 1 : 0))); + zone, sizeof(unichar) * (length + (zeroTerminate ? 1 : 0))); memcpy(unicode, characters, length * sizeof(unichar)); diff --git a/Foundation/NSString/NSString_unicodePtr.m b/Foundation/NSString/NSString_unicodePtr.m index 94cfa599..cafe2149 100644 --- a/Foundation/NSString/NSString_unicodePtr.m +++ b/Foundation/NSString/NSString_unicodePtr.m @@ -28,7 +28,7 @@ NSString *NSString_unicodePtrNewNoCopy(NSZone *zone, const unichar *unicode, NSUInteger length, BOOL freeWhenDone) { NSString_unicodePtr *self = - NSAllocateObject([NSString_unicodePtr class], 0, zone); + NSAllocateObject([NSString_unicodePtr class], 0, zone); if (self) { self->_length = length; diff --git a/Foundation/NSString/NSString_win1252.m b/Foundation/NSString/NSString_win1252.m index d0c28b61..0b103c22 100644 --- a/Foundation/NSString/NSString_win1252.m +++ b/Foundation/NSString/NSString_win1252.m @@ -29,38 +29,38 @@ typedef struct { } CharMapping; static CharMapping mapping_array[] = { - {(const unsigned char) 0x80, (const unichar) 0x20AC}, - {(const unsigned char) 0x81, (const unichar) UNDEFINED_UNICODE}, - {(const unsigned char) 0x82, (const unichar) 0x201A}, - {(const unsigned char) 0x83, (const unichar) 0x0192}, - {(const unsigned char) 0x84, (const unichar) 0x201E}, - {(const unsigned char) 0x85, (const unichar) 0x2026}, - {(const unsigned char) 0x86, (const unichar) 0x2020}, - {(const unsigned char) 0x87, (const unichar) 0x2021}, - {(const unsigned char) 0x88, (const unichar) 0x02C6}, - {(const unsigned char) 0x89, (const unichar) 0x2030}, - {(const unsigned char) 0x8A, (const unichar) 0x0160}, - {(const unsigned char) 0x8B, (const unichar) 0x2039}, - {(const unsigned char) 0x8C, (const unichar) 0x0152}, - {(const unsigned char) 0x8D, (const unichar) UNDEFINED_UNICODE}, - {(const unsigned char) 0x8E, (const unichar) 0x017D}, - {(const unsigned char) 0x8F, (const unichar) UNDEFINED_UNICODE}, - {(const unsigned char) 0x90, (const unichar) UNDEFINED_UNICODE}, - {(const unsigned char) 0x91, (const unichar) 0x2018}, - {(const unsigned char) 0x92, (const unichar) 0x2019}, - {(const unsigned char) 0x93, (const unichar) 0x201C}, - {(const unsigned char) 0x94, (const unichar) 0x201D}, - {(const unsigned char) 0x95, (const unichar) 0x2022}, - {(const unsigned char) 0x96, (const unichar) 0x2013}, - {(const unsigned char) 0x97, (const unichar) 0x2014}, - {(const unsigned char) 0x98, (const unichar) 0x02DC}, - {(const unsigned char) 0x99, (const unichar) 0x2122}, - {(const unsigned char) 0x9A, (const unichar) 0x0161}, - {(const unsigned char) 0x9B, (const unichar) 0x203A}, - {(const unsigned char) 0x9C, (const unichar) 0x0153}, - {(const unsigned char) 0x9D, (const unichar) UNDEFINED_UNICODE}, - {(const unsigned char) 0x9E, (const unichar) 0x017E}, - {(const unsigned char) 0x9F, (const unichar) 0x0178}}; + {(const unsigned char) 0x80, (const unichar) 0x20AC}, + {(const unsigned char) 0x81, (const unichar) UNDEFINED_UNICODE}, + {(const unsigned char) 0x82, (const unichar) 0x201A}, + {(const unsigned char) 0x83, (const unichar) 0x0192}, + {(const unsigned char) 0x84, (const unichar) 0x201E}, + {(const unsigned char) 0x85, (const unichar) 0x2026}, + {(const unsigned char) 0x86, (const unichar) 0x2020}, + {(const unsigned char) 0x87, (const unichar) 0x2021}, + {(const unsigned char) 0x88, (const unichar) 0x02C6}, + {(const unsigned char) 0x89, (const unichar) 0x2030}, + {(const unsigned char) 0x8A, (const unichar) 0x0160}, + {(const unsigned char) 0x8B, (const unichar) 0x2039}, + {(const unsigned char) 0x8C, (const unichar) 0x0152}, + {(const unsigned char) 0x8D, (const unichar) UNDEFINED_UNICODE}, + {(const unsigned char) 0x8E, (const unichar) 0x017D}, + {(const unsigned char) 0x8F, (const unichar) UNDEFINED_UNICODE}, + {(const unsigned char) 0x90, (const unichar) UNDEFINED_UNICODE}, + {(const unsigned char) 0x91, (const unichar) 0x2018}, + {(const unsigned char) 0x92, (const unichar) 0x2019}, + {(const unsigned char) 0x93, (const unichar) 0x201C}, + {(const unsigned char) 0x94, (const unichar) 0x201D}, + {(const unsigned char) 0x95, (const unichar) 0x2022}, + {(const unsigned char) 0x96, (const unichar) 0x2013}, + {(const unsigned char) 0x97, (const unichar) 0x2014}, + {(const unsigned char) 0x98, (const unichar) 0x02DC}, + {(const unsigned char) 0x99, (const unichar) 0x2122}, + {(const unsigned char) 0x9A, (const unichar) 0x0161}, + {(const unsigned char) 0x9B, (const unichar) 0x203A}, + {(const unsigned char) 0x9C, (const unichar) 0x0153}, + {(const unsigned char) 0x9D, (const unichar) UNDEFINED_UNICODE}, + {(const unsigned char) 0x9E, (const unichar) 0x017E}, + {(const unsigned char) 0x9F, (const unichar) 0x0178}}; const unichar _mapWin1252ToUnichar(const unsigned char c) { if (c >= 0x80 && c <= 0x9F) { @@ -88,7 +88,7 @@ char *NSUnicodeToWin1252(const unichar *characters, NSUInteger length, BOOL zeroTerminate) { char *win1252 = NSZoneMalloc( - zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); + zone, sizeof(char) * (length + (zeroTerminate == YES ? 1 : 0))); int i; for (i = 0; i < length; i++) { @@ -136,8 +136,8 @@ NSString *NSWin1252CStringNewWithCharacters(NSZone *zone, NSUInteger bytesLength; char *bytes; - bytes = - NSUnicodeToWin1252(characters, length, lossy, &bytesLength, zone, NO); + bytes = NSUnicodeToWin1252(characters, length, lossy, &bytesLength, zone, + NO); if (bytes == NULL) string = nil; @@ -194,8 +194,8 @@ NSUInteger NSGetWin1252CStringWithMaxLength(const unichar *characters, NSString *NSString_win1252NewWithBytes(NSZone *zone, const char *bytes, NSUInteger length) { - NSString_win1252 *self = - NSAllocateObject([NSString_win1252 class], length * sizeof(char), zone); + NSString_win1252 *self = NSAllocateObject([NSString_win1252 class], + length * sizeof(char), zone); if (self) { self->_length = length; diff --git a/Foundation/NSString/NSUnicodeCaseMapping.m b/Foundation/NSString/NSUnicodeCaseMapping.m index 92060156..2e10e361 100644 --- a/Foundation/NSString/NSUnicodeCaseMapping.m +++ b/Foundation/NSString/NSUnicodeCaseMapping.m @@ -817,8 +817,8 @@ unichar *NSUnicodeFromBytesUTF16BigEndian(const unsigned char *bytes, result[resultIndex++] = (high << 8) | low; } - *resultLengthp = - resultLength - ((skippedMarker) ? 2 : 0); // we skipped the marker word + *resultLengthp = resultLength - + ((skippedMarker) ? 2 : 0); // we skipped the marker word return result; } @@ -851,8 +851,8 @@ unichar *NSUnicodeFromBytesUTF16LittleEndian(const unsigned char *bytes, result[resultIndex++] = (high << 8) | low; } - *resultLengthp = - resultLength - ((skippedMarker) ? 2 : 0); // we skipped the marker word + *resultLengthp = resultLength - + ((skippedMarker) ? 2 : 0); // we skipped the marker word return result; } diff --git a/Foundation/NSString/unibuffer.h b/Foundation/NSString/unibuffer.h index 81f4c001..34cfefae 100644 --- a/Foundation/NSString/unibuffer.h +++ b/Foundation/NSString/unibuffer.h @@ -26,8 +26,8 @@ static inline unibuffer NewUnibufferWithString(NSString *string) { unibuffer result; result.length = [string length]; - result.characters = - NSZoneMalloc(NSDefaultMallocZone(), sizeof(unichar) * result.length); + result.characters = NSZoneMalloc(NSDefaultMallocZone(), + sizeof(unichar) * result.length); [string getCharacters: result.characters]; diff --git a/Foundation/NSStringsFileFormat/NSStringsFileParser.m b/Foundation/NSStringsFileFormat/NSStringsFileParser.m index f7f2eb9f..b4ba1018 100644 --- a/Foundation/NSStringsFileFormat/NSStringsFileParser.m +++ b/Foundation/NSStringsFileFormat/NSStringsFileParser.m @@ -51,11 +51,11 @@ static NSArray *error(NSArray *array, unichar *buffer, NSString *fmt, ...) { static NSArray *stringListFromBytes(const unichar unicode[], NSInteger length) { NSMutableArray *array = - [[NSMutableArray allocWithZone: NULL] initWithCapacity: 1024]; + [[NSMutableArray allocWithZone: NULL] initWithCapacity: 1024]; NSInteger index; NSUInteger bufferCount = 0, bufferCapacity = 2048; - unichar *buffer = - NSZoneMalloc(NSDefaultMallocZone(), bufferCapacity * sizeof(unichar)); + unichar *buffer = NSZoneMalloc(NSDefaultMallocZone(), + bufferCapacity * sizeof(unichar)); enum { STATE_WHITESPACE, @@ -205,8 +205,8 @@ static NSArray *stringListFromBytes(const unichar unicode[], NSInteger length) { if (code == '\"') { // We've found a key or value NSString *string = [[NSString allocWithZone: NULL] - initWithCharacters: buffer - length: bufferCount]; + initWithCharacters: buffer + length: bufferCount]; // So save it off [array addObject: string]; @@ -336,7 +336,7 @@ static NSArray *stringListFromBytes(const unichar unicode[], NSInteger length) { NSDictionary *NSDictionaryFromStringsFormatData(NSData *data) { NSArray *array = - stringListFromBytes((unichar *) [data bytes], [data length]); + stringListFromBytes((unichar *) [data bytes], [data length]); NSDictionary *dictionary; id *keys, *values; NSInteger i, count; @@ -357,7 +357,7 @@ NSDictionary *NSDictionaryFromStringsFormatData(NSData *data) { dictionary = [[[NSDictionary allocWithZone: NULL] initWithObjects: values forKeys: keys count: count] - autorelease]; + autorelease]; [array release]; @@ -374,7 +374,7 @@ NSDictionary *NSDictionaryFromStringsFormatFile(NSString *path) { NSDictionary *dictionary; if ((data = [[NSData allocWithZone: NULL] - initWithContentsOfMappedFile: path]) == nil) + initWithContentsOfMappedFile: path]) == nil) return nil; dictionary = NSDictionaryFromStringsFormatData(data); diff --git a/Foundation/NSTask.m b/Foundation/NSTask.m index 7059b2c4..87c4211b 100644 --- a/Foundation/NSTask.m +++ b/Foundation/NSTask.m @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSTaskDidTerminateNotification = - @"NSTaskDidTerminateNotification"; + @"NSTaskDidTerminateNotification"; @implementation NSTask @@ -53,7 +53,7 @@ NSString *const NSTaskDidTerminateNotification = launchPath = nil; arguments = nil; currentDirectoryPath = - [[[NSFileManager defaultManager] currentDirectoryPath] copy]; + [[[NSFileManager defaultManager] currentDirectoryPath] copy]; standardInput = nil; standardOutput = nil; standardError = nil; @@ -170,8 +170,8 @@ NSString *const NSTaskDidTerminateNotification = - (void) waitUntilExit { while ([self isRunning]) { [[NSRunLoop currentRunLoop] - runMode: NSDefaultRunLoopMode - beforeDate: [NSDate dateWithTimeIntervalSinceNow: 0.25]]; + runMode: NSDefaultRunLoopMode + beforeDate: [NSDate dateWithTimeIntervalSinceNow: 0.25]]; } } diff --git a/Foundation/NSTextCheckingResult.h b/Foundation/NSTextCheckingResult.h index 5148309d..1b22c471 100644 --- a/Foundation/NSTextCheckingResult.h +++ b/Foundation/NSTextCheckingResult.h @@ -32,7 +32,7 @@ enum { NSTextCheckingAllSystemTypes = 0xffffffffULL, NSTextCheckingAllCustomTypes = 0xffffffffULL << 32, NSTextCheckingAllTypes = - (NSTextCheckingAllSystemTypes | NSTextCheckingAllCustomTypes), + (NSTextCheckingAllSystemTypes | NSTextCheckingAllCustomTypes), }; typedef uint64_t NSTextCheckingTypes; @@ -43,34 +43,34 @@ typedef uint64_t NSTextCheckingTypes; } + (NSTextCheckingResult *) addressCheckingResultWithRange: (NSRange) range - components: - (NSDictionary *) components; + components: (NSDictionary *) + components; + (NSTextCheckingResult *) correctionCheckingResultWithRange: (NSRange) range replacementString: - (NSString *) replacement; + (NSString *) replacement; + (NSTextCheckingResult *) dashCheckingResultWithRange: (NSRange) range replacementString: - (NSString *) replacement; + (NSString *) replacement; + (NSTextCheckingResult *) dateCheckingResultWithRange: (NSRange) range date: (NSDate *) date; + (NSTextCheckingResult *) dateCheckingResultWithRange: (NSRange) range date: (NSDate *) date timeZone: (NSTimeZone *) timeZone duration: - (NSTimeInterval) duration; + (NSTimeInterval) duration; + (NSTextCheckingResult *) grammarCheckingResultWithRange: (NSRange) range details: (NSArray *) details; + (NSTextCheckingResult *) linkCheckingResultWithRange: (NSRange) range URL: (NSURL *) url; -+ (NSTextCheckingResult *) orthographyCheckingResultWithRange: (NSRange) range - orthography: (NSOrthography *) - orthography; ++ (NSTextCheckingResult *) + orthographyCheckingResultWithRange: (NSRange) range + orthography: (NSOrthography *) orthography; + (NSTextCheckingResult *) quoteCheckingResultWithRange: (NSRange) range replacementString: - (NSString *) replacement; + (NSString *) replacement; + (NSTextCheckingResult *) replacementCheckingResultWithRange: (NSRange) range replacementString: - (NSString *) replacement; + (NSString *) replacement; + (NSTextCheckingResult *) spellCheckingResultWithRange: (NSRange) range; @property(readonly) NSDictionary *addressComponents; diff --git a/Foundation/NSTextCheckingResult.m b/Foundation/NSTextCheckingResult.m index 582ac408..ae33b4a5 100644 --- a/Foundation/NSTextCheckingResult.m +++ b/Foundation/NSTextCheckingResult.m @@ -33,8 +33,8 @@ } + (NSTextCheckingResult *) addressCheckingResultWithRange: (NSRange) range - components: - (NSDictionary *) components + components: (NSDictionary *) + components { NSUnimplementedMethod(); return nil; @@ -42,7 +42,7 @@ + (NSTextCheckingResult *) correctionCheckingResultWithRange: (NSRange) range replacementString: - (NSString *) replacement + (NSString *) replacement { NSUnimplementedMethod(); return nil; @@ -66,7 +66,7 @@ date: (NSDate *) date timeZone: (NSTimeZone *) timeZone duration: - (NSTimeInterval) duration + (NSTimeInterval) duration { NSUnimplementedMethod(); return nil; @@ -86,9 +86,9 @@ return nil; } -+ (NSTextCheckingResult *) orthographyCheckingResultWithRange: (NSRange) range - orthography: (NSOrthography *) - orthography ++ (NSTextCheckingResult *) + orthographyCheckingResultWithRange: (NSRange) range + orthography: (NSOrthography *) orthography { NSUnimplementedMethod(); return nil; @@ -96,7 +96,7 @@ + (NSTextCheckingResult *) quoteCheckingResultWithRange: (NSRange) range replacementString: - (NSString *) replacement + (NSString *) replacement { NSUnimplementedMethod(); return nil; @@ -104,7 +104,7 @@ + (NSTextCheckingResult *) replacementCheckingResultWithRange: (NSRange) range replacementString: - (NSString *) replacement + (NSString *) replacement { NSUnimplementedMethod(); return nil; diff --git a/Foundation/NSThread/NSThread.m b/Foundation/NSThread/NSThread.m index 4a70041e..41fdeeab 100644 --- a/Foundation/NSThread/NSThread.m +++ b/Foundation/NSThread/NSThread.m @@ -41,9 +41,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #endif NSString *const NSDidBecomeSingleThreadedNotification = - @"NSDidBecomeSingleThreadedNotification"; + @"NSDidBecomeSingleThreadedNotification"; NSString *const NSWillBecomeMultiThreadedNotification = - @"NSWillBecomeMultiThreadedNotification"; + @"NSWillBecomeMultiThreadedNotification"; NSString *const NSThreadWillExitNotification = @"NSThreadWillExitNotification"; @implementation NSThread @@ -91,7 +91,7 @@ static NSThread *mainThread = nil; // Be sure the stack is aligned in case the thread wants to do exotic things // like SSE2 static __attribute__(( - force_align_arg_pointer)) unsigned __stdcall nsThreadStartThread(void *t) + force_align_arg_pointer)) unsigned __stdcall nsThreadStartThread(void *t) #else static void *nsThreadStartThread(void *t) #endif @@ -155,9 +155,9 @@ static void *nsThreadStartThread(void *t) char **symbols = backtrace_symbols(callstack, frameCount); // ignore current frame for (i = 1; i < frameCount; ++i) { - [ret - addObject: [NSString stringWithCString: callstack[i] - encoding: NSISOLatin1StringEncoding]]; + [ret addObject: [NSString + stringWithCString: callstack[i] + encoding: NSISOLatin1StringEncoding]]; } free(symbols); @@ -215,9 +215,9 @@ static void *nsThreadStartThread(void *t) - (void) dealloc { if ([self isExecuting]) - [NSException - raise: NSInternalInconsistencyException - format: @"trying to dealloc thread %@ while it's running", self]; + [NSException raise: NSInternalInconsistencyException + format: @"trying to dealloc thread %@ while it's running", + self]; [_dictionary release]; _dictionary = nil; @@ -241,9 +241,9 @@ static void *nsThreadStartThread(void *t) if (!isMultiThreaded) { [[NSNotificationCenter defaultCenter] - postNotificationName: NSWillBecomeMultiThreadedNotification - object: nil - userInfo: nil]; + postNotificationName: NSWillBecomeMultiThreadedNotification + object: nil + userInfo: nil]; isMultiThreaded = YES; // lazily initialize mainThread's lock mainThread->_sharedObjectLock = [NSLock new]; @@ -260,8 +260,8 @@ static void *nsThreadStartThread(void *t) // No thread has been created. Don't leak: [self release]; [NSException - raise: @"NSThreadCreationFailedException" - format: @"Creation of Objective-C thread failed [%@].", error]; + raise: @"NSThreadCreationFailedException" + format: @"Creation of Objective-C thread failed [%@].", error]; } } @@ -367,8 +367,9 @@ FOUNDATION_EXPORT id NSThreadSharedInstanceDoNotCreate(NSString *className) { - (NSString *) description { return [NSString - stringWithFormat: @"<%@[0x%lx] threadDictionary: %@ currentPool: %@>", - [self class], self, _dictionary, _currentPool]; + stringWithFormat: + @"<%@[0x%lx] threadDictionary: %@ currentPool: %@>", + [self class], self, _dictionary, _currentPool]; } NSAutoreleasePool *NSThreadCurrentPool(void) { @@ -386,7 +387,7 @@ void NSThreadSetCurrentPool(NSAutoreleasePool *pool) { - (void) _performSelectorOnThreadHelper: (NSArray *) selectorAndArguments { NSConditionLock *waitingLock = [selectorAndArguments objectAtIndex: 0]; SEL selector = - NSSelectorFromString([selectorAndArguments objectAtIndex: 1]); + NSSelectorFromString([selectorAndArguments objectAtIndex: 1]); id object = [[selectorAndArguments objectAtIndex: 2] pointerValue]; [waitingLock lockWhenCondition: 0]; @@ -418,20 +419,21 @@ void NSThreadSetCurrentPool(NSAutoreleasePool *pool) { format: @"thread %@ has no runloop in %@", thread, NSStringFromSelector(_cmd)]; NSConditionLock *waitingLock = - [[NSConditionLock alloc] initWithCondition: 0]; + [[NSConditionLock alloc] initWithCondition: 0]; // array retain balanced in _performSelectorOnThreadHelper: - [runloop - performSelector: @selector(_performSelectorOnThreadHelper:) - target: self - argument: [[NSArray - arrayWithObjects: - waitingLock, - NSStringFromSelector(selector), - [NSValue valueWithPointer: object], - nil] retain] - order: 0 - modes: modes]; + [runloop performSelector: @selector(_performSelectorOnThreadHelper:) + target: self + argument: [[NSArray + arrayWithObjects: + waitingLock, + NSStringFromSelector( + selector), + [NSValue valueWithPointer: + object], + nil] retain] + order: 0 + modes: modes]; [waitingLock lockWhenCondition: 1]; [waitingLock unlock]; @@ -483,7 +485,7 @@ void NSThreadSetCurrentPool(NSAutoreleasePool *pool) { withObject: object waitUntilDone: waitUntilDone modes: [NSArray arrayWithObject: - NSRunLoopCommonModes]]; + NSRunLoopCommonModes]]; } - (void) performSelectorInBackground: (SEL) selector withObject: object { diff --git a/Foundation/NSTimeZone/NSTimeZone.h b/Foundation/NSTimeZone/NSTimeZone.h index 2c081743..b01ad0b7 100644 --- a/Foundation/NSTimeZone/NSTimeZone.h +++ b/Foundation/NSTimeZone/NSTimeZone.h @@ -21,7 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSArray, NSDate, NSData, NSDictionary, NSLocale, NSString, - NSMutableArray; + NSMutableArray; typedef NSInteger NSTimeZoneNameStyle; diff --git a/Foundation/NSTimeZone/NSTimeZone.m b/Foundation/NSTimeZone/NSTimeZone.m index edee901a..c59c7cce 100644 --- a/Foundation/NSTimeZone/NSTimeZone.m +++ b/Foundation/NSTimeZone/NSTimeZone.m @@ -30,7 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include NSString *const NSSystemTimeZoneDidChangeNotification = - @"NSSystemTimeZoneDidChangeNotification"; + @"NSSystemTimeZoneDidChangeNotification"; static NSTimeZone *_systemTimeZone = nil; static NSTimeZone *_defaultTimeZone = nil; @@ -56,7 +56,7 @@ static NSTimeZone *_localTimeZone = nil; + (NSTimeZone *) systemTimeZone { if (_systemTimeZone == nil) { _systemTimeZone = [[[[NSPlatform currentPlatform] timeZoneClass] - systemTimeZone] retain]; + systemTimeZone] retain]; } return _systemTimeZone; @@ -97,10 +97,10 @@ static NSTimeZone *_localTimeZone = nil; static NSDictionary *_abbreviationDictionary = nil; if (_abbreviationDictionary == nil) { NSString *pathToPlist = [[NSBundle bundleForClass: self] - pathForResource: @"NSTimeZoneAbbreviations" - ofType: @"plist"]; + pathForResource: @"NSTimeZoneAbbreviations" + ofType: @"plist"]; _abbreviationDictionary = [[NSDictionary allocWithZone: NULL] - initWithContentsOfFile: pathToPlist]; + initWithContentsOfFile: pathToPlist]; } return _abbreviationDictionary; @@ -126,12 +126,12 @@ static NSTimeZone *_localTimeZone = nil; + (NSTimeZone *) timeZoneForSecondsFromGMT: (NSInteger) seconds { return [[[NSTimeZone_absolute allocWithZone: NULL] - initWithSecondsFromGMT: seconds] autorelease]; + initWithSecondsFromGMT: seconds] autorelease]; } + (NSTimeZone *) timeZoneWithAbbreviation: (NSString *) abbreviation { NSString *fullName = - [[self abbreviationDictionary] objectForKey: abbreviation]; + [[self abbreviationDictionary] objectForKey: abbreviation]; if (fullName != nil) return [self timeZoneWithName: fullName]; diff --git a/Foundation/NSTimeZone/NSTimeZoneTransition.h b/Foundation/NSTimeZone/NSTimeZoneTransition.h index 3d5f613d..f648dfdb 100644 --- a/Foundation/NSTimeZone/NSTimeZoneTransition.h +++ b/Foundation/NSTimeZone/NSTimeZoneTransition.h @@ -27,8 +27,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + (NSTimeZoneTransition *) - timeZoneTransitionWithTransitionDate: (NSDate *) transitionDate - typeIndex: (unsigned) typeIndex; + timeZoneTransitionWithTransitionDate: (NSDate *) transitionDate + typeIndex: (unsigned) typeIndex; - initWithTransitionDate: (NSDate *) transitionDate typeIndex: (unsigned) typeIndex; diff --git a/Foundation/NSTimeZone/NSTimeZoneTransition.m b/Foundation/NSTimeZone/NSTimeZoneTransition.m index 7b137b44..51dc9265 100644 --- a/Foundation/NSTimeZone/NSTimeZoneTransition.m +++ b/Foundation/NSTimeZone/NSTimeZoneTransition.m @@ -26,12 +26,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSTimeZoneTransition + (NSTimeZoneTransition *) - timeZoneTransitionWithTransitionDate: (NSDate *) transitionDate - typeIndex: (unsigned) typeIndex + timeZoneTransitionWithTransitionDate: (NSDate *) transitionDate + typeIndex: (unsigned) typeIndex { return [[[self allocWithZone: NULL] initWithTransitionDate: transitionDate typeIndex: typeIndex] - autorelease]; + autorelease]; } - initWithTransitionDate: (NSDate *) transitionDate @@ -68,8 +68,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: @"<%@[0x%lx] transitionDate: %@ typeIndex: %d", - [self class], self, _transitionDate, _typeIndex]; + stringWithFormat: @"<%@[0x%lx] transitionDate: %@ typeIndex: %d", + [self class], self, _transitionDate, _typeIndex]; } @end diff --git a/Foundation/NSTimeZone/NSTimeZoneType.h b/Foundation/NSTimeZone/NSTimeZoneType.h index 81429d37..eab37f20 100644 --- a/Foundation/NSTimeZone/NSTimeZoneType.h +++ b/Foundation/NSTimeZone/NSTimeZoneType.h @@ -32,8 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ abbreviation: (NSString *) abbreviation; - initWithSecondsFromGMT: (NSInteger) seconds - isDaylightSavingTime: (BOOL) isDST - abbreviation: (NSString *) abbreviation; + isDaylightSavingTime: (BOOL) isDST + abbreviation: (NSString *) abbreviation; - (NSInteger) secondsFromGMT; - (BOOL) isDaylightSavingTime; diff --git a/Foundation/NSTimeZone/NSTimeZoneType.m b/Foundation/NSTimeZone/NSTimeZoneType.m index 519cdb09..d7826388 100644 --- a/Foundation/NSTimeZone/NSTimeZoneType.m +++ b/Foundation/NSTimeZone/NSTimeZoneType.m @@ -29,12 +29,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return [[[self allocWithZone: NULL] initWithSecondsFromGMT: seconds isDaylightSavingTime: isDST abbreviation: abbreviation] - autorelease]; + autorelease]; } - initWithSecondsFromGMT: (NSInteger) seconds - isDaylightSavingTime: (BOOL) isDST - abbreviation: (NSString *) abbreviation + isDaylightSavingTime: (BOOL) isDST + abbreviation: (NSString *) abbreviation { _secondsFromGMT = seconds; _isDaylightSavingTime = isDST; @@ -63,11 +63,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: @"<%@[0x%lx] secondsFromGMT: %d " - @"isDaylightSavingTime: %@ abbreviation: %@>", - [self class], self, _secondsFromGMT, - _isDaylightSavingTime ? @"YES" : @"NO", - _abbreviation]; + stringWithFormat: @"<%@[0x%lx] secondsFromGMT: %d " + @"isDaylightSavingTime: %@ abbreviation: %@>", + [self class], self, _secondsFromGMT, + _isDaylightSavingTime ? @"YES" : @"NO", + _abbreviation]; } - copyWithZone: (NSZone *) zone { diff --git a/Foundation/NSTimeZone/NSTimeZone_absolute.m b/Foundation/NSTimeZone/NSTimeZone_absolute.m index ca4bd697..a43818c8 100644 --- a/Foundation/NSTimeZone/NSTimeZone_absolute.m +++ b/Foundation/NSTimeZone/NSTimeZone_absolute.m @@ -32,11 +32,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [super init]; _secondsFromGMT = seconds; _name = [[NSString allocWithZone: NULL] - initWithFormat: @"GMT %@%02d%02d", (seconds >= 0 ? @"+" : @""), - seconds / 3600, (seconds % 3600) / 60]; + initWithFormat: @"GMT %@%02d%02d", (seconds >= 0 ? @"+" : @""), + seconds / 3600, (seconds % 3600) / 60]; _abbreviation = [[NSString allocWithZone: NULL] - initWithFormat: @"%@%02d%02d", (seconds >= 0 ? @"+" : @""), - seconds / 3600, (seconds % 3600) / 60]; + initWithFormat: @"%@%02d%02d", (seconds >= 0 ? @"+" : @""), + seconds / 3600, (seconds % 3600) / 60]; return self; } diff --git a/Foundation/NSTimer/NSTimer.m b/Foundation/NSTimer/NSTimer.m index 8125f620..9946dfdf 100644 --- a/Foundation/NSTimer/NSTimer.m +++ b/Foundation/NSTimer/NSTimer.m @@ -49,9 +49,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ { return NSAutorelease([NSAllocateObject([NSTimer_invocation class], 0, NULL) - initWithTimeInterval: timeInterval - repeats: repeats - invocation: invocation]); + initWithTimeInterval: timeInterval + repeats: repeats + invocation: invocation]); } + (NSTimer *) timerWithTimeInterval: (NSTimeInterval) timeInterval @@ -62,12 +62,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ { return NSAutorelease( - [NSAllocateObject([NSTimer_targetAction class], 0, NULL) - initWithTimeInterval: timeInterval - repeats: repeats - userInfo: userInfo - target: target - selector: selector]); + [NSAllocateObject([NSTimer_targetAction class], 0, NULL) + initWithTimeInterval: timeInterval + repeats: repeats + userInfo: userInfo + target: target + selector: selector]); } + (NSTimer *) scheduledTimerWithTimeInterval: (NSTimeInterval) timeInterval diff --git a/Foundation/NSURL/NSCachedURLResponse.h b/Foundation/NSURL/NSCachedURLResponse.h index b344a654..dc9d6304 100644 --- a/Foundation/NSURL/NSCachedURLResponse.h +++ b/Foundation/NSURL/NSCachedURLResponse.h @@ -29,9 +29,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithResponse: (NSURLResponse *) response - data: (NSData *) data - userInfo: (NSDictionary *) userInfo - storagePolicy: (NSURLCacheStoragePolicy) storagePolicy; + data: (NSData *) data + userInfo: (NSDictionary *) userInfo + storagePolicy: (NSURLCacheStoragePolicy) storagePolicy; - initWithResponse: (NSURLResponse *) response data: (NSData *) data; - (NSURLResponse *) response; diff --git a/Foundation/NSURL/NSCachedURLResponse.m b/Foundation/NSURL/NSCachedURLResponse.m index 17cb0edb..6d8ab7b4 100644 --- a/Foundation/NSURL/NSCachedURLResponse.m +++ b/Foundation/NSURL/NSCachedURLResponse.m @@ -21,9 +21,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSCachedURLResponse - initWithResponse: (NSURLResponse *) response - data: (NSData *) data - userInfo: (NSDictionary *) userInfo - storagePolicy: (NSURLCacheStoragePolicy) storagePolicy + data: (NSData *) data + userInfo: (NSDictionary *) userInfo + storagePolicy: (NSURLCacheStoragePolicy) storagePolicy { _response = [response copy]; _data = [data copy]; diff --git a/Foundation/NSURL/NSHTTPURLResponse.m b/Foundation/NSURL/NSHTTPURLResponse.m index cdd5e9e9..6c60a0fc 100644 --- a/Foundation/NSURL/NSHTTPURLResponse.m +++ b/Foundation/NSURL/NSHTTPURLResponse.m @@ -48,19 +48,19 @@ static NSString *textEncodingNameFromContentType(NSString *contentType) { } - initWithURL: (NSURL *) url - statusCode: (NSInteger) statusCode - headers: (NSDictionary *) headers + statusCode: (NSInteger) statusCode + headers: (NSDictionary *) headers { NSString *contentType = valueInHeaders(headers, @"content-type"); NSInteger contentLength = - [valueInHeaders(headers, @"content-length") integerValue]; + [valueInHeaders(headers, @"content-length") integerValue]; NSString *mimeType = mimeTypeFromContentType(contentType); NSString *textEncodingName = textEncodingNameFromContentType(contentType); [super initWithURL: url - MIMEType: mimeType - expectedContentLength: contentLength - textEncodingName: textEncodingName]; + MIMEType: mimeType + expectedContentLength: contentLength + textEncodingName: textEncodingName]; _statusCode = statusCode; _allHeaderFields = [headers retain]; diff --git a/Foundation/NSURL/NSMutableURLRequest.m b/Foundation/NSURL/NSMutableURLRequest.m index fe2b6641..375810cf 100644 --- a/Foundation/NSURL/NSMutableURLRequest.m +++ b/Foundation/NSURL/NSMutableURLRequest.m @@ -90,7 +90,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ existing = [_headerFields objectForKey: field]; if (existing != nil) value = [[existing stringByAppendingString: @","] - stringByAppendingString: value]; + stringByAppendingString: value]; [_headerFields setObject: value forKey: field]; } diff --git a/Foundation/NSURL/NSURL.m b/Foundation/NSURL/NSURL.m index 148e2089..70fd74fc 100644 --- a/Foundation/NSURL/NSURL.m +++ b/Foundation/NSURL/NSURL.m @@ -362,9 +362,9 @@ static void scan_net_loc(urlScanner *scanner, NSURL *url) { url->_user = [[NSString alloc] initWithCharacters: scanner->part length: user]; if (user < login) - url->_password = - [[NSString alloc] initWithCharacters: scanner->part + user + 1 - length: login - (user + 1)]; + url->_password = [[NSString alloc] + initWithCharacters: scanner->part + user + 1 + length: login - (user + 1)]; } NSInteger portEnd = scanner->partLength; @@ -379,8 +379,8 @@ static void scan_net_loc(urlScanner *scanner, NSURL *url) { port++; NSString *string = - [[NSString alloc] initWithCharacters: scanner->part + port - length: portEnd - port]; + [[NSString alloc] initWithCharacters: scanner->part + port + length: portEnd - port]; NSScanner *portScanner = [[NSScanner alloc] initWithString: string]; int portNumber; @@ -506,9 +506,9 @@ static BOOL scanURL(urlScanner *scanner, NSURL *url) { urlScanner scannerStruct, *scanner = &scannerStruct; if (string == nil) { - [NSException - raise: NSInvalidArgumentException - format: @"-[%@ %s] string == nil", [self class], sel_getName(_cmd)]; + [NSException raise: NSInvalidArgumentException + format: @"-[%@ %s] string == nil", [self class], + sel_getName(_cmd)]; } initScanner(scanner, string); @@ -574,7 +574,7 @@ static BOOL scanURL(urlScanner *scanner, NSURL *url) { [self initFileURLWithPath: rel]; else [self initWithString: rel - relativeToURL: [keyed decodeObjectForKey: @"NS.base"]]; + relativeToURL: [keyed decodeObjectForKey: @"NS.base"]]; return self; } else { @@ -658,12 +658,12 @@ static BOOL scanURL(urlScanner *scanner, NSURL *url) { static NSString *NormalizePath(NSString *path) { NSArray *components = [path componentsSeparatedByString: @"/"]; NSMutableArray *actualComponents = - [NSMutableArray arrayWithCapacity: [components count]]; + [NSMutableArray arrayWithCapacity: [components count]]; NSString *lastComponent = [components lastObject]; if (![lastComponent isEqualToString: @".."]) components = [components - subarrayWithRange: NSMakeRange(0, [components count] - 1)]; + subarrayWithRange: NSMakeRange(0, [components count] - 1)]; for (NSString *part in components) { if ([part isEqualToString: @".."]) { @@ -839,7 +839,7 @@ AssembleResourceSpecifier(NSMutableString *result, NSString *host, - (NSString *) relativePath { NSString *result = [_path - stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; + stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; if ([result length] > 1 && [result hasSuffix: @"/"]) result = [result substringToIndex: [result length] - 1]; @@ -907,14 +907,14 @@ AssembleResourceSpecifier(NSMutableString *result, NSString *host, } - (NSURL *) URLByAppendingPathComponent: (NSString *) pathComponent { - NSString *url = - [[self absoluteString] stringByAppendingPathComponent: pathComponent]; + NSString *url = [[self absoluteString] + stringByAppendingPathComponent: pathComponent]; return [NSURL URLWithString: url]; } - (NSURL *) URLByAppendingPathExtension: (NSString *) pathExtension { - NSString *url = - [[self absoluteString] stringByAppendingPathExtension: pathExtension]; + NSString *url = [[self absoluteString] + stringByAppendingPathExtension: pathExtension]; return [NSURL URLWithString: url]; } @@ -960,8 +960,8 @@ AssembleResourceSpecifier(NSMutableString *result, NSString *host, } - (NSURL *) URLByResolvingSymlinksInPath { - return - [NSURL fileURLWithPath: [[self path] stringByResolvingSymlinksInPath]]; + return [NSURL + fileURLWithPath: [[self path] stringByResolvingSymlinksInPath]]; } @end diff --git a/Foundation/NSURL/NSURLAuthenticationChallenge.h b/Foundation/NSURL/NSURLAuthenticationChallenge.h index f2f9cb5f..ed5f1fde 100644 --- a/Foundation/NSURL/NSURLAuthenticationChallenge.h +++ b/Foundation/NSURL/NSURLAuthenticationChallenge.h @@ -33,15 +33,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithProtectionSpace: (NSURLProtectionSpace *) space - proposedCredential: (NSURLCredential *) credential - previousFailureCount: (int) failureCount - failureResponse: (NSURLResponse *) failureResponse - error: (NSError *) error - sender: (id) sender; + proposedCredential: (NSURLCredential *) credential + previousFailureCount: (int) failureCount + failureResponse: (NSURLResponse *) failureResponse + error: (NSError *) error + sender: (id) sender; - initWithAuthenticationChallenge: (NSURLAuthenticationChallenge *) challenge - sender: - (id) sender; + sender: (id) + sender; - (NSURLProtectionSpace *) protectionSpace; - (NSURLCredential *) proposedCredential; diff --git a/Foundation/NSURL/NSURLAuthenticationChallenge.m b/Foundation/NSURL/NSURLAuthenticationChallenge.m index bf259a37..c9d553da 100644 --- a/Foundation/NSURL/NSURLAuthenticationChallenge.m +++ b/Foundation/NSURL/NSURLAuthenticationChallenge.m @@ -25,11 +25,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSURLAuthenticationChallenge - initWithProtectionSpace: (NSURLProtectionSpace *) space - proposedCredential: (NSURLCredential *) credential - previousFailureCount: (int) failureCount - failureResponse: (NSURLResponse *) failureResponse - error: (NSError *) error - sender: (id) sender + proposedCredential: (NSURLCredential *) credential + previousFailureCount: (int) failureCount + failureResponse: (NSURLResponse *) failureResponse + error: (NSError *) error + sender: (id) sender { _protectionSpace = [space copy]; _proposedCredential = [credential copy]; @@ -40,8 +40,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithAuthenticationChallenge: (NSURLAuthenticationChallenge *) challenge - sender: - (id) sender + sender: (id) + sender { return [self initWithProtectionSpace: [challenge protectionSpace] proposedCredential: [challenge proposedCredential] diff --git a/Foundation/NSURL/NSURLCache.m b/Foundation/NSURL/NSURLCache.m index c06a2db0..6dbb9080 100644 --- a/Foundation/NSURL/NSURLCache.m +++ b/Foundation/NSURL/NSURLCache.m @@ -35,8 +35,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @interface NSHTTPURLResponse (private) - initWithURL: (NSURL *) url - statusCode: (NSInteger) statusCode - headers: (NSDictionary *) headers; + statusCode: (NSInteger) statusCode + headers: (NSDictionary *) headers; @end @implementation NSURLCache @@ -46,7 +46,7 @@ static NSURLCache *shared = nil; + (NSURLCache *) sharedURLCache { if (shared == nil) { NSString *path = [NSSearchPathForDirectoriesInDomains( - NSCachesDirectory, NSUserDomainMask, YES) lastObject]; + NSCachesDirectory, NSUserDomainMask, YES) lastObject]; path = [path stringByAppendingPathComponent: @"NSURLCache"]; @@ -80,8 +80,8 @@ static NSURLCache *shared = nil; _memoryAccess = [[NSMutableArray alloc] init]; _diskCache = [[NSMutableDictionary alloc] - initWithContentsOfFile: [_path - stringByAppendingPathComponent: @"cache"]]; + initWithContentsOfFile: + [_path stringByAppendingPathComponent: @"cache"]]; if (_diskCache == nil) _diskCache = [[NSMutableDictionary alloc] init]; @@ -118,49 +118,51 @@ static NSURLCache *shared = nil; if (result == nil) { NSMutableDictionary *properties = - [_diskCache objectForKey: [[request URL] absoluteString]]; + [_diskCache objectForKey: [[request URL] absoluteString]]; if (properties != nil) { - NSString *dataPath = [[_path - stringByAppendingPathComponent: [properties - objectForKey: @"file"]] - stringByAppendingPathExtension: @"data"]; + NSString *dataPath = + [[_path stringByAppendingPathComponent: + [properties objectForKey: @"file"]] + stringByAppendingPathExtension: @"data"]; NSData *data = [NSData dataWithContentsOfFile: dataPath]; - NSString *headerPath = [[_path - stringByAppendingPathComponent: [properties - objectForKey: @"file"]] - stringByAppendingPathExtension: @"headers"]; + NSString *headerPath = + [[_path stringByAppendingPathComponent: + [properties objectForKey: @"file"]] + stringByAppendingPathExtension: @"headers"]; NSDictionary *headers = - [NSDictionary dictionaryWithContentsOfFile: headerPath]; + [NSDictionary dictionaryWithContentsOfFile: headerPath]; if (data != nil && headers != nil) { NSHTTPURLResponse *response = [[[NSHTTPURLResponse alloc] - initWithURL: [request URL] - statusCode: 200 - headers: headers] autorelease]; + initWithURL: [request URL] + statusCode: 200 + headers: headers] autorelease]; result = [[[NSCachedURLResponse alloc] - initWithResponse: response - data: data - userInfo: nil - storagePolicy: NSURLCacheStorageNotAllowed] autorelease]; + initWithResponse: response + data: data + userInfo: nil + storagePolicy: NSURLCacheStorageNotAllowed] + autorelease]; properties = [[properties mutableCopy] autorelease]; [properties - setObject: [NSString - stringWithFormat: - @"%f", - [[NSDate date] - timeIntervalSinceReferenceDate]] - forKey: @"lastAccess"]; + setObject: + [NSString + stringWithFormat: + @"%f", + [[NSDate date] + timeIntervalSinceReferenceDate]] + forKey: @"lastAccess"]; [_diskCache setObject: properties forKey: [[request URL] absoluteString]]; if (![_diskCache - writeToFile: - [_path stringByAppendingPathComponent: @"cache"] - atomically: YES]) { + writeToFile: [_path stringByAppendingPathComponent: + @"cache"] + atomically: YES]) { } } } @@ -180,7 +182,7 @@ static NSURLCache *shared = nil; - (NSString *) nextFileForDiskCache { CFUUIDRef uuid = CFUUIDCreate(NULL); NSString *result = - [(NSString *) CFUUIDCreateString(NULL, uuid) autorelease]; + [(NSString *) CFUUIDCreateString(NULL, uuid) autorelease]; CFRelease(uuid); @@ -192,7 +194,8 @@ static NSURLCache *shared = nil; // files will purge them NSMutableArray *bySize = [[[_diskCache allValues] mutableCopy] autorelease]; NSSortDescriptor *sort = - [NSSortDescriptor sortDescriptorWithKey: @"lastAccess" ascending: NO]; + [NSSortDescriptor sortDescriptorWithKey: @"lastAccess" + ascending: NO]; [bySize sortUsingDescriptors: [NSArray arrayWithObject: sort]]; @@ -223,15 +226,16 @@ static NSURLCache *shared = nil; NSDictionary *properties = [_diskCache objectForKey: key]; [allValidFiles - addObject: [[properties objectForKey: @"file"] - stringByAppendingPathExtension: @"headers"]]; - [allValidFiles addObject: [[properties objectForKey: @"file"] - stringByAppendingPathExtension: @"data"]]; + addObject: [[properties objectForKey: @"file"] + stringByAppendingPathExtension: @"headers"]]; + [allValidFiles + addObject: [[properties objectForKey: @"file"] + stringByAppendingPathExtension: @"data"]]; } NSArray *allFiles = - [[NSFileManager defaultManager] contentsOfDirectoryAtPath: _path - error: NULL]; + [[NSFileManager defaultManager] contentsOfDirectoryAtPath: _path + error: NULL]; for (NSString *check in allFiles) { @@ -258,22 +262,23 @@ static NSURLCache *shared = nil; NSString *file = [self nextFileForDiskCache]; [properties setObject: file forKey: @"file"]; [properties - setObject: [NSString - stringWithFormat: @"%f", - [[NSDate date] - timeIntervalSinceReferenceDate]] - forKey: @"lastAccess"]; + setObject: [NSString + stringWithFormat: + @"%f", + [[NSDate date] + timeIntervalSinceReferenceDate]] + forKey: @"lastAccess"]; // duplicative but makes cache purging simpler [properties setObject: [[request URL] absoluteString] forKey: @"url"]; NSString *headersPath = [[_path stringByAppendingPathComponent: file] - stringByAppendingPathExtension: @"headers"]; + stringByAppendingPathExtension: @"headers"]; NSString *dataPath = [[_path stringByAppendingPathComponent: file] - stringByAppendingPathExtension: @"data"]; + stringByAppendingPathExtension: @"data"]; if (![[(NSHTTPURLResponse *) response allHeaderFields] - writeToFile: headersPath - atomically: YES]) { + writeToFile: headersPath + atomically: YES]) { return; } @@ -284,8 +289,8 @@ static NSURLCache *shared = nil; [_diskCache setObject: properties forKey: [[request URL] absoluteString]]; if (![_diskCache - writeToFile: [_path stringByAppendingPathComponent: @"cache"] - atomically: YES]) { + writeToFile: [_path stringByAppendingPathComponent: @"cache"] + atomically: YES]) { } } @@ -317,8 +322,8 @@ static NSURLCache *shared = nil; [_diskCache removeObjectForKey: [[request URL] absoluteString]]; if (![_diskCache - writeToFile: [_path stringByAppendingPathComponent: @"cache"] - atomically: YES]) { + writeToFile: [_path stringByAppendingPathComponent: @"cache"] + atomically: YES]) { } } diff --git a/Foundation/NSURL/NSURLConnection.h b/Foundation/NSURL/NSURLConnection.h index 0edaead8..3f43608a 100644 --- a/Foundation/NSURL/NSURLConnection.h +++ b/Foundation/NSURL/NSURLConnection.h @@ -20,8 +20,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSInputStream, NSOutputStream, NSRunLoop, NSURLRequest, NSData, - NSURLResponse, NSError, NSMutableArray, NSURLAuthenticationChallenge, - NSCachedURLResponse, NSURLProtocol, NSMutableData; + NSURLResponse, NSError, NSMutableArray, NSURLAuthenticationChallenge, + NSCachedURLResponse, NSURLProtocol, NSMutableData; @interface NSURLConnection : NSObject { NSURLRequest *_request; @@ -41,8 +41,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ delegate: delegate; - initWithRequest: (NSURLRequest *) request - delegate: delegate - startImmediately: (BOOL) startLoading; + delegate: delegate + startImmediately: (BOOL) startLoading; - initWithRequest: (NSURLRequest *) request delegate: delegate; - (void) start; @@ -56,17 +56,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @interface NSObject (NSURLConnectionDelegate) - (void) connection: (NSURLConnection *) connection - didFailWithError: (NSError *) error; + didFailWithError: (NSError *) error; - (void) connection: (NSURLConnection *) connection - didReceiveAuthenticationChallenge: - (NSURLAuthenticationChallenge *) challenge; + didReceiveAuthenticationChallenge: + (NSURLAuthenticationChallenge *) challenge; - (void) connection: (NSURLConnection *) connection - didCancelAuthenticationChallenge: - (NSURLAuthenticationChallenge *) challenge; + didCancelAuthenticationChallenge: + (NSURLAuthenticationChallenge *) challenge; - (void) connection: (NSURLConnection *) connection - didReceiveData: (NSData *) data; + didReceiveData: (NSData *) data; - (void) connection: (NSURLConnection *) connection - didReceiveResponse: (NSURLResponse *) response; + didReceiveResponse: (NSURLResponse *) response; - (NSCachedURLResponse *) connection: (NSURLConnection *) connection willCacheResponse: (NSCachedURLResponse *) response; - (NSURLRequest *) connection: (NSURLConnection *) connection diff --git a/Foundation/NSURL/NSURLConnection.m b/Foundation/NSURL/NSURLConnection.m index f8b0412f..9090ebc6 100644 --- a/Foundation/NSURL/NSURLConnection.m +++ b/Foundation/NSURL/NSURLConnection.m @@ -56,7 +56,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ error: (NSError **) errorp { NSURLConnectionState *state = - [[[NSURLConnectionState alloc] init] autorelease]; + [[[NSURLConnectionState alloc] init] autorelease]; NSURLConnection *connection = [[self alloc] initWithRequest: request delegate: state]; @@ -116,17 +116,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithRequest: (NSURLRequest *) request - delegate: delegate - startImmediately: (BOOL) startLoading + delegate: delegate + startImmediately: (BOOL) startLoading { _request = [request copy]; Class cls = [NSURLProtocol _URLProtocolClassForRequest: request]; if ((_protocol = [[cls alloc] - initWithRequest: _request - cachedResponse: [[NSURLCache sharedURLCache] - cachedResponseForRequest: _request] - client: self]) == nil) { + initWithRequest: _request + cachedResponse: [[NSURLCache sharedURLCache] + cachedResponseForRequest: _request] + client: self]) == nil) { [self dealloc]; return nil; } @@ -175,20 +175,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) URLProtocol: (NSURLProtocol *) urlProtocol - wasRedirectedToRequest: (NSURLRequest *) request - redirectResponse: (NSURLResponse *) redirect + wasRedirectedToRequest: (NSURLRequest *) request + redirectResponse: (NSURLResponse *) redirect { #if DEBUG NSLog(@"wasRedirectedToRequest: %@", request); #endif [_delegate connection: self - willSendRequest: request - redirectResponse: redirect]; + willSendRequest: request + redirectResponse: redirect]; } - (void) URLProtocol: (NSURLProtocol *) urlProtocol - didReceiveAuthenticationChallenge: - (NSURLAuthenticationChallenge *) challenge + didReceiveAuthenticationChallenge: + (NSURLAuthenticationChallenge *) challenge { #if DEBUG NSLog(@"didReceiveAuthenticationChallenge: %@", challenge); @@ -197,7 +197,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) URLProtocol: (NSURLProtocol *) urlProtocol - didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *) challenge + didCancelAuthenticationChallenge: + (NSURLAuthenticationChallenge *) challenge { #if DEBUG NSLog(@"didCancelAuthenticationChallenge: %@", challenge); @@ -206,8 +207,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) URLProtocol: (NSURLProtocol *) urlProtocol - didReceiveResponse: (NSURLResponse *) response - cacheStoragePolicy: (NSURLCacheStoragePolicy) policy + didReceiveResponse: (NSURLResponse *) response + cacheStoragePolicy: (NSURLCacheStoragePolicy) policy { #if DEBUG NSLog(@"didReceiveResponse: %@", response); @@ -216,12 +217,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _storagePolicy = policy; if ([_delegate respondsToSelector: @selector(connection: - didReceiveResponse:)]) + didReceiveResponse:)]) [_delegate connection: self didReceiveResponse: response]; } - (void) URLProtocol: (NSURLProtocol *) urlProtocol - cachedResponseIsValid: (NSCachedURLResponse *) cachedResponse + cachedResponseIsValid: (NSCachedURLResponse *) cachedResponse { #if DEBUG NSLog(@"cachedResponseIsValid: %@", cachedResponse); @@ -234,8 +235,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #if DEBUG NSString *str = - [[[NSString alloc] initWithData: data - encoding: NSUTF8StringEncoding] autorelease]; + [[[NSString alloc] initWithData: data + encoding: NSUTF8StringEncoding] autorelease]; NSLog(@"didLoadData: %@", str); #endif @@ -248,7 +249,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) URLProtocol: (NSURLProtocol *) urlProtocol - didFailWithError: (NSError *) error + didFailWithError: (NSError *) error { #if DEBUG NSLog(@"didFailWithError: %@", error); @@ -270,13 +271,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [[NSURLCache sharedURLCache] removeCachedResponseForRequest: _request]; } else { NSCachedURLResponse *cachedResponse = - [[NSCachedURLResponse alloc] initWithResponse: _response - data: _mutableData - userInfo: nil - storagePolicy: _storagePolicy]; + [[NSCachedURLResponse alloc] initWithResponse: _response + data: _mutableData + userInfo: nil + storagePolicy: _storagePolicy]; if ([_delegate respondsToSelector: @selector(connection: - willCacheResponse:)]) + willCacheResponse:)]) cachedResponse = [_delegate connection: self willCacheResponse: cachedResponse]; diff --git a/Foundation/NSURL/NSURLConnectionState.m b/Foundation/NSURL/NSURLConnectionState.m index 6927350b..261d912f 100644 --- a/Foundation/NSURL/NSURLConnectionState.m +++ b/Foundation/NSURL/NSURLConnectionState.m @@ -49,7 +49,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) connection: (NSURLConnection *) connection - didReceiveData: (NSData *) data + didReceiveData: (NSData *) data { } @@ -58,7 +58,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) connection: (NSURLConnection *) connection - didFailWithError: (NSError *) error + didFailWithError: (NSError *) error { _isRunning = NO; _error = [error retain]; diff --git a/Foundation/NSURL/NSURLCredential.h b/Foundation/NSURL/NSURLCredential.h index 926c9cf2..9637c6a3 100644 --- a/Foundation/NSURL/NSURLCredential.h +++ b/Foundation/NSURL/NSURLCredential.h @@ -29,11 +29,11 @@ typedef int NSURLCredentialPersistence; + (NSURLCredential *) credentialWithUser: (NSString *) user password: (NSString *) password persistence: - (NSURLCredentialPersistence) persistence; + (NSURLCredentialPersistence) persistence; - initWithUser: (NSString *) user - password: (NSString *) password - persistence: (NSURLCredentialPersistence) persistence; + password: (NSString *) password + persistence: (NSURLCredentialPersistence) persistence; - (NSString *) user; - (NSString *) password; diff --git a/Foundation/NSURL/NSURLCredential.m b/Foundation/NSURL/NSURLCredential.m index e8cdf691..01791b76 100644 --- a/Foundation/NSURL/NSURLCredential.m +++ b/Foundation/NSURL/NSURLCredential.m @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSURLCredential *) credentialWithUser: (NSString *) user password: (NSString *) password persistence: - (NSURLCredentialPersistence) persistence + (NSURLCredentialPersistence) persistence { return [[[self alloc] initWithUser: user password: password @@ -32,8 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithUser: (NSString *) user - password: (NSString *) password - persistence: (NSURLCredentialPersistence) persistence + password: (NSString *) password + persistence: (NSURLCredentialPersistence) persistence { _user = [user copy]; _password = [password copy]; diff --git a/Foundation/NSURL/NSURLCredentialStorage.h b/Foundation/NSURL/NSURLCredentialStorage.h index 8cd70000..93397cde 100644 --- a/Foundation/NSURL/NSURLCredentialStorage.h +++ b/Foundation/NSURL/NSURLCredentialStorage.h @@ -29,16 +29,16 @@ FOUNDATION_EXPORT NSString *const NSURLCredentialStorageChangedNotification; - (NSDictionary *) allCredentials; - (NSDictionary *) credentialsForProtectionSpace: - (NSURLProtectionSpace *) protectionSpace; + (NSURLProtectionSpace *) protectionSpace; - (NSURLCredential *) defaultCredentialForProtectionSpace: - (NSURLProtectionSpace *) protectionSpace; + (NSURLProtectionSpace *) protectionSpace; - (void) setCredential: (NSURLCredential *) credential - forProtectionSpace: (NSURLProtectionSpace *) protectionSpace; + forProtectionSpace: (NSURLProtectionSpace *) protectionSpace; - (void) setDefaultCredential: (NSURLCredential *) credential forProtectionSpace: (NSURLProtectionSpace *) protectionSpace; - (void) removeCredential: (NSURLCredential *) credential - forProtectionSpace: (NSURLProtectionSpace *) protectionSpace; + forProtectionSpace: (NSURLProtectionSpace *) protectionSpace; @end diff --git a/Foundation/NSURL/NSURLCredentialStorage.m b/Foundation/NSURL/NSURLCredentialStorage.m index 4d20a563..528463eb 100644 --- a/Foundation/NSURL/NSURLCredentialStorage.m +++ b/Foundation/NSURL/NSURLCredentialStorage.m @@ -21,7 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import NSString *const NSURLCredentialStorageChangedNotification = - @"NSURLCredentialStorageChangedNotification"; + @"NSURLCredentialStorageChangedNotification"; @implementation NSURLCredentialStorage @@ -41,21 +41,21 @@ NSString *const NSURLCredentialStorageChangedNotification = } - (NSDictionary *) credentialsForProtectionSpace: - (NSURLProtectionSpace *) protectionSpace + (NSURLProtectionSpace *) protectionSpace { NSUnimplementedMethod(); return nil; } - (NSURLCredential *) defaultCredentialForProtectionSpace: - (NSURLProtectionSpace *) protectionSpace + (NSURLProtectionSpace *) protectionSpace { NSUnimplementedMethod(); return nil; } - (void) setCredential: (NSURLCredential *) credential - forProtectionSpace: (NSURLProtectionSpace *) protectionSpace + forProtectionSpace: (NSURLProtectionSpace *) protectionSpace { NSUnimplementedMethod(); } @@ -67,7 +67,7 @@ NSString *const NSURLCredentialStorageChangedNotification = } - (void) removeCredential: (NSURLCredential *) credential - forProtectionSpace: (NSURLProtectionSpace *) protectionSpace + forProtectionSpace: (NSURLProtectionSpace *) protectionSpace { NSUnimplementedMethod(); } diff --git a/Foundation/NSURL/NSURLDownload.h b/Foundation/NSURL/NSURLDownload.h index 290723e7..e58a4656 100644 --- a/Foundation/NSURL/NSURLDownload.h +++ b/Foundation/NSURL/NSURLDownload.h @@ -19,7 +19,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSURLRequest, NSURLResponse, NSURLAuthenticationChallenge, NSData, - NSError, NSURLConnection, NSOutputStream; + NSError, NSURLConnection, NSOutputStream; @interface NSURLDownload : NSObject { NSURLRequest *_request; @@ -57,32 +57,32 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ willSendRequest: (NSURLRequest *) request redirectResponse: (NSURLResponse *) redirect; - (void) download: (NSURLDownload *) download - didReceiveAuthenticationChallenge: - (NSURLAuthenticationChallenge *) authChallenge; + didReceiveAuthenticationChallenge: + (NSURLAuthenticationChallenge *) authChallenge; - (void) download: (NSURLDownload *) download - didCancelAuthenticationChallenge: - (NSURLAuthenticationChallenge *) authChallenge; + didCancelAuthenticationChallenge: + (NSURLAuthenticationChallenge *) authChallenge; - (void) download: (NSURLDownload *) download - didReceiveResponse: (NSURLResponse *) response; + didReceiveResponse: (NSURLResponse *) response; - (void) download: (NSURLDownload *) download - didReceiveDataOfLength: (NSUInteger) length; + didReceiveDataOfLength: (NSUInteger) length; - (void) download: (NSURLDownload *) download - didFailWithError: (NSError *) error; + didFailWithError: (NSError *) error; - (void) downloadDidFinish: (NSURLDownload *) download; - (void) download: (NSURLDownload *) download - decideDestinationWithSuggestedFilename: (NSString *) suggested; + decideDestinationWithSuggestedFilename: (NSString *) suggested; - (void) download: (NSURLDownload *) download - didCreateDestination: (NSString *) destPath; + didCreateDestination: (NSString *) destPath; - (BOOL) download: (NSURLDownload *) download - shouldDecodeSourceDataOfMIMEType: (NSString *) mimeType; + shouldDecodeSourceDataOfMIMEType: (NSString *) mimeType; - (void) download: (NSURLDownload *) download - willResumeWithResponse: (NSURLResponse *) response - fromByte: (long long) position; + willResumeWithResponse: (NSURLResponse *) response + fromByte: (long long) position; - (void) download: (NSURLDownload *) download - didReceiveDataOfLength: (NSUInteger) length; + didReceiveDataOfLength: (NSUInteger) length; @end diff --git a/Foundation/NSURL/NSURLDownload.m b/Foundation/NSURL/NSURLDownload.m index b097b18a..685d3303 100644 --- a/Foundation/NSURL/NSURLDownload.m +++ b/Foundation/NSURL/NSURLDownload.m @@ -78,26 +78,27 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) connection: (NSURLConnection *) connection - didFailWithError: (NSError *) error + didFailWithError: (NSError *) error { if ([_delegate respondsToSelector: @selector(download:didFailWithError:)]) [_delegate download: self didFailWithError: error]; } - (void) connection: (NSURLConnection *) connection - didReceiveAuthenticationChallenge: - (NSURLAuthenticationChallenge *) challenge + didReceiveAuthenticationChallenge: + (NSURLAuthenticationChallenge *) challenge { - if ([_delegate respondsToSelector: @selector(download: - didReceiveAuthenticationChallenge:)]) + if ([_delegate respondsToSelector: @selector + (download:didReceiveAuthenticationChallenge:)]) [_delegate download: self didReceiveAuthenticationChallenge: challenge]; } - (void) connection: (NSURLConnection *) connection - didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *) challenge + didCancelAuthenticationChallenge: + (NSURLAuthenticationChallenge *) challenge { - if ([_delegate respondsToSelector: @selector(download: - didCancelAuthenticationChallenge:)]) + if ([_delegate respondsToSelector: @selector + (download:didCancelAuthenticationChallenge:)]) [_delegate download: self didCancelAuthenticationChallenge: challenge]; } @@ -116,10 +117,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ tryThis = [check stringByDeletingPathExtension]; tryThis = [tryThis stringByAppendingFormat: @"-%d", i]; tryThis = [tryThis - stringByAppendingPathExtension: [check pathExtension]]; + stringByAppendingPathExtension: [check pathExtension]]; if (![[NSFileManager defaultManager] - fileExistsAtPath: tryThis]) { + fileExistsAtPath: tryThis]) { check = tryThis; break; } @@ -130,23 +131,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _fileStream = [[NSOutputStream alloc] initToFileAtPath: check append: NO]; if ([_delegate respondsToSelector: @selector(download: - didCreateDestination:)]) + didCreateDestination:)]) [_delegate download: self didCreateDestination: check]; } - (void) connection: (NSURLConnection *) connection - didReceiveData: (NSData *) data + didReceiveData: (NSData *) data { [self _createFileStreamIfNeeded]; [_fileStream write: [data bytes] maxLength: [data length]]; if ([_delegate respondsToSelector: @selector(download: - didReceiveDataOfLength:)]) + didReceiveDataOfLength:)]) [_delegate download: self didReceiveDataOfLength: [data length]]; } - (void) connection: (NSURLConnection *) connection - didReceiveResponse: (NSURLResponse *) response + didReceiveResponse: (NSURLResponse *) response { if ([_delegate respondsToSelector: @selector(download:didReceiveResponse:)]) [_delegate download: self didReceiveResponse: response]; @@ -162,8 +163,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ willSendRequest: (NSURLRequest *) request redirectResponse: (NSURLResponse *) response { - if ([_delegate respondsToSelector: @selector(download: - willSendRequest:redirectResponse:)]) + if ([_delegate respondsToSelector: @selector + (download:willSendRequest:redirectResponse:)]) return [_delegate download: self willSendRequest: request redirectResponse: response]; diff --git a/Foundation/NSURL/NSURLProtectionSpace.h b/Foundation/NSURL/NSURLProtectionSpace.h index 1b3f8a51..c295b02b 100644 --- a/Foundation/NSURL/NSURLProtectionSpace.h +++ b/Foundation/NSURL/NSURLProtectionSpace.h @@ -28,15 +28,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithHost: (NSString *) host - port: (int) port - protocol: (NSString *) protocol - realm: (NSString *) realm - authenticationMethod: (NSString *) authenticationMethod; + port: (int) port + protocol: (NSString *) protocol + realm: (NSString *) realm + authenticationMethod: (NSString *) authenticationMethod; - initWithProxyHost: (NSString *) host - port: (int) port - protocol: (NSString *) protocol - realm: (NSString *) realm - authenticationMethod: (NSString *) authenticationMethod; + port: (int) port + protocol: (NSString *) protocol + realm: (NSString *) realm + authenticationMethod: (NSString *) authenticationMethod; - (NSString *) host; - (int) port; diff --git a/Foundation/NSURL/NSURLProtectionSpace.m b/Foundation/NSURL/NSURLProtectionSpace.m index 676bfb6d..9e3c0908 100644 --- a/Foundation/NSURL/NSURLProtectionSpace.m +++ b/Foundation/NSURL/NSURLProtectionSpace.m @@ -22,10 +22,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSURLProtectionSpace - initWithHost: (NSString *) host - port: (int) port - protocol: (NSString *) protocol - realm: (NSString *) realm - authenticationMethod: (NSString *) authenticationMethod + port: (int) port + protocol: (NSString *) protocol + realm: (NSString *) realm + authenticationMethod: (NSString *) authenticationMethod { _host = [host copy]; _port = port; @@ -37,10 +37,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithProxyHost: (NSString *) host - port: (int) port - protocol: (NSString *) protocol - realm: (NSString *) realm - authenticationMethod: (NSString *) authenticationMethod + port: (int) port + protocol: (NSString *) protocol + realm: (NSString *) realm + authenticationMethod: (NSString *) authenticationMethod { _host = [host copy]; _port = port; diff --git a/Foundation/NSURL/NSURLProtocol.h b/Foundation/NSURL/NSURLProtocol.h index 0e41201e..11780825 100644 --- a/Foundation/NSURL/NSURLProtocol.h +++ b/Foundation/NSURL/NSURLProtocol.h @@ -20,27 +20,27 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSURLProtocol, NSURLRequest, NSURLResponse, NSURLAuthenticationChallenge, - NSCachedURLResponse, NSData, NSError, NSMutableURLRequest; + NSCachedURLResponse, NSData, NSError, NSMutableURLRequest; @protocol NSURLProtocolClient - (void) URLProtocol: (NSURLProtocol *) urlProtocol - wasRedirectedToRequest: (NSURLRequest *) request - redirectResponse: (NSURLResponse *) redirect; + wasRedirectedToRequest: (NSURLRequest *) request + redirectResponse: (NSURLResponse *) redirect; - (void) URLProtocol: (NSURLProtocol *) urlProtocol - didReceiveAuthenticationChallenge: - (NSURLAuthenticationChallenge *) challenge; + didReceiveAuthenticationChallenge: + (NSURLAuthenticationChallenge *) challenge; - (void) URLProtocol: (NSURLProtocol *) urlProtocol - didCancelAuthenticationChallenge: - (NSURLAuthenticationChallenge *) challenge; + didCancelAuthenticationChallenge: + (NSURLAuthenticationChallenge *) challenge; - (void) URLProtocol: (NSURLProtocol *) urlProtocol - didReceiveResponse: (NSURLResponse *) response - cacheStoragePolicy: (NSURLCacheStoragePolicy) policy; + didReceiveResponse: (NSURLResponse *) response + cacheStoragePolicy: (NSURLCacheStoragePolicy) policy; - (void) URLProtocol: (NSURLProtocol *) urlProtocol - cachedResponseIsValid: (NSCachedURLResponse *) response; + cachedResponseIsValid: (NSCachedURLResponse *) response; - (void) URLProtocol: (NSURLProtocol *) urlProtocol didLoadData: (NSData *) data; - (void) URLProtocol: (NSURLProtocol *) urlProtocol - didFailWithError: (NSError *) error; + didFailWithError: (NSError *) error; - (void) URLProtocolDidFinishLoading: (NSURLProtocol *) urlProtocol; @end @@ -66,8 +66,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ toRequest: (NSURLRequest *) other; - initWithRequest: (NSURLRequest *) request - cachedResponse: (NSCachedURLResponse *) response - client: (id) client; + cachedResponse: (NSCachedURLResponse *) response + client: (id) client; - (NSURLRequest *) request; - (NSCachedURLResponse *) cachedResponse; diff --git a/Foundation/NSURL/NSURLProtocol.m b/Foundation/NSURL/NSURLProtocol.m index f0323518..4839bd23 100644 --- a/Foundation/NSURL/NSURLProtocol.m +++ b/Foundation/NSURL/NSURLProtocol.m @@ -94,8 +94,8 @@ static NSMutableArray *_registeredClasses = nil; } - initWithRequest: (NSURLRequest *) request - cachedResponse: (NSCachedURLResponse *) response - client: (id) client + cachedResponse: (NSCachedURLResponse *) response + client: (id) client { _request = [request retain]; _cachedResponse = [response retain]; diff --git a/Foundation/NSURL/NSURLProtocol_http.h b/Foundation/NSURL/NSURLProtocol_http.h index 8e5c8002..b4a1301a 100644 --- a/Foundation/NSURL/NSURLProtocol_http.h +++ b/Foundation/NSURL/NSURLProtocol_http.h @@ -21,7 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSInputStream, NSOutputStream, NSMutableData, NSMutableDictionary, - NSMutableArray, NSTimer; + NSMutableArray, NSTimer; @interface NSURLProtocol_http : NSURLProtocol { NSMutableArray *_modes; diff --git a/Foundation/NSURL/NSURLProtocol_http.m b/Foundation/NSURL/NSURLProtocol_http.m index d7009ac7..091d7194 100644 --- a/Foundation/NSURL/NSURLProtocol_http.m +++ b/Foundation/NSURL/NSURLProtocol_http.m @@ -63,8 +63,8 @@ enum { @interface NSHTTPURLResponse (private) - initWithURL: (NSURL *) url - statusCode: (NSInteger) statusCode - headers: (NSDictionary *) headers; + statusCode: (NSInteger) statusCode + headers: (NSDictionary *) headers; @end @implementation NSURLProtocol_http @@ -81,9 +81,9 @@ enum { if (_statusCode >= 200 && _statusCode < 300) { NSURL *url = [_request URL]; NSHTTPURLResponse *response = - [[[NSHTTPURLResponse alloc] initWithURL: url - statusCode: _statusCode - headers: headers] autorelease]; + [[[NSHTTPURLResponse alloc] initWithURL: url + statusCode: _statusCode + headers: headers] autorelease]; NSURLCacheStoragePolicy cachePolicy = NSURLCacheStorageNotAllowed; if ([[_request HTTPMethod] isEqualToString: @"GET"]) { @@ -94,22 +94,22 @@ enum { } [_client URLProtocol: self - didReceiveResponse: response - cacheStoragePolicy: cachePolicy]; + didReceiveResponse: response + cacheStoragePolicy: cachePolicy]; } else if (_statusCode == 304) { [_client URLProtocol: self cachedResponseIsValid: _cachedResponse]; [_client URLProtocol: self - didReceiveResponse: [_cachedResponse response] - cacheStoragePolicy: NSURLCacheStorageNotAllowed]; + didReceiveResponse: [_cachedResponse response] + cacheStoragePolicy: NSURLCacheStorageNotAllowed]; [_client URLProtocol: self didLoadData: [_cachedResponse data]]; } else { NSDictionary *userInfo = [NSDictionary - dictionaryWithObject: - [NSString - stringWithFormat: @"HTTP status code = %d", _statusCode] - forKey: NSLocalizedDescriptionKey]; + dictionaryWithObject: + [NSString stringWithFormat: @"HTTP status code = %d", + _statusCode] + forKey: NSLocalizedDescriptionKey]; NSError *error = [NSError errorWithDomain: NSURLErrorDomain code: NSURLErrorBadServerResponse @@ -147,19 +147,19 @@ enum { - (void) _headerKey { [_currentKey autorelease]; _currentKey = - [[NSString alloc] initWithCString: (char *) _bytes + _range.location - length: _range.length]; + [[NSString alloc] initWithCString: (char *) _bytes + _range.location + length: _range.length]; } - (void) _headerValue { NSString *value = - [NSString stringWithCString: (char *) _bytes + _range.location - length: _range.length - 1]; + [NSString stringWithCString: (char *) _bytes + _range.location + length: _range.length - 1]; NSString *oldValue; NSString *normalized = [self normalizedHeaderWithName: _currentKey]; if ((oldValue = [_headers objectForKey: normalized]) != nil) value = [[oldValue stringByAppendingString: @" "] - stringByAppendingString: value]; + stringByAppendingString: value]; [_rawHeaders setObject: value forKey: _currentKey]; [_headers setObject: value forKey: normalized]; @@ -167,13 +167,13 @@ enum { - (void) _continuation { NSString *value = - [NSString stringWithCString: (char *) _bytes + _range.location - length: _range.length - 1]; + [NSString stringWithCString: (char *) _bytes + _range.location + length: _range.length - 1]; NSString *normalized = [self normalizedHeaderWithName: _currentKey]; NSString *oldValue = [_headers objectForKey: normalized]; value = [[oldValue stringByAppendingString: @" "] - stringByAppendingString: value]; + stringByAppendingString: value]; [_rawHeaders setObject: value forKey: _currentKey]; [_headers setObject: value forKey: normalized]; @@ -241,17 +241,21 @@ enum { case STATE_waitingForStatusVersion: if (code == ' ') { [self statusVersion: [NSString - stringWithCString: (char *) _bytes + - _range.location - length: _range.length - 1]]; + stringWithCString: (char *) + _bytes + + _range.location + length: _range.length - + 1]]; rangeAction = advanceLocationToNext; _state = STATE_waitingForStatusCode; _statusCode = 0; } else if (code == '\015') { [self statusVersion: [NSString - stringWithCString: (char *) _bytes + - _range.location - length: _range.length - 1]]; + stringWithCString: (char *) + _bytes + + _range.location + length: _range.length - + 1]]; _state = STATE_waitingForStatusLF; } break; @@ -397,9 +401,9 @@ enum { if (code == '\015') NSLog(@"got cr"); NSLog(@"chunk done"); - [self - didLoadData: [NSData dataWithBytes: _bytes + _range.location - length: _range.length]]; + [self didLoadData: [NSData dataWithBytes: _bytes + + _range.location + length: _range.length]]; _range.location = NSMaxRange(_range); _range.length = 0; } @@ -458,13 +462,13 @@ enum { NSString *host = [url host]; NSMutableString *string = [NSMutableString string]; - [string - appendFormat: @"%@ %@ HTTP/1.1\015\012", [_request HTTPMethod], path]; + [string appendFormat: @"%@ %@ HTTP/1.1\015\012", [_request HTTPMethod], + path]; [string appendFormat: @"Host: %@\015\012", host]; [string appendFormat: @"Accept: */*\015\012"]; NSMutableDictionary *headers = - [[[_request allHTTPHeaderFields] mutableCopy] autorelease]; + [[[_request allHTTPHeaderFields] mutableCopy] autorelease]; NSEnumerator *state = [headers keyEnumerator]; NSString *key; @@ -488,7 +492,7 @@ enum { if (_cachedResponse != nil) { NSHTTPURLResponse *response = - (NSHTTPURLResponse *) [_cachedResponse response]; + (NSHTTPURLResponse *) [_cachedResponse response]; NSDictionary *headers = [response allHeaderFields]; NSString *lastModified = nil; NSString *etag = nil; @@ -502,8 +506,8 @@ enum { } if (lastModified != nil) - [string - appendFormat: @"If-Modified-Since: %@\015\012", lastModified]; + [string appendFormat: @"If-Modified-Since: %@\015\012", + lastModified]; if (etag != nil) [string appendFormat: @"If-None-Match: %@\015\012", etag]; @@ -551,8 +555,8 @@ enum { - (void) timeout: (NSTimer *) timer { NSDictionary *userInfo = - [NSDictionary dictionaryWithObject: @"Connection timed out" - forKey: NSLocalizedDescriptionKey]; + [NSDictionary dictionaryWithObject: @"Connection timed out" + forKey: NSLocalizedDescriptionKey]; NSError *error = [NSError errorWithDomain: NSURLErrorDomain code: NSURLErrorTimedOut userInfo: userInfo]; @@ -617,8 +621,8 @@ enum { length = MIN(length, 256); NSData *dump = [NSData dataWithBytes: buffer length: length]; NSString *str = [[[NSString alloc] - initWithData: dump - encoding: NSUTF8StringEncoding] autorelease]; + initWithData: dump + encoding: NSUTF8StringEncoding] autorelease]; NSLog(@"sent: %@ ...", str); #endif } @@ -643,8 +647,8 @@ enum { return NO; } - initWithRequest: (NSURLRequest *) request - cachedResponse: (NSCachedURLResponse *) response - client: (id) client + cachedResponse: (NSCachedURLResponse *) response + client: (id) client { [super initWithRequest: request cachedResponse: response client: client]; diff --git a/Foundation/NSURL/NSURLRequest.h b/Foundation/NSURL/NSURLRequest.h index 85ce7178..33c2cfd3 100644 --- a/Foundation/NSURL/NSURLRequest.h +++ b/Foundation/NSURL/NSURLRequest.h @@ -41,13 +41,13 @@ typedef enum { - initWithURL: (NSURL *) url; - initWithURL: (NSURL *) url - cachePolicy: (NSURLRequestCachePolicy) cachePolicy - timeoutInterval: (NSTimeInterval) timeout; + cachePolicy: (NSURLRequestCachePolicy) cachePolicy + timeoutInterval: (NSTimeInterval) timeout; + requestWithURL: (NSURL *) url; + requestWithURL: (NSURL *) url - cachePolicy: (NSURLRequestCachePolicy) cachePolicy - timeoutInterval: (NSTimeInterval) timeout; + cachePolicy: (NSURLRequestCachePolicy) cachePolicy + timeoutInterval: (NSTimeInterval) timeout; - (NSURL *) URL; - (NSURLRequestCachePolicy) cachePolicy; diff --git a/Foundation/NSURL/NSURLRequest.m b/Foundation/NSURL/NSURLRequest.m index 303fdae1..b41a8fa4 100644 --- a/Foundation/NSURL/NSURLRequest.m +++ b/Foundation/NSURL/NSURLRequest.m @@ -51,8 +51,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithURL: (NSURL *) url - cachePolicy: (NSURLRequestCachePolicy) cachePolicy - timeoutInterval: (NSTimeInterval) timeout + cachePolicy: (NSURLRequestCachePolicy) cachePolicy + timeoutInterval: (NSTimeInterval) timeout { _url = [url copy]; _cachePolicy = cachePolicy; @@ -81,8 +81,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + requestWithURL: (NSURL *) url - cachePolicy: (NSURLRequestCachePolicy) cachePolicy - timeoutInterval: (NSTimeInterval) timeout + cachePolicy: (NSURLRequestCachePolicy) cachePolicy + timeoutInterval: (NSTimeInterval) timeout { return [[[self alloc] initWithURL: url cachePolicy: cachePolicy @@ -147,7 +147,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: @"<%@ %x: url=%@>", [self class], self, _url]; + stringWithFormat: @"<%@ %x: url=%@>", [self class], self, _url]; } @end diff --git a/Foundation/NSURL/NSURLResponse.h b/Foundation/NSURL/NSURLResponse.h index d9d70d0a..41856f92 100644 --- a/Foundation/NSURL/NSURLResponse.h +++ b/Foundation/NSURL/NSURLResponse.h @@ -28,9 +28,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithURL: (NSURL *) url - MIMEType: (NSString *) mimeType - expectedContentLength: (NSInteger) expectedLength - textEncodingName: (NSString *) encoding; + MIMEType: (NSString *) mimeType + expectedContentLength: (NSInteger) expectedLength + textEncodingName: (NSString *) encoding; - (NSURL *) URL; - (NSString *) MIMEType; diff --git a/Foundation/NSURL/NSURLResponse.m b/Foundation/NSURL/NSURLResponse.m index b26757c9..de912178 100644 --- a/Foundation/NSURL/NSURLResponse.m +++ b/Foundation/NSURL/NSURLResponse.m @@ -23,9 +23,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation NSURLResponse - initWithURL: (NSURL *) url - MIMEType: (NSString *) mimeType - expectedContentLength: (NSInteger) expectedLength - textEncodingName: (NSString *) encoding + MIMEType: (NSString *) mimeType + expectedContentLength: (NSInteger) expectedLength + textEncodingName: (NSString *) encoding { _url = [url retain]; _mimeType = [mimeType retain]; diff --git a/Foundation/NSUnarchiver.m b/Foundation/NSUnarchiver.m index 67285945..6afd3a1d 100644 --- a/Foundation/NSUnarchiver.m +++ b/Foundation/NSUnarchiver.m @@ -226,9 +226,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (strcmp(checkType, type) != 0) [NSException - raise: @"NSUnarchiverTypeMismatchException" - format: @"NSUnarchiver type mismatch decoding %s, contains %s", - type, checkType]; + raise: @"NSUnarchiverTypeMismatchException" + format: @"NSUnarchiver type mismatch decoding %s, contains %s", + type, checkType]; switch (*type) { case 'c': @@ -276,7 +276,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSString *string = [self _extractCStringString]; *cString = - NSZoneMalloc(NSDefaultMallocZone(), [string cStringLength] + 1); + NSZoneMalloc(NSDefaultMallocZone(), [string cStringLength] + 1); [string getCString: *cString]; } break; @@ -393,8 +393,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _version = [self _extractWordFour]; if (_version > 0) [NSException - raise: @"NSUnarchiverInvalidVersionException" - format: @"NSUnarchiver cannot unarchive version %d", _version]; + raise: @"NSUnarchiverInvalidVersionException" + format: @"NSUnarchiver cannot unarchive version %d", _version]; return NO; } @@ -411,10 +411,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSNonRetainedObjectMapValueCallBacks, 0); _classes = NSCreateMapTable(NSIntMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 0); - _cStrings = - NSCreateMapTable(NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, 0); - _classVersions = - NSCreateMapTable(NSObjectMapKeyCallBacks, NSIntMapValueCallBacks, 0); + _cStrings = NSCreateMapTable(NSIntMapKeyCallBacks, + NSObjectMapValueCallBacks, 0); + _classVersions = NSCreateMapTable(NSObjectMapKeyCallBacks, + NSIntMapValueCallBacks, 0); _allObjects = [NSMutableArray new]; @@ -437,7 +437,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (id) unarchiveObjectWithData: (NSData *) data { NSUnarchiver *unarchiver = [[[NSUnarchiver allocWithZone: NULL] - initForReadingWithData: data] autorelease]; + initForReadingWithData: data] autorelease]; return [unarchiver decodeObject]; } @@ -450,7 +450,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return nil; unarchiver = [[[NSUnarchiver allocWithZone: NULL] - initForReadingWithData: data] autorelease]; + initForReadingWithData: data] autorelease]; return [unarchiver decodeObject]; } diff --git a/Foundation/NSUndoManager/NSUndoGroup.m b/Foundation/NSUndoManager/NSUndoGroup.m index cc3b63d6..d0816c87 100644 --- a/Foundation/NSUndoManager/NSUndoGroup.m +++ b/Foundation/NSUndoManager/NSUndoGroup.m @@ -77,9 +77,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: @"<%@[0x%lx] parentGroup: %@, %d invocations>", - [self class], self, _parentGroup, - [_invocations count]]; + stringWithFormat: @"<%@[0x%lx] parentGroup: %@, %d invocations>", + [self class], self, _parentGroup, + [_invocations count]]; } @end diff --git a/Foundation/NSUndoManager/NSUndoManager.m b/Foundation/NSUndoManager/NSUndoManager.m index 7e5e926a..7b19d507 100644 --- a/Foundation/NSUndoManager/NSUndoManager.m +++ b/Foundation/NSUndoManager/NSUndoManager.m @@ -33,19 +33,19 @@ enum _NSUndoManagerState { }; NSString *const NSUndoManagerCheckpointNotification = - @"NSUndoManagerCheckpointNotification"; + @"NSUndoManagerCheckpointNotification"; NSString *const NSUndoManagerDidOpenUndoGroupNotification = - @"NSUndoManagerDidOpenUndoGroupNotification"; + @"NSUndoManagerDidOpenUndoGroupNotification"; NSString *const NSUndoManagerWillCloseUndoGroupNotification = - @"NSUndoManagerWillCloseUndoGroupNotification"; + @"NSUndoManagerWillCloseUndoGroupNotification"; NSString *const NSUndoManagerWillUndoChangeNotification = - @"NSUndoManagerWillUndoChangeNotification"; + @"NSUndoManagerWillUndoChangeNotification"; NSString *const NSUndoManagerDidUndoChangeNotification = - @"NSUndoManagerDidUndoChangeNotification"; + @"NSUndoManagerDidUndoChangeNotification"; NSString *const NSUndoManagerWillRedoChangeNotification = - @"NSUndoManagerWillRedoChangeNotification"; + @"NSUndoManagerWillRedoChangeNotification"; NSString *const NSUndoManagerDidRedoChangeNotification = - @"NSUndoManagerDidRedoChangeNotification"; + @"NSUndoManagerDidRedoChangeNotification"; @implementation NSUndoManager @@ -53,11 +53,11 @@ NSString *const NSUndoManagerDidRedoChangeNotification = if (!_performRegistered) { _performRegistered = YES; [[NSRunLoop currentRunLoop] - performSelector: @selector(runLoopUndo:) - target: self - argument: nil - order: NSUndoCloseGroupingRunLoopOrdering - modes: _modes]; + performSelector: @selector(runLoopUndo:) + target: self + argument: nil + order: NSUndoCloseGroupingRunLoopOrdering + modes: _modes]; } } @@ -65,9 +65,9 @@ NSString *const NSUndoManagerDidRedoChangeNotification = if (_performRegistered) { _performRegistered = NO; [[NSRunLoop currentRunLoop] - cancelPerformSelector: @selector(runLoopUndo:) - target: self - argument: nil]; + cancelPerformSelector: @selector(runLoopUndo:) + target: self + argument: nil]; } } @@ -150,19 +150,19 @@ NSString *const NSUndoManagerDidRedoChangeNotification = - (void) beginUndoGrouping { NSUndoGroup *undoGroup = - [NSUndoGroup undoGroupWithParentGroup: _currentGroup]; + [NSUndoGroup undoGroupWithParentGroup: _currentGroup]; if (!([_currentGroup parentGroup] == nil && _state == NSUndoManagerUndoing)) [[NSNotificationCenter defaultCenter] - postNotificationName: NSUndoManagerCheckpointNotification - object: self]; + postNotificationName: NSUndoManagerCheckpointNotification + object: self]; [_currentGroup release]; _currentGroup = [undoGroup retain]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSUndoManagerDidOpenUndoGroupNotification - object: self]; + postNotificationName: NSUndoManagerDidOpenUndoGroupNotification + object: self]; } - (void) endUndoGrouping { @@ -175,16 +175,16 @@ NSString *const NSUndoManagerDidRedoChangeNotification = @"beginUndoGrouping"]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSUndoManagerCheckpointNotification - object: self]; + postNotificationName: NSUndoManagerCheckpointNotification + object: self]; if (parentGroup == nil && [[_currentGroup invocations] count] > 0) { switch (_state) { case NSUndoManagerNormal: [[NSNotificationCenter defaultCenter] - postNotificationName: - NSUndoManagerWillCloseUndoGroupNotification - object: self]; + postNotificationName: + NSUndoManagerWillCloseUndoGroupNotification + object: self]; case NSUndoManagerRedoing: stack = _undoStack; @@ -245,12 +245,12 @@ NSString *const NSUndoManagerDidRedoChangeNotification = format: @"undo called with open nested group"]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSUndoManagerCheckpointNotification - object: self]; + postNotificationName: NSUndoManagerCheckpointNotification + object: self]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSUndoManagerWillUndoChangeNotification - object: self]; + postNotificationName: NSUndoManagerWillUndoChangeNotification + object: self]; _state = NSUndoManagerUndoing; undoGroup = [[_undoStack lastObject] retain]; @@ -262,8 +262,8 @@ NSString *const NSUndoManagerDidRedoChangeNotification = _state = NSUndoManagerNormal; [[NSNotificationCenter defaultCenter] - postNotificationName: NSUndoManagerDidUndoChangeNotification - object: self]; + postNotificationName: NSUndoManagerDidUndoChangeNotification + object: self]; } - (void) undo { @@ -279,8 +279,8 @@ NSString *const NSUndoManagerDidRedoChangeNotification = - (BOOL) canRedo { [[NSNotificationCenter defaultCenter] - postNotificationName: NSUndoManagerCheckpointNotification - object: self]; + postNotificationName: NSUndoManagerCheckpointNotification + object: self]; return ([_redoStack count] > 0); } @@ -292,12 +292,12 @@ NSString *const NSUndoManagerDidRedoChangeNotification = format: @"redo called while undoing"]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSUndoManagerCheckpointNotification - object: self]; + postNotificationName: NSUndoManagerCheckpointNotification + object: self]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSUndoManagerWillRedoChangeNotification - object: self]; + postNotificationName: NSUndoManagerWillRedoChangeNotification + object: self]; _state = NSUndoManagerRedoing; undoGroup = [[_redoStack lastObject] retain]; @@ -309,8 +309,8 @@ NSString *const NSUndoManagerDidRedoChangeNotification = _state = NSUndoManagerNormal; [[NSNotificationCenter defaultCenter] - postNotificationName: NSUndoManagerDidRedoChangeNotification - object: self]; + postNotificationName: NSUndoManagerDidRedoChangeNotification + object: self]; } - (BOOL) isRedoing { @@ -394,10 +394,9 @@ NSString *const NSUndoManagerDidRedoChangeNotification = return; if (_preparedTarget == nil) - [NSException - raise: NSInternalInconsistencyException - format: - @"forwardInvocation called without first preparing a target"]; + [NSException raise: NSInternalInconsistencyException + format: @"forwardInvocation called without first preparing " + @"a target"]; if (_groupsByEvent && _currentGroup == nil) { [self _registerPerform]; diff --git a/Foundation/NSUserDefaults/NSUserDefaults.m b/Foundation/NSUserDefaults/NSUserDefaults.m index 7ef8b527..273cd48f 100644 --- a/Foundation/NSUserDefaults/NSUserDefaults.m +++ b/Foundation/NSUserDefaults/NSUserDefaults.m @@ -46,7 +46,7 @@ NSString *const NSShortWeekDayNameArray = @"NSShortWeekDayNameArray"; NSString *const NSShortMonthNameArray = @"NSShortMonthNameArray"; NSString *const NSUserDefaultsDidChangeNotification = - @"NSUserDefaultsDidChangeNotification"; + @"NSUserDefaultsDidChangeNotification"; @implementation NSUserDefaults @@ -73,7 +73,7 @@ NSString *const NSUserDefaultsDidChangeNotification = pval = val; NS_ENDHANDLER - [reg setObject: pval forKey: key]; + [reg setObject: pval forKey: key]; } [_domains setObject: reg forKey: NSArgumentDomain]; @@ -81,8 +81,8 @@ NSString *const NSUserDefaultsDidChangeNotification = - (void) registerFoundationDefaults { NSString *path = [[NSBundle bundleForClass: [self class]] - pathForResource: @"NSUserDefaults" - ofType: @"plist"]; + pathForResource: @"NSUserDefaults" + ofType: @"plist"]; NSDictionary *plist = [NSDictionary dictionaryWithContentsOfFile: path]; if (plist == nil) @@ -90,7 +90,7 @@ NSString *const NSUserDefaultsDidChangeNotification = "path=%s, bundle at %s", path == nil ? "" : [path UTF8String], [[[NSBundle bundleForClass: [self class]] resourcePath] - UTF8String]); + UTF8String]); else [_domains setObject: plist forKey: @"Foundation"]; } @@ -111,11 +111,11 @@ NSString *const NSUserDefaultsDidChangeNotification = if (name == nil) name = [NSString - stringWithFormat: @"noid.%@", - [[NSProcessInfo processInfo] processName]]; + stringWithFormat: @"noid.%@", + [[NSProcessInfo processInfo] processName]]; domain = [[[NSPlatform currentPlatform] persistantDomainClass] - persistantDomainWithName: name]; + persistantDomainWithName: name]; [_domains setObject: domain forKey: [[NSProcessInfo processInfo] processName]]; @@ -125,10 +125,10 @@ NSString *const NSUserDefaultsDidChangeNotification = - init { _domains = [NSMutableDictionary new]; _searchList = [[NSArray allocWithZone: NULL] - initWithObjects: NSArgumentDomain, - [[NSProcessInfo processInfo] processName], - NSGlobalDomain, NSRegistrationDomain, @"Foundation", - nil]; + initWithObjects: NSArgumentDomain, + [[NSProcessInfo processInfo] processName], + NSGlobalDomain, NSRegistrationDomain, + @"Foundation", nil]; [[NSProcessInfo processInfo] environment]; @@ -194,7 +194,7 @@ static NSUserDefaults *stdUserDefaults = nil; for (i = 0; i < count; i++) { NSDictionary *domain = - [_domains objectForKey: [_searchList objectAtIndex: i]]; + [_domains objectForKey: [_searchList objectAtIndex: i]]; NSEnumerator *state = [domain keyEnumerator]; id key; @@ -225,7 +225,7 @@ static NSUserDefaults *stdUserDefaults = nil; - (void) registerDefaults: (NSDictionary *) values { @synchronized(self) { [[_domains objectForKey: NSRegistrationDomain] - addEntriesFromDictionary: values]; + addEntriesFromDictionary: values]; } } @@ -246,7 +246,7 @@ static NSUserDefaults *stdUserDefaults = nil; - (NSDictionary *) persistentDomainForName: (NSString *) name { NSMutableDictionary *result = [NSMutableDictionary dictionary]; NSPersistantDomain *domain = [[[NSPlatform currentPlatform] - persistantDomainClass] persistantDomainWithName: name]; + persistantDomainClass] persistantDomainWithName: name]; NSArray *allKeys = [domain allKeys]; NSInteger i, count = [allKeys count]; @@ -286,8 +286,8 @@ static NSUserDefaults *stdUserDefaults = nil; - (NSMutableDictionary *) persistantDomain { NSMutableDictionary *dict = nil; @synchronized(self) { - dict = - [_domains objectForKey: [[NSProcessInfo processInfo] processName]]; + dict = [_domains + objectForKey: [[NSProcessInfo processInfo] processName]]; [[dict retain] autorelease]; } return dict; @@ -299,7 +299,7 @@ static NSUserDefaults *stdUserDefaults = nil; for (i = 0; i < count; i++) { NSDictionary *domain = - [_domains objectForKey: [_searchList objectAtIndex: i]]; + [_domains objectForKey: [_searchList objectAtIndex: i]]; id object = [domain objectForKey: defaultName]; if (object != nil) @@ -320,8 +320,8 @@ static NSUserDefaults *stdUserDefaults = nil; NSString *string = [self objectForKey: defaultName]; return [string isKindOfClass: objc_lookUpClass("NSString")] - ? string - : (NSString *) nil; + ? string + : (NSString *) nil; } - (NSArray *) arrayForKey: (NSString *) defaultName { @@ -335,8 +335,8 @@ static NSUserDefaults *stdUserDefaults = nil; NSDictionary *dictionary = [self objectForKey: defaultName]; return [dictionary isKindOfClass: objc_lookUpClass("NSDictionary")] - ? dictionary - : (NSDictionary *) nil; + ? dictionary + : (NSDictionary *) nil; } - (NSArray *) stringArrayForKey: (NSString *) defaultName { @@ -349,7 +349,7 @@ static NSUserDefaults *stdUserDefaults = nil; count = [array count]; while (--count >= 0) if (![[array objectAtIndex: count] - isKindOfClass: objc_lookUpClass("NSString")]) + isKindOfClass: objc_lookUpClass("NSString")]) return nil; return array; @@ -369,30 +369,30 @@ static NSUserDefaults *stdUserDefaults = nil; id number = [self objectForKey: defaultName]; return [number isKindOfClass: objc_lookUpClass("NSString")] - ? [(NSString *) number intValue] - : ([number isKindOfClass: objc_lookUpClass("NSNumber")] - ? [(NSNumber *) number intValue] - : 0); + ? [(NSString *) number intValue] + : ([number isKindOfClass: objc_lookUpClass("NSNumber")] + ? [(NSNumber *) number intValue] + : 0); } - (float) floatForKey: (NSString *) defaultName { id number = [self objectForKey: defaultName]; return [number isKindOfClass: objc_lookUpClass("NSString")] - ? [(NSString *) number floatValue] - : ([number isKindOfClass: objc_lookUpClass("NSNumber")] - ? [(NSNumber *) number floatValue] - : 0.0); + ? [(NSString *) number floatValue] + : ([number isKindOfClass: objc_lookUpClass("NSNumber")] + ? [(NSNumber *) number floatValue] + : 0.0); } - (double) doubleForKey: (NSString *) defaultName { id number = [self objectForKey: defaultName]; return [number isKindOfClass: objc_lookUpClass("NSString")] - ? [(NSString *) number doubleValue] - : ([number isKindOfClass: objc_lookUpClass("NSNumber")] - ? [(NSNumber *) number doubleValue] - : 0.0); + ? [(NSString *) number doubleValue] + : ([number isKindOfClass: objc_lookUpClass("NSNumber")] + ? [(NSNumber *) number doubleValue] + : 0.0); } - (void) setObject: value forKey: (NSString *) key { @@ -401,7 +401,7 @@ static NSUserDefaults *stdUserDefaults = nil; // the registered one Cocoa does that - even if the method documentation // says nothing about it if ([value isEqual: [[_domains objectForKey: NSRegistrationDomain] - objectForKey: key]]) { + objectForKey: key]]) { value = nil; } if (value) { @@ -413,8 +413,8 @@ static NSUserDefaults *stdUserDefaults = nil; _dictionaryRep = nil; [[NSNotificationCenter defaultCenter] - postNotificationName: NSUserDefaultsDidChangeNotification - object: self]; + postNotificationName: NSUserDefaultsDidChangeNotification + object: self]; } } @@ -439,8 +439,8 @@ static NSUserDefaults *stdUserDefaults = nil; [[self persistantDomain] removeObjectForKey: key]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSUserDefaultsDidChangeNotification - object: self]; + postNotificationName: NSUserDefaultsDidChangeNotification + object: self]; } } diff --git a/Foundation/NSValue/NSValue.m b/Foundation/NSValue/NSValue.m index 9b25983f..3463a051 100644 --- a/Foundation/NSValue/NSValue.m +++ b/Foundation/NSValue/NSValue.m @@ -62,12 +62,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (NSValue *) valueWithNonretainedObject: object { return [[[NSValue_nonRetainedObject allocWithZone: NULL] - initWithObject: object] autorelease]; + initWithObject: object] autorelease]; } + (NSValue *) valueWithPointer: (const void *) pointer { return [[[NSValue_pointer allocWithZone: NULL] initWithPointer: pointer] - autorelease]; + autorelease]; } + (NSValue *) valueWithPoint: (NSPoint) point { @@ -195,7 +195,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (id) description { - return [NSString - stringWithFormat: @"<%@, %s>", [super description], [self objCType]]; + return [NSString stringWithFormat: @"<%@, %s>", [super description], + [self objCType]]; } @end diff --git a/Foundation/NSValueTransformer/NSValueTransformer.m b/Foundation/NSValueTransformer/NSValueTransformer.m index 841b73f3..44f34bcc 100644 --- a/Foundation/NSValueTransformer/NSValueTransformer.m +++ b/Foundation/NSValueTransformer/NSValueTransformer.m @@ -32,7 +32,7 @@ NSString *const NSIsNotNilTransformerName = @"NSIsNotNil"; NSString *const NSNegateBooleanTransformerName = @"NSNegateBoolean"; NSString *const NSUnarchiveFromDataTransformerName = @"NSUnarchiveFromData"; NSString *const NSKeyedUnarchiveFromDataTransformerName = - @"NSKeyedUnarchiveFromData"; + @"NSKeyedUnarchiveFromData"; @implementation NSValueTransformer @@ -47,14 +47,14 @@ static NSMapTable *_nameToTransformer = NULL; NSMapInsert(_nameToTransformer, NSIsNotNilTransformerName, [[[NSValueTransformer_IsNotNil alloc] init] autorelease]); NSMapInsert( - _nameToTransformer, NSNegateBooleanTransformerName, - [[[NSValueTransformer_NegateBoolean alloc] init] autorelease]); - NSMapInsert( - _nameToTransformer, NSUnarchiveFromDataTransformerName, - [[[NSValueTransformer_UnarchiveFromData alloc] init] autorelease]); + _nameToTransformer, NSNegateBooleanTransformerName, + [[[NSValueTransformer_NegateBoolean alloc] init] autorelease]); + NSMapInsert(_nameToTransformer, NSUnarchiveFromDataTransformerName, + [[[NSValueTransformer_UnarchiveFromData alloc] init] + autorelease]); NSMapInsert(_nameToTransformer, NSKeyedUnarchiveFromDataTransformerName, [[[NSValueTransformer_KeyedUnarchiveFromData alloc] init] - autorelease]); + autorelease]); } } diff --git a/Foundation/NSZone/NSZone.m b/Foundation/NSZone/NSZone.m index f33d89e6..310866b6 100644 --- a/Foundation/NSZone/NSZone.m +++ b/Foundation/NSZone/NSZone.m @@ -48,8 +48,8 @@ NSUInteger NSExtraRefCount(id object) { BOOL NSShouldRetainWithZone(id object, NSZone *zone) { return (zone == NULL || zone == NSDefaultMallocZone() || zone == [object zone]) - ? YES - : NO; + ? YES + : NO; } static void (*__NSAllocateObjectHook)(id object) = 0; diff --git a/Foundation/platform_darwin/NSPlatform_darwin.m b/Foundation/platform_darwin/NSPlatform_darwin.m index d14049f3..c3b112d5 100644 --- a/Foundation/platform_darwin/NSPlatform_darwin.m +++ b/Foundation/platform_darwin/NSPlatform_darwin.m @@ -122,26 +122,28 @@ NSString *const NSPlatformLoadableObjectFilePrefix = @""; if (operatingSystemVersionString == NULL) { NSDictionary *operatingSystemVersionDictionary = [NSDictionary - dictionaryWithContentsOfFile: - @"/System/Library/CoreServices/SystemVersion.plist"]; - if (operatingSystemVersionDictionary == NULL) { - operatingSystemVersionDictionary = [NSDictionary dictionaryWithContentsOfFile: - @"/System/Library/CoreServices/ServerVersion.plist"]; + @"/System/Library/CoreServices/SystemVersion.plist"]; + if (operatingSystemVersionDictionary == NULL) { + operatingSystemVersionDictionary = + [NSDictionary dictionaryWithContentsOfFile: + @"/System/Library/CoreServices/" + @"ServerVersion.plist"]; } if (operatingSystemVersionDictionary != NULL) { operatingSystemVersionString = [[NSString alloc] - initWithFormat: @"Version %@ (Build %@)", - [operatingSystemVersionDictionary + initWithFormat: + @"Version %@ (Build %@)", + [operatingSystemVersionDictionary objectForKey: @"ProductVersion"], - [operatingSystemVersionDictionary + [operatingSystemVersionDictionary objectForKey: @"ProductBuildVersion"]]; } else { operatingSystemVersionString = [[NSString alloc] - initWithFormat: @"%@ Version %@ (Build %@)", - stringSysctlByName("kern.ostype"), - stringSysctlByName("kern.osrelease"), - stringSysctlByName("kern.osversion")]; + initWithFormat: @"%@ Version %@ (Build %@)", + stringSysctlByName("kern.ostype"), + stringSysctlByName("kern.osrelease"), + stringSysctlByName("kern.osversion")]; } } diff --git a/Foundation/platform_posix/NSConditionLock_posix.m b/Foundation/platform_posix/NSConditionLock_posix.m index 945aa2ba..63ab02da 100644 --- a/Foundation/platform_posix/NSConditionLock_posix.m +++ b/Foundation/platform_posix/NSConditionLock_posix.m @@ -109,8 +109,8 @@ int r; if ((r = pthread_mutex_unlock(&_mutex)) != 0) { [NSException - raise: NSInvalidArgumentException - format: @"failed to unlock %@ (errno: %d)", self, r]; + raise: NSInvalidArgumentException + format: @"failed to unlock %@ (errno: %d)", self, r]; } [NSException raise: NSInvalidArgumentException format: @"failed to lock %@ (errno: %d)", self, rc]; @@ -210,16 +210,16 @@ case ETIMEDOUT: if ((rc = pthread_mutex_unlock(&_mutex)) != 0) { [NSException - raise: NSInvalidArgumentException - format: @"failed to unlock %@ (errno: %d)", self, rc]; + raise: NSInvalidArgumentException + format: @"failed to unlock %@ (errno: %d)", self, rc]; } return NO; default: { int r; if ((r = pthread_mutex_unlock(&_mutex)) != 0) { [NSException - raise: NSInvalidArgumentException - format: @"failed to unlock %@ (errno: %d)", self, r]; + raise: NSInvalidArgumentException + format: @"failed to unlock %@ (errno: %d)", self, r]; } [NSException raise: NSInvalidArgumentException format: @"failed to lock %@ before date %@ (errno: %d)", diff --git a/Foundation/platform_posix/NSFileHandle_posix.m b/Foundation/platform_posix/NSFileHandle_posix.m index c09ab8f2..e935b79b 100644 --- a/Foundation/platform_posix/NSFileHandle_posix.m +++ b/Foundation/platform_posix/NSFileHandle_posix.m @@ -77,8 +77,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static int descriptorForPath(NSString *path, int modes) { NSDictionary *fileAttributes = - [[NSFileManager defaultManager] fileAttributesAtPath: path - traverseLink: YES]; + [[NSFileManager defaultManager] fileAttributesAtPath: path + traverseLink: YES]; if (fileAttributes == nil) return -1; @@ -114,8 +114,8 @@ static int descriptorForPath(NSString *path, int modes) { if (fd == -1) return nil; - return - [[[self allocWithZone: NULL] initWithFileDescriptor: fd] autorelease]; + return [[[self allocWithZone: NULL] initWithFileDescriptor: fd] + autorelease]; } + fileHandleForWritingAtPath: (NSString *) path { @@ -124,8 +124,8 @@ static int descriptorForPath(NSString *path, int modes) { if (fd == -1) return nil; - return - [[[self allocWithZone: NULL] initWithFileDescriptor: fd] autorelease]; + return [[[self allocWithZone: NULL] initWithFileDescriptor: fd] + autorelease]; } + fileHandleForUpdatingAtPath: (NSString *) path { @@ -134,8 +134,8 @@ static int descriptorForPath(NSString *path, int modes) { if (fd == -1) return nil; - return - [[[self allocWithZone: NULL] initWithFileDescriptor: fd] autorelease]; + return [[[self allocWithZone: NULL] initWithFileDescriptor: fd] + autorelease]; } + fileHandleWithNullDevice { @@ -143,21 +143,21 @@ static int descriptorForPath(NSString *path, int modes) { } + fileHandleWithStandardInput { - return - [[[self allocWithZone: NULL] initWithFileDescriptor: STDIN_FILENO - closeOnDealloc: NO] autorelease]; + return [[[self allocWithZone: NULL] initWithFileDescriptor: STDIN_FILENO + closeOnDealloc: NO] + autorelease]; } + fileHandleWithStandardOutput { - return - [[[self allocWithZone: NULL] initWithFileDescriptor: STDOUT_FILENO - closeOnDealloc: NO] autorelease]; + return [[[self allocWithZone: NULL] initWithFileDescriptor: STDOUT_FILENO + closeOnDealloc: NO] + autorelease]; } + fileHandleWithStandardError { - return - [[[self allocWithZone: NULL] initWithFileDescriptor: STDERR_FILENO - closeOnDealloc: NO] autorelease]; + return [[[self allocWithZone: NULL] initWithFileDescriptor: STDERR_FILENO + closeOnDealloc: NO] + autorelease]; } /* @@ -328,10 +328,10 @@ CONFORMING TO // it [self setNonBlocking: YES]; if (count > 0) { - count = - read(_fileDescriptor, - &((char *) [mutableData mutableBytes])[length + 1], - 4096 - 1); + count = read( + _fileDescriptor, + &((char *) [mutableData mutableBytes])[length + 1], + 4096 - 1); if (count > 0) { count += 1; } else { @@ -387,8 +387,8 @@ CONFORMING TO for (i = 0; i < count; ++i) [[NSRunLoop currentRunLoop] - removeInputSource: _inputSource - forMode: [_backgroundModes objectAtIndex: i]]; + removeInputSource: _inputSource + forMode: [_backgroundModes objectAtIndex: i]]; // we never actually retain the monitor, the run loop does--so we don't need // to release it. @@ -401,13 +401,13 @@ CONFORMING TO NSInteger i, count = [modes count]; if (_inputSource != nil) - [NSException - raise: NSInternalInconsistencyException - format: @"%@ already has background activity", [self description]]; + [NSException raise: NSInternalInconsistencyException + format: @"%@ already has background activity", + [self description]]; _inputSource = [NSSelectInputSource - socketInputSourceWithSocket: - [NSSocket_bsd socketWithDescriptor: _fileDescriptor]]; + socketInputSourceWithSocket: + [NSSocket_bsd socketWithDescriptor: _fileDescriptor]]; [_inputSource setSelectEventMask: NSSelectReadEvent]; [_inputSource setDelegate: self]; _backgroundModes = [modes retain]; @@ -428,8 +428,8 @@ CONFORMING TO accept(_fileDescriptor, (struct sockaddr *) &addr, &len); NSNotification *note = [NSNotification - notificationWithName: NSFileHandleConnectionAcceptedNotification - object: self]; + notificationWithName: NSFileHandleConnectionAcceptedNotification + object: self]; [[NSNotificationCenter defaultCenter] postNotification: note]; [pool drain]; @@ -451,13 +451,13 @@ CONFORMING TO [self cancelBackgroundMonitoring]; - userInfo = - [NSDictionary dictionaryWithObject: availableData - forKey: NSFileHandleNotificationDataItem]; + userInfo = [NSDictionary + dictionaryWithObject: availableData + forKey: NSFileHandleNotificationDataItem]; note = [NSNotification - notificationWithName: NSFileHandleReadCompletionNotification - object: self - userInfo: userInfo]; + notificationWithName: NSFileHandleReadCompletionNotification + object: self + userInfo: userInfo]; [[NSNotificationCenter defaultCenter] postNotification: note]; } diff --git a/Foundation/platform_posix/NSFileManager_posix.m b/Foundation/platform_posix/NSFileManager_posix.m index 9fb48e11..3026b379 100644 --- a/Foundation/platform_posix/NSFileManager_posix.m +++ b/Foundation/platform_posix/NSFileManager_posix.m @@ -146,14 +146,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ operation: (NSString *) op { if ([handler respondsToSelector: @selector(fileManager: - shouldProceedAfterError:)]) { + shouldProceedAfterError:)]) { NSDictionary *errorInfo = [NSDictionary - dictionaryWithObjectsAndKeys: src, @"Path", - [NSString - stringWithFormat: @"%@: %s", op, - strerror( - errno)], - @"Error", dest, @"ToPath", nil]; + dictionaryWithObjectsAndKeys: + src, @"Path", + [NSString stringWithFormat: @"%@: %s", op, + strerror(errno)], + @"Error", dest, @"ToPath", nil]; if ([handler fileManager: self shouldProceedAfterError: errorInfo]) return YES; diff --git a/Foundation/platform_posix/NSPersistantDomain_posix.m b/Foundation/platform_posix/NSPersistantDomain_posix.m index 95bdf6ea..ce6cd0c8 100644 --- a/Foundation/platform_posix/NSPersistantDomain_posix.m +++ b/Foundation/platform_posix/NSPersistantDomain_posix.m @@ -37,7 +37,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _path = [[_path stringByAppendingPathExtension: @"plist"] retain]; serializedDictionary = - [NSPropertyListReader dictionaryWithContentsOfFile: _path]; + [NSPropertyListReader dictionaryWithContentsOfFile: _path]; if (serializedDictionary != nil) _mutableDomain = [serializedDictionary mutableCopy]; else @@ -86,7 +86,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ for (i = 0; i < count; i++) { // leave the error checking up to -synchronize check = [check - stringByAppendingPathComponent: [components objectAtIndex: i]]; + stringByAppendingPathComponent: [components objectAtIndex: i]]; if (i > 0 && ![[NSFileManager defaultManager] fileExistsAtPath: check isDirectory: &isDirectory]) { diff --git a/Foundation/platform_posix/NSPipe_posix.m b/Foundation/platform_posix/NSPipe_posix.m index fde16731..a17889fd 100644 --- a/Foundation/platform_posix/NSPipe_posix.m +++ b/Foundation/platform_posix/NSPipe_posix.m @@ -35,9 +35,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @"pipe() failed: %s", strerror(errno)); _fileHandleForReading = - [[NSFileHandle_posix alloc] initWithFileDescriptor: fds[0]]; + [[NSFileHandle_posix alloc] initWithFileDescriptor: fds[0]]; _fileHandleForWriting = - [[NSFileHandle_posix alloc] initWithFileDescriptor: fds[1]]; + [[NSFileHandle_posix alloc] initWithFileDescriptor: fds[1]]; return self; } @@ -51,12 +51,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSString *) description { return [NSString - stringWithFormat: @"<%@[0x%lx] readfd: %d writefd: %d>", - [[self class] description], self, - [(NSFileHandle_posix *) - _fileHandleForReading fileDescriptor], - [(NSFileHandle_posix *) - _fileHandleForWriting fileDescriptor]]; + stringWithFormat: @"<%@[0x%lx] readfd: %d writefd: %d>", + [[self class] description], self, + [(NSFileHandle_posix *) _fileHandleForReading + fileDescriptor], + [(NSFileHandle_posix *) _fileHandleForWriting + fileDescriptor]]; } - (NSFileHandle *) fileHandleForReading { diff --git a/Foundation/platform_posix/NSPlatform_posix.m b/Foundation/platform_posix/NSPlatform_posix.m index b284b83f..bb8f5ffd 100644 --- a/Foundation/platform_posix/NSPlatform_posix.m +++ b/Foundation/platform_posix/NSPlatform_posix.m @@ -129,7 +129,7 @@ static struct passwd *pwent = NULL; - (NSString *) libraryDirectory { return [[self homeDirectory] - stringByAppendingPathComponent: @".CocotronLibrary"]; + stringByAppendingPathComponent: @".CocotronLibrary"]; } - (NSString *) temporaryDirectory { diff --git a/Foundation/platform_posix/NSRecursiveLock_posix.m b/Foundation/platform_posix/NSRecursiveLock_posix.m index f368e244..1b8da9b2 100644 --- a/Foundation/platform_posix/NSRecursiveLock_posix.m +++ b/Foundation/platform_posix/NSRecursiveLock_posix.m @@ -56,9 +56,9 @@ [_lock unlock]; } } else - NSCLog( - "tried to unlock lock 0x%x owned by thread 0x%x from thread 0x%x", - self, _lockingThread, [NSThread currentThread]); + NSCLog("tried to unlock lock 0x%x owned by thread 0x%x from thread " + "0x%x", + self, _lockingThread, [NSThread currentThread]); } - (BOOL) tryLock { @@ -93,9 +93,9 @@ } - (id) description { - return - [NSString stringWithFormat: @"(%@, name %@, locked %i times", - [super description], _name, _numberOfLocks]; + return [NSString stringWithFormat: @"(%@, name %@, locked %i times", + [super description], _name, + _numberOfLocks]; } @end #endif diff --git a/Foundation/platform_posix/NSSelectSet_bsd.m b/Foundation/platform_posix/NSSelectSet_bsd.m index fbef2232..e610c66c 100644 --- a/Foundation/platform_posix/NSSelectSet_bsd.m +++ b/Foundation/platform_posix/NSSelectSet_bsd.m @@ -54,7 +54,7 @@ native_set *native_set_new(int max) { while (result->max < max) result->max *= 2; result->fdset = - NSZoneCalloc(NULL, 1, sizeof(fd_mask) * (result->max / NFDBITS)); + NSZoneCalloc(NULL, 1, sizeof(fd_mask) * (result->max / NFDBITS)); return result; } @@ -70,7 +70,7 @@ void native_set_clear(native_set *set, int descriptor) { [descriptor / NFDBITS] &= ~(1 << (descriptor % NFDBITS)); #else set->fdset->fds_bits[descriptor / NFDBITS] &= - ~(1 << (descriptor % NFDBITS)); + ~(1 << (descriptor % NFDBITS)); #endif } @@ -101,13 +101,13 @@ BOOL native_set_is_set(native_set *native, int descriptor) { #ifdef LINUX return (__FDS_BITS(native->fdset)[descriptor / NFDBITS] & (1 << (descriptor % NFDBITS))) - ? YES - : NO; + ? YES + : NO; #else return (native->fdset->fds_bits[descriptor / NFDBITS] & (1 << (descriptor % NFDBITS))) - ? YES - : NO; + ? YES + : NO; #endif } @@ -172,7 +172,7 @@ static void transferNativeToSetWithOriginals(native_set *sset, NSError *result = nil; NSSocket_bsd *cheater = [NSSocket_bsd socketWithDescriptor: -1]; int maxDescriptor = - maxDescriptorInThreeSets(_readSet, _writeSet, _exceptionSet); + maxDescriptorInThreeSets(_readSet, _writeSet, _exceptionSet); native_set *activeRead = native_set_new(maxDescriptor); native_set *activeWrite = native_set_new(maxDescriptor); native_set *activeExcept = native_set_new(maxDescriptor); @@ -221,14 +221,15 @@ static void transferNativeToSetWithOriginals(native_set *sset, if (result == nil) { NSSelectSet_bsd *outputSet = - (NSSelectSet_bsd *) [[[NSSelectSet alloc] init] autorelease]; + (NSSelectSet_bsd *) [[[NSSelectSet alloc] init] autorelease]; if (numFds) { transferNativeToSetWithOriginals(activeRead, outputSet->_readSet, _readSet, cheater); transferNativeToSetWithOriginals(activeWrite, outputSet->_writeSet, _writeSet, cheater); - transferNativeToSetWithOriginals( - activeExcept, outputSet->_exceptionSet, _exceptionSet, cheater); + transferNativeToSetWithOriginals(activeExcept, + outputSet->_exceptionSet, + _exceptionSet, cheater); } *outputSetX = outputSet; } diff --git a/Foundation/platform_posix/NSSocket_bsd.m b/Foundation/platform_posix/NSSocket_bsd.m index 7f8c965d..43401e9a 100644 --- a/Foundation/platform_posix/NSSocket_bsd.m +++ b/Foundation/platform_posix/NSSocket_bsd.m @@ -84,8 +84,8 @@ static inline void byteZero(void *vsrc, size_t size) { - initTCPStream { NSError *error = [self - errorForReturnValue: _descriptor = - socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)]; + errorForReturnValue: _descriptor = socket(PF_INET, SOCK_STREAM, + IPPROTO_TCP)]; if (error != nil) { [self dealloc]; return nil; @@ -94,9 +94,9 @@ static inline void byteZero(void *vsrc, size_t size) { } - initUDPStream { - NSError *error = [self - errorForReturnValue: _descriptor = - socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)]; + NSError *error = + [self errorForReturnValue: _descriptor = socket(PF_INET, SOCK_DGRAM, + IPPROTO_UDP)]; if (error != nil) { [self dealloc]; return nil; @@ -112,8 +112,8 @@ static inline void byteZero(void *vsrc, size_t size) { - initConnectedToSocket: (NSSocket **) otherX { int pipes[2]; if (pipe(pipes)) { - *otherX = - [[[[self class] alloc] initWithDescriptor: pipes[0]] autorelease]; + *otherX = [[[[self class] alloc] initWithDescriptor: pipes[0]] + autorelease]; return [self initWithDescriptor: pipes[1]]; } else { NSLog(@"NSSocket: could not create pipe: (%d) %s", errno, @@ -252,14 +252,14 @@ static inline void byteZero(void *vsrc, size_t size) { int newSocket; NSError *error; - error = [self - errorForReturnValue: newSocket = accept(_descriptor, &addr, &addrlen)]; + error = [self errorForReturnValue: newSocket = accept(_descriptor, &addr, + &addrlen)]; if (errorp != NULL) *errorp = error; return (error != nil) ? nil : [[[NSSocket_bsd alloc] - initWithDescriptor: newSocket] autorelease]; + initWithDescriptor: newSocket] autorelease]; } - (CFSSLHandler *) sslHandler { @@ -269,7 +269,8 @@ static inline void byteZero(void *vsrc, size_t size) { @end NSData *NSSocketAddressDataForNetworkOrderAddressBytesAndPort( - const void *address, NSUInteger length, uint16_t port, uint32_t interface) + const void *address, NSUInteger length, uint16_t port, + uint32_t interface) { return nil; } diff --git a/Foundation/platform_posix/NSString_defaultEncoding_posix.m b/Foundation/platform_posix/NSString_defaultEncoding_posix.m index 962a3342..d92f8678 100644 --- a/Foundation/platform_posix/NSString_defaultEncoding_posix.m +++ b/Foundation/platform_posix/NSString_defaultEncoding_posix.m @@ -89,7 +89,7 @@ NSStringEncoding defaultEncoding() { if (defaultEncoding == -1) { // set the default to ASCII defaultEncoding = - NSISOLatin1StringEncoding; // FIXME: should be utf8? + NSISOLatin1StringEncoding; // FIXME: should be utf8? } } diff --git a/Foundation/platform_posix/NSTask_posix.m b/Foundation/platform_posix/NSTask_posix.m index b3328405..3dd7cd82 100644 --- a/Foundation/platform_posix/NSTask_posix.m +++ b/Foundation/platform_posix/NSTask_posix.m @@ -75,11 +75,11 @@ void waitForTaskChildProcess() { [task taskFinished]; [[NSNotificationCenter defaultCenter] - postNotification: - [NSNotification - notificationWithName: - NSTaskDidTerminateNotification - object: task]]; + postNotification: + [NSNotification + notificationWithName: + NSTaskDidTerminateNotification + object: task]]; [task release]; } } @@ -170,8 +170,8 @@ void childSignalHandler(int sig) { if ([standardInput isKindOfClass: [NSFileHandle class]]) { fd = [(NSFileHandle_posix *) standardInput fileDescriptor]; } else { - fd = - [(NSFileHandle_posix *) [standardInput fileHandleForReading] + fd = [(NSFileHandle_posix *) + [standardInput fileHandleForReading] fileDescriptor]; } dup2(fd, STDIN_FILENO); @@ -185,9 +185,9 @@ void childSignalHandler(int sig) { if ([standardOutput isKindOfClass: [NSFileHandle class]]) { fd = [(NSFileHandle_posix *) standardOutput fileDescriptor]; } else { - fd = [( - NSFileHandle_posix *) [standardOutput fileHandleForWriting] - fileDescriptor]; + fd = [(NSFileHandle_posix *) + [standardOutput fileHandleForWriting] + fileDescriptor]; } dup2(fd, STDOUT_FILENO); } else { @@ -200,8 +200,8 @@ void childSignalHandler(int sig) { if ([standardError isKindOfClass: [NSFileHandle class]]) { fd = [(NSFileHandle_posix *) standardError fileDescriptor]; } else { - fd = - [(NSFileHandle_posix *) [standardError fileHandleForWriting] + fd = [(NSFileHandle_posix *) + [standardError fileHandleForWriting] fileDescriptor]; } dup2(fd, STDERR_FILENO); diff --git a/Foundation/platform_posix/NSTimeZone_posix.h b/Foundation/platform_posix/NSTimeZone_posix.h index 6cf4925a..b55c7af4 100644 --- a/Foundation/platform_posix/NSTimeZone_posix.h +++ b/Foundation/platform_posix/NSTimeZone_posix.h @@ -26,9 +26,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // interface for providing alternate time zone data sources... - initWithName: (NSString *) name - data: (NSData *) data - transitions: (NSArray *) transitions - types: (NSArray *) types; + data: (NSData *) data + transitions: (NSArray *) transitions + types: (NSArray *) types; + (NSString *) _zoneinfoPath; diff --git a/Foundation/platform_posix/NSTimeZone_posix.m b/Foundation/platform_posix/NSTimeZone_posix.m index aa1a4b11..9cab329b 100644 --- a/Foundation/platform_posix/NSTimeZone_posix.m +++ b/Foundation/platform_posix/NSTimeZone_posix.m @@ -119,14 +119,16 @@ NSInteger sortTransitions(id trans1, id trans2, void *context) { typeIndices = tzData + (numberOfTransitionTimes * 4); for (i = 0; i < numberOfTransitionTimes; ++i) { - NSDate *d1 = - [NSDate dateWithTimeIntervalSince1970: NSSwapBigIntToHost( + NSDate *d1 = [NSDate + dateWithTimeIntervalSince1970: NSSwapBigIntToHost( ((int *) tzData)[i])]; [transitions - addObject: - [NSTimeZoneTransition - timeZoneTransitionWithTransitionDate: d1 - typeIndex: typeIndices[i]]]; + addObject: + [NSTimeZoneTransition + timeZoneTransitionWithTransitionDate: d1 + typeIndex: + typeIndices + [i]]]; } // sort date array @@ -139,21 +141,22 @@ NSInteger sortTransitions(id trans1, id trans2, void *context) { abbreviations = tzTypesBytes + numberOfLocalTimes * sizeof(struct tzType); for (i = 0; i < numberOfLocalTimes; ++i) { tzTypes = (struct tzType *) tzTypesBytes; - NSString *abb = - [NSString stringWithCString: abbreviations + tzTypes->abbrevIndex]; + NSString *abb = [NSString + stringWithCString: abbreviations + tzTypes->abbrevIndex]; if (name == nil) { name = abb; } - [types - addObject: [NSTimeZoneType - timeZoneTypeWithSecondsFromGMT: NSSwapBigIntToHost( - tzTypes->offset) - isDaylightSavingTime: tzTypes->isDST - abbreviation: - [NSString stringWithCString: - abbreviations + - tzTypes-> - abbrevIndex]]]; + [types addObject: + [NSTimeZoneType + timeZoneTypeWithSecondsFromGMT: + NSSwapBigIntToHost(tzTypes->offset) + isDaylightSavingTime: tzTypes->isDST + abbreviation: + [NSString + stringWithCString: + abbreviations + + tzTypes-> + abbrevIndex]]]; tzTypesBytes += sizeof(struct tzType); } @@ -164,9 +167,9 @@ NSInteger sortTransitions(id trans1, id trans2, void *context) { } - initWithName: (NSString *) name - data: (NSData *) data - transitions: (NSArray *) transitions - types: (NSArray *) types + data: (NSData *) data + transitions: (NSArray *) transitions + types: (NSArray *) types { _name = [name retain]; _data = [data retain]; @@ -201,25 +204,25 @@ NSInteger sortTransitions(id trans1, id trans2, void *context) { YES) { NSError *error; NSString *path = [[NSFileManager defaultManager] - destinationOfSymbolicLinkAtPath: @"/etc/localtime" - error: &error]; + destinationOfSymbolicLinkAtPath: @"/etc/localtime" + error: &error]; if (path != nil) { // localtime is a symlink timeZoneName = [path - stringByReplacingOccurrencesOfString: - [NSString - stringWithFormat: @"%@/", - [NSTimeZone_posix _zoneinfoPath]] - withString: @""]; + stringByReplacingOccurrencesOfString: + [NSString stringWithFormat: @"%@/", + [NSTimeZone_posix + _zoneinfoPath]] + withString: @""]; systemTimeZone = [self timeZoneWithName: timeZoneName]; } else { // localtime is a file systemTimeZone = [[[NSTimeZone alloc] - initWithName: nil - data: [NSData - dataWithContentsOfFile: @"/etc/localtime"]] - autorelease]; + initWithName: nil + data: [NSData dataWithContentsOfFile: + @"/etc/localtime"]] + autorelease]; } } @@ -229,8 +232,8 @@ NSInteger sortTransitions(id trans1, id trans2, void *context) { if (envTimeZoneName != NULL) { systemTimeZone = [self - timeZoneWithName: [NSString - stringWithCString: envTimeZoneName]]; + timeZoneWithName: + [NSString stringWithCString: envTimeZoneName]]; } } @@ -256,7 +259,7 @@ NSInteger sortTransitions(id trans1, id trans2, void *context) { NSCLog("TimeZone [%s] not instantiable -> using absolute " "timezone (no daylight saving)", [[[self abbreviationDictionary] - objectForKey: abbreviation] cString]); + objectForKey: abbreviation] cString]); } systemTimeZone = [NSTimeZone timeZoneForSecondsFromGMT: timezone]; @@ -270,10 +273,10 @@ NSInteger sortTransitions(id trans1, id trans2, void *context) { - (NSTimeZoneType *) timeZoneTypeForDate: (NSDate *) date { if ([_timeZoneTransitions count] == 0 || [date compare: [[_timeZoneTransitions objectAtIndex: 0] - transitionDate]] == NSOrderedAscending) { + transitionDate]] == NSOrderedAscending) { NSEnumerator *timeZoneTypeEnumerator = - [_timeZoneTypes objectEnumerator]; + [_timeZoneTypes objectEnumerator]; NSTimeZoneType *type; while ((type = [timeZoneTypeEnumerator nextObject]) != nil) { @@ -284,7 +287,7 @@ NSInteger sortTransitions(id trans1, id trans2, void *context) { return [_timeZoneTypes objectAtIndex: 0]; } else { NSEnumerator *timeZoneTransitionEnumerator = - [_timeZoneTransitions objectEnumerator]; + [_timeZoneTransitions objectEnumerator]; NSTimeZoneTransition *transition, *previousTransition = nil; while ((transition = [timeZoneTransitionEnumerator nextObject]) != @@ -294,7 +297,7 @@ NSInteger sortTransitions(id trans1, id trans2, void *context) { previousTransition = transition; } else return [_timeZoneTypes - objectAtIndex: [previousTransition typeIndex]]; + objectAtIndex: [previousTransition typeIndex]]; } return [_timeZoneTypes lastObject]; @@ -321,12 +324,12 @@ NSInteger sortTransitions(id trans1, id trans2, void *context) { - (NSString *) description { return [NSString - stringWithFormat: @"<%@[0x%lx] name: %@ secondsFromGMT: %d " - @"isDaylightSavingTime: %@ abbreviation: %@>", - [self class], self, [self name], - [self secondsFromGMT], - [self isDaylightSavingTime] ? @"YES" : @"NO", - [self abbreviation]]; + stringWithFormat: @"<%@[0x%lx] name: %@ secondsFromGMT: %d " + @"isDaylightSavingTime: %@ abbreviation: %@>", + [self class], self, [self name], + [self secondsFromGMT], + [self isDaylightSavingTime] ? @"YES" : @"NO", + [self abbreviation]]; } - copyWithZone: (NSZone *) zone { diff --git a/Foundation/platform_windows/NSCondition_win32.m b/Foundation/platform_windows/NSCondition_win32.m index ae8bc779..d34dc8e3 100644 --- a/Foundation/platform_windows/NSCondition_win32.m +++ b/Foundation/platform_windows/NSCondition_win32.m @@ -67,8 +67,8 @@ NSCooperativeThreadWaiting(); LONG newWaitersCount = InterlockedDecrement(&waitersCount); - BOOL lastWaiter = - (result == WAIT_OBJECT_0 + Event_Broadcast) && (0 == newWaitersCount); + BOOL lastWaiter = (result == WAIT_OBJECT_0 + Event_Broadcast) && + (0 == newWaitersCount); if (lastWaiter) ResetEvent(events[Event_Broadcast]); diff --git a/Foundation/platform_windows/NSFileHandle_win32.m b/Foundation/platform_windows/NSFileHandle_win32.m index e29a04d5..c076e83b 100644 --- a/Foundation/platform_windows/NSFileHandle_win32.m +++ b/Foundation/platform_windows/NSFileHandle_win32.m @@ -63,8 +63,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + fileHandleForReadingAtPath: (NSString *) path { HANDLE handle = - CreateFileW([path fileSystemRepresentationW], GENERIC_READ, 0, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + CreateFileW([path fileSystemRepresentationW], GENERIC_READ, 0, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (handle == NULL) return nil; @@ -75,8 +75,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + fileHandleForWritingAtPath: (NSString *) path { HANDLE handle = - CreateFileW([path fileSystemRepresentationW], GENERIC_WRITE, 0, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + CreateFileW([path fileSystemRepresentationW], GENERIC_WRITE, 0, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (handle == NULL) return nil; @@ -104,20 +104,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + fileHandleWithStandardInput { return [[[self allocWithZone: NULL] - initWithHandle: GetStdHandle(STD_INPUT_HANDLE) - closeOnDealloc: NO] autorelease]; + initWithHandle: GetStdHandle(STD_INPUT_HANDLE) + closeOnDealloc: NO] autorelease]; } + fileHandleWithStandardOutput { return [[[self allocWithZone: NULL] - initWithHandle: GetStdHandle(STD_OUTPUT_HANDLE) - closeOnDealloc: NO] autorelease]; + initWithHandle: GetStdHandle(STD_OUTPUT_HANDLE) + closeOnDealloc: NO] autorelease]; } + fileHandleWithStandardError { return [[[self allocWithZone: NULL] - initWithHandle: GetStdHandle(STD_ERROR_HANDLE) - closeOnDealloc: NO] autorelease]; + initWithHandle: GetStdHandle(STD_ERROR_HANDLE) + closeOnDealloc: NO] autorelease]; } - (HANDLE) fileHandle { @@ -142,7 +142,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ li.QuadPart = 0; li.LowPart = - SetFilePointer(_handle, li.LowPart, &li.HighPart, FILE_CURRENT); + SetFilePointer(_handle, li.LowPart, &li.HighPart, FILE_CURRENT); if (li.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) [NSException raise: NSInvalidArgumentException @@ -195,9 +195,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ DWORD error; LPVOID lpMsgBuf; - while ( - GetLastError() != ERROR_BROKEN_PIPE && - ReadFile(_handle, [result mutableBytes] + sum, B, &readLength, NULL)) { + while (GetLastError() != ERROR_BROKEN_PIPE && + ReadFile(_handle, [result mutableBytes] + sum, B, &readLength, + NULL)) { //[result appendBytes:buffer length:readLength]; sum += readLength; [result increaseLengthBy: B]; @@ -208,8 +208,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ error = GetLastError(); if (error != ERROR_BROKEN_PIPE) { FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); NSRaiseException(NSFileHandleOperationException, self, _cmd, @@ -236,8 +236,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ break; } else { FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); @@ -281,13 +281,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSDictionary *userInfo; NSNotification *note; - userInfo = - [NSDictionary dictionaryWithObject: data - forKey: NSFileHandleNotificationDataItem]; + userInfo = [NSDictionary + dictionaryWithObject: data + forKey: NSFileHandleNotificationDataItem]; note = [NSNotification - notificationWithName: NSFileHandleReadCompletionNotification - object: self - userInfo: userInfo]; + notificationWithName: NSFileHandleReadCompletionNotification + object: self + userInfo: userInfo]; [_background detach]; _background = nil; @@ -301,8 +301,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ format: @"file handle has background activity already"]; _background = - [NSReadInBackground_win32 readInBackgroundWithFileHandle: self - modes: modes]; + [NSReadInBackground_win32 readInBackgroundWithFileHandle: self + modes: modes]; } @end diff --git a/Foundation/platform_windows/NSFileManager_win32.m b/Foundation/platform_windows/NSFileManager_win32.m index ffa9ab47..9993e998 100644 --- a/Foundation/platform_windows/NSFileManager_win32.m +++ b/Foundation/platform_windows/NSFileManager_win32.m @@ -54,7 +54,7 @@ static int CopyDirectoryW(CONST WCHAR *cszFrom, CONST WCHAR *cszTo) { swprintf(cszDirectoryFindPattern, L"\\\\?\\%s\\*", cszFrom); if ((hFindFile = - FindFirstFileW(cszDirectoryFindPattern, &FindFileData)) != + FindFirstFileW(cszDirectoryFindPattern, &FindFileData)) != INVALID_HANDLE_VALUE) { do { if (*FindFileData.cFileName == '.') @@ -119,7 +119,7 @@ static NSString *DriveLetterInPath(NSString *path) { NSArray *components = [path componentsSeparatedByString: @":"]; if ([components count] > 0) { NSString *driveLetter = [NSString - stringWithFormat: @"%@:\\", [components objectAtIndex: 0]]; + stringWithFormat: @"%@:\\", [components objectAtIndex: 0]]; return driveLetter; } return nil; @@ -127,11 +127,11 @@ static NSString *DriveLetterInPath(NSString *path) { static NSError *NSErrorForGetLastErrorCode(DWORD code) { NSString *localizedDescription = - @"NSErrorForGetLastError localizedDescription"; + @"NSErrorForGetLastError localizedDescription"; unichar *message; FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR) &message, 0, NULL); localizedDescription = NSStringFromNullTerminatedUnicode(message); @@ -139,11 +139,12 @@ static NSError *NSErrorForGetLastErrorCode(DWORD code) { LocalFree(message); return [NSError - errorWithDomain: NSWin32ErrorDomain - code: code - userInfo: [NSDictionary - dictionaryWithObject: localizedDescription - forKey: NSLocalizedDescriptionKey]]; + errorWithDomain: NSWin32ErrorDomain + code: code + userInfo: + [NSDictionary + dictionaryWithObject: localizedDescription + forKey: NSLocalizedDescriptionKey]]; } static NSError *NSErrorForGetLastError() { @@ -203,8 +204,8 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { return MoveFileW([fromPath fileSystemRepresentationW], [toPath fileSystemRepresentationW]) - ? YES - : NO; + ? YES + : NO; } - (BOOL) movePath: (NSString *) src toPath: (NSString *) dest handler: handler { @@ -240,9 +241,9 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { if ([self fileExistsAtPath: toPath] == YES) { if (error != NULL) { - NSDictionary *userInfo = - [NSDictionary dictionaryWithObject: @"File exists" - forKey: NSLocalizedDescriptionKey]; + NSDictionary *userInfo = [NSDictionary + dictionaryWithObject: @"File exists" + forKey: NSLocalizedDescriptionKey]; *error = [NSError errorWithDomain: NSPOSIXErrorDomain code: 17 @@ -258,10 +259,10 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { [toPath fileSystemRepresentationW])) { if (error != NULL) { NSString *msg = [NSString - stringWithFormat: @"Copy error (%d)", GetLastError()]; + stringWithFormat: @"Copy error (%d)", GetLastError()]; NSDictionary *userInfo = [NSDictionary - dictionaryWithObject: msg - forKey: NSLocalizedDescriptionKey]; + dictionaryWithObject: msg + forKey: NSLocalizedDescriptionKey]; *error = [NSError errorWithDomain: NSPOSIXErrorDomain code: 17 userInfo: userInfo]; @@ -274,10 +275,10 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { [toPath fileSystemRepresentationW], YES)) { if (error != NULL) { NSString *msg = [NSString - stringWithFormat: @"Copy error (%d)", GetLastError()]; + stringWithFormat: @"Copy error (%d)", GetLastError()]; NSDictionary *userInfo = [NSDictionary - dictionaryWithObject: msg - forKey: NSLocalizedDescriptionKey]; + dictionaryWithObject: msg + forKey: NSLocalizedDescriptionKey]; *error = [NSError errorWithDomain: NSPOSIXErrorDomain code: 17 userInfo: userInfo]; @@ -355,10 +356,11 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { for (i = 0; i < count; i++) { NSString *fullPath = [path - stringByAppendingPathComponent: [contents objectAtIndex: i]]; + stringByAppendingPathComponent: [contents + objectAtIndex: i]]; if (_delegate != nil) { if (![_delegate fileManager: self - shouldRemoveItemAtPath: fullPath]) { + shouldRemoveItemAtPath: fullPath]) { if (error != NULL) *error = nil; // FIXME; is there a Cocoa error for the // delegate cancelling? @@ -395,9 +397,9 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { #pragma mark Creating an item - (BOOL) createDirectoryAtPath: (NSString *) path - withIntermediateDirectories: (BOOL) intermediates - attributes: (NSDictionary *) attributes - error: (NSError **) error + withIntermediateDirectories: (BOOL) intermediates + attributes: (NSDictionary *) attributes + error: (NSError **) error { if (intermediates) { NSArray *components = [path pathComponents]; @@ -406,7 +408,8 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { for (i = 0; i < count - 1; i++) { check = [check - stringByAppendingPathComponent: [components objectAtIndex: i]]; + stringByAppendingPathComponent: [components + objectAtIndex: i]]; // ignore errors on intermediates since we're not handling all // possible error codes. _NSCreateDirectory(check, NULL); @@ -498,11 +501,11 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { psl->lpVtbl->Release(psl); NSString *resolvedPath = - [NSString stringWithFormat: @"%S", pszFilePath]; + [NSString stringWithFormat: @"%S", pszFilePath]; // Mac-ify the path - resolvedPath = - [resolvedPath stringByReplacingOccurrencesOfString: @"\\" - withString: @"/"]; + resolvedPath = [resolvedPath + stringByReplacingOccurrencesOfString: @"\\" + withString: @"/"]; return resolvedPath; } else { NSLog(@"Unable to resolve link"); @@ -552,9 +555,9 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { return nil; } - handle = FindFirstFileW( - [[path stringByAppendingString: @"\\*.*"] fileSystemRepresentationW], - &findData); + handle = FindFirstFileW([[path stringByAppendingString: @"\\*.*"] + fileSystemRepresentationW], + &findData); if (handle == INVALID_HANDLE_VALUE) return nil; @@ -562,11 +565,10 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { do { if (wcscmp(findData.cFileName, L".") != 0 && wcscmp(findData.cFileName, L"..") != 0) - [result - addObject: [NSString - stringWithCharacters: findData.cFileName - length: wcslen( - findData.cFileName)]]; + [result addObject: + [NSString + stringWithCharacters: findData.cFileName + length: wcslen(findData.cFileName)]]; } while (FindNextFileW(handle, &findData)); FindClose(handle); @@ -583,9 +585,9 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { return nil; } - handle = FindFirstFileW( - [[path stringByAppendingString: @"\\*.*"] fileSystemRepresentationW], - &findData); + handle = FindFirstFileW([[path stringByAppendingString: @"\\*.*"] + fileSystemRepresentationW], + &findData); if (handle == INVALID_HANDLE_VALUE) return nil; @@ -593,11 +595,10 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { do { if (wcscmp(findData.cFileName, L".") != 0 && wcscmp(findData.cFileName, L"..") != 0) - [result - addObject: [NSString - stringWithCharacters: findData.cFileName - length: wcslen( - findData.cFileName)]]; + [result addObject: + [NSString + stringWithCharacters: findData.cFileName + length: wcslen(findData.cFileName)]]; } while (FindNextFileW(handle, &findData)); FindClose(handle); @@ -624,7 +625,7 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { } NSMutableDictionary *attrs = - [NSMutableDictionary dictionaryWithCapacity: 3]; + [NSMutableDictionary dictionaryWithCapacity: 3]; const uint16_t *wPath = [path fileSystemRepresentationW]; ULARGE_INTEGER freeBytesAvailable; @@ -634,13 +635,12 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { if (GetDiskFreeSpaceExW(wPath, &freeBytesAvailable, &totalNumberOfBytes, &totalNumberOfBytes) != 0) { - [attrs - setObject: [NSNumber numberWithUnsignedLongLong: freeBytesAvailable - .QuadPart] - forKey: NSFileSystemFreeSize]; [attrs setObject: [NSNumber - numberWithUnsignedLongLong: totalNumberOfFreeBytes - .QuadPart] + numberWithUnsignedLongLong: freeBytesAvailable + .QuadPart] + forKey: NSFileSystemFreeSize]; + [attrs setObject: [NSNumber numberWithUnsignedLongLong: + totalNumberOfFreeBytes.QuadPart] forKey: NSFileSystemSize]; } else { NSError *error = NSErrorForGetLastError(); @@ -694,8 +694,8 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { NSMutableDictionary *result = [NSMutableDictionary dictionary]; NSDate *date = [NSDate - dateWithTimeIntervalSinceReferenceDate: Win32TimeIntervalFromFileTime( - fileData.ftLastWriteTime)]; + dateWithTimeIntervalSinceReferenceDate: + Win32TimeIntervalFromFileTime(fileData.ftLastWriteTime)]; [result setObject: date forKey: NSFileModificationDate]; NSString *fileType = NSFileTypeRegular; @@ -715,23 +715,24 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { DWORD domainLen = 128; if (GetSecurityDescriptorOwner( - (SECURITY_DESCRIPTOR *) pSecurityDescriptor, &sid, - ((LPBOOL)(&lpbOwnerDefaulted))) != 0) { + (SECURITY_DESCRIPTOR *) pSecurityDescriptor, &sid, + ((LPBOOL)(&lpbOwnerDefaulted))) != 0) { if (LookupAccountSid(NULL, sid, lpName, &len, referencedDomainName, &domainLen, &nameUse) != 0) { - NSString *owner = - [[[NSString alloc] initWithCString: lpName] autorelease]; + NSString *owner = [[[NSString alloc] initWithCString: lpName] + autorelease]; if (referencedDomainName != NULL) { - [result - setObject: [NSString stringWithFormat: - @"%@\\%@", - [[[NSString alloc] - initWithCString: - referencedDomainName] - autorelease], - owner] - forKey: NSFileOwnerAccountName]; + [result setObject: + [NSString + stringWithFormat: + @"%@\\%@", + [[[NSString alloc] + initWithCString: + referencedDomainName] + autorelease], + owner] + forKey: NSFileOwnerAccountName]; } else { [result setObject: owner forKey: NSFileOwnerAccountName]; } @@ -823,7 +824,7 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { } DWORD attributes = - GetFileAttributesW([self fileSystemRepresentationWithPathW: path]); + GetFileAttributesW([self fileSystemRepresentationWithPathW: path]); if (attributes == 0xFFFFFFFF) return NO; @@ -903,7 +904,7 @@ static BOOL _NSCreateDirectory(NSString *path, NSError **errorp) { path = TranslatePath(path); return (const unichar *) [path - cStringUsingEncoding: NSUnicodeStringEncoding]; + cStringUsingEncoding: NSUnicodeStringEncoding]; } - (const char *) fileSystemRepresentationWithPath: (NSString *) path { diff --git a/Foundation/platform_windows/NSHandleMonitorSet_win32.m b/Foundation/platform_windows/NSHandleMonitorSet_win32.m index 1fa02a0d..3f66adfc 100644 --- a/Foundation/platform_windows/NSHandleMonitorSet_win32.m +++ b/Foundation/platform_windows/NSHandleMonitorSet_win32.m @@ -120,16 +120,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_eventInputSource != nil) { waitResult = - [_eventInputSource waitForEventsAndMultipleObjects: objectList - count: objectCount - milliseconds: msec]; + [_eventInputSource waitForEventsAndMultipleObjects: objectList + count: objectCount + milliseconds: msec]; } else { if (objectCount == 0) { Win32ThreadSleepForTimeInterval(interval); waitResult = WAIT_TIMEOUT; } else { - waitResult = - WaitForMultipleObjects(objectCount, objectList, FALSE, msec); + waitResult = WaitForMultipleObjects(objectCount, objectList, FALSE, + msec); } } @@ -145,7 +145,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (waitResult < WAIT_OBJECT_0 + objectCount)) { DWORD index = waitResult - WAIT_OBJECT_0; NSHandleMonitor_win32 *result = - [self monitorWithHandle: objectList[index]]; + [self monitorWithHandle: objectList[index]]; [result setCurrentActivity: Win32HandleSignaled]; return result; @@ -155,7 +155,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ waitResult < (WAIT_ABANDONED_0 + objectCount)) { DWORD index = waitResult - WAIT_ABANDONED_0; NSHandleMonitor_win32 *result = - [self monitorWithHandle: objectList[index]]; + [self monitorWithHandle: objectList[index]]; [result setCurrentActivity: Win32HandleAbandoned]; return result; @@ -168,7 +168,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([[self validInputSources] count] > 0) { NSHandleMonitor_win32 *monitor = - [self waitForHandleActivityBeforeDate: date mode: mode]; + [self waitForHandleActivityBeforeDate: date mode: mode]; [monitor notifyDelegateOfCurrentActivity]; diff --git a/Foundation/platform_windows/NSLocale+windows.m b/Foundation/platform_windows/NSLocale+windows.m index 29738569..2e0c2d18 100644 --- a/Foundation/platform_windows/NSLocale+windows.m +++ b/Foundation/platform_windows/NSLocale+windows.m @@ -24,9 +24,9 @@ static BOOL CALLBACK enumLocalesProc(LPTSTR lpLocaleString) { GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, countryISO, sizeof(countryISO) / sizeof(countryISO[0])); - [sLocales - setObject: [NSNumber numberWithUnsignedLong: lcid] - forKey: [NSString stringWithFormat: @"%s_%s", langISO, countryISO]]; + [sLocales setObject: [NSNumber numberWithUnsignedLong: lcid] + forKey: [NSString stringWithFormat: @"%s_%s", langISO, + countryISO]]; return YES; } @@ -41,7 +41,7 @@ BOOL NSCurrentLocaleIsMetric() { } + (NSDictionary *) _platformLocaleAdditionalDescriptionForIdentifier: - (NSString *) string + (NSString *) string { @synchronized(self) { if (sLocales == nil) { diff --git a/Foundation/platform_windows/NSMemoryFunctions_win32.m b/Foundation/platform_windows/NSMemoryFunctions_win32.m index 920e8834..ae1404a7 100644 --- a/Foundation/platform_windows/NSMemoryFunctions_win32.m +++ b/Foundation/platform_windows/NSMemoryFunctions_win32.m @@ -37,8 +37,8 @@ NSUInteger NSPageSize(void) { } void *NSAllocateMemoryPages(NSUInteger byteCount) { - void *buffer = - VirtualAlloc(NULL, byteCount, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + void *buffer = VirtualAlloc(NULL, byteCount, MEM_RESERVE | MEM_COMMIT, + PAGE_READWRITE); if (buffer == NULL) { DWORD lastError = GetLastError(); fprintf(stderr, "NSAllocateMemoryPages(%d) failed: WinErr: %d\n", @@ -186,7 +186,7 @@ NSUInteger NSPlatformDetachThread(unsigned (*__stdcall func)(void *arg), { uint32_t threadId = 0; HANDLE win32Handle = - (HANDLE) _beginthreadex(NULL, 0, func, arg, 0, &threadId); + (HANDLE) _beginthreadex(NULL, 0, func, arg, 0, &threadId); if (!win32Handle) { threadId = 0; // just to be sure diff --git a/Foundation/platform_windows/NSParentDeathMonitor_win32.m b/Foundation/platform_windows/NSParentDeathMonitor_win32.m index 66f0475d..8fe50fe7 100644 --- a/Foundation/platform_windows/NSParentDeathMonitor_win32.m +++ b/Foundation/platform_windows/NSParentDeathMonitor_win32.m @@ -43,17 +43,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSHandleMonitor_win32 *) handleMonitor { if (_monitor == nil) { int processId = [[NSUserDefaults standardUserDefaults] - integerForKey: @"ParentProcessId"]; + integerForKey: @"ParentProcessId"]; if (processId == 0 || (_parentHandle = OpenProcess( - SYNCHRONIZE | PROCESS_QUERY_INFORMATION, NO, - processId)) == NULL) { + SYNCHRONIZE | PROCESS_QUERY_INFORMATION, + NO, processId)) == NULL) { [self dealloc]; return nil; } _monitor = [[NSHandleMonitor_win32 allocWithZone: NULL] - initWithHandle: _parentHandle]; + initWithHandle: _parentHandle]; [_monitor setDelegate: self]; } return _monitor; diff --git a/Foundation/platform_windows/NSPersistantDomain_win32.m b/Foundation/platform_windows/NSPersistantDomain_win32.m index af2c1962..fb36f8b5 100644 --- a/Foundation/platform_windows/NSPersistantDomain_win32.m +++ b/Foundation/platform_windows/NSPersistantDomain_win32.m @@ -57,12 +57,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithName: (NSString *) name { // Allow software to specify a more meaningful registry group key NSString *company = [[NSBundle mainBundle] - objectForInfoDictionaryKey: @"Win32RegistryCompanyIdentifier"]; + objectForInfoDictionaryKey: @"Win32RegistryCompanyIdentifier"]; if (company == nil) { company = @"Cocotron"; } - _path = - [[NSArray arrayWithObjects: @"Software", company, name, nil] retain]; + _path = [[NSArray arrayWithObjects: @"Software", company, name, nil] + retain]; _handle = [self rootHandle]; _cache = [NSMutableDictionary new]; return self; @@ -118,8 +118,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // NSLog(@"-[%@ %s] %@ %@",[self class],sel_getName(_cmd),_path,key); - error = - RegQueryValueExA(_handle, keyCString, NULL, &type, NULL, &length); + error = RegQueryValueExA(_handle, keyCString, NULL, &type, NULL, + &length); if (error != ERROR_SUCCESS) { // NSLog(@"RegQueryValueEx failed %@ %@",_path,key); return nil; @@ -127,8 +127,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ buffer = NSZoneMalloc(NULL, length); - error = - RegQueryValueExA(_handle, keyCString, NULL, &type, buffer, &length); + error = RegQueryValueExA(_handle, keyCString, NULL, &type, buffer, + &length); if (error != ERROR_SUCCESS) { return nil; } @@ -142,15 +142,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ NSString *errorDescription = nil; result = [NSPropertyListSerialization - propertyListFromData: data - mutabilityOption: NSPropertyListImmutable - format: &format - errorDescription: &errorDescription]; + propertyListFromData: data + mutabilityOption: NSPropertyListImmutable + format: &format + errorDescription: &errorDescription]; NS_HANDLER result = nil; NS_ENDHANDLER - [_cache setObject: result forKey: key]; + [_cache setObject: result forKey: key]; } return result; @@ -160,9 +160,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ LONG error; NSString *errorDescription = nil; NSData *data = [NSPropertyListSerialization - dataFromPropertyList: object - format: NSPropertyListXMLFormat_v1_0 - errorDescription: &errorDescription]; + dataFromPropertyList: object + format: NSPropertyListXMLFormat_v1_0 + errorDescription: &errorDescription]; [_cache removeObjectForKey: key]; diff --git a/Foundation/platform_windows/NSPipe_win32.m b/Foundation/platform_windows/NSPipe_win32.m index 1bb4ef44..145db2b5 100644 --- a/Foundation/platform_windows/NSPipe_win32.m +++ b/Foundation/platform_windows/NSPipe_win32.m @@ -45,11 +45,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } _fileHandleForReading = - [[NSFileHandle_win32 alloc] initWithHandle: readHandle - closeOnDealloc: YES]; + [[NSFileHandle_win32 alloc] initWithHandle: readHandle + closeOnDealloc: YES]; _fileHandleForWriting = - [[NSFileHandle_win32 alloc] initWithHandle: writeHandle - closeOnDealloc: YES]; + [[NSFileHandle_win32 alloc] initWithHandle: writeHandle + closeOnDealloc: YES]; return self; } diff --git a/Foundation/platform_windows/NSPlatform_win32.m b/Foundation/platform_windows/NSPlatform_win32.m index 7049e448..65a0b02e 100644 --- a/Foundation/platform_windows/NSPlatform_win32.m +++ b/Foundation/platform_windows/NSPlatform_win32.m @@ -75,11 +75,11 @@ static NSString *convertBackslashToSlash(NSString *string) { static NSError *NSErrorForGetLastErrorCode(DWORD code) { NSString *localizedDescription = - @"NSErrorForGetLastError localizedDescription"; + @"NSErrorForGetLastError localizedDescription"; unichar *message; FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR) &message, 0, NULL); localizedDescription = NSStringFromNullTerminatedUnicode(message); @@ -87,11 +87,12 @@ static NSError *NSErrorForGetLastErrorCode(DWORD code) { LocalFree(message); return [NSError - errorWithDomain: NSWin32ErrorDomain - code: code - userInfo: [NSDictionary - dictionaryWithObject: localizedDescription - forKey: NSLocalizedDescriptionKey]]; + errorWithDomain: NSWin32ErrorDomain + code: code + userInfo: + [NSDictionary + dictionaryWithObject: localizedDescription + forKey: NSLocalizedDescriptionKey]]; } static NSError *NSErrorForGetLastError() { @@ -102,8 +103,8 @@ static NSError *NSErrorForGetLastError() { static NSString *processName() { return [[convertBackslashToSlash([NSString - stringWithUTF8String: objc_mainImageName()]) lastPathComponent] - stringByDeletingPathExtension]; + stringWithUTF8String: objc_mainImageName()]) lastPathComponent] + stringByDeletingPathExtension]; } - init { @@ -116,7 +117,7 @@ static NSString *processName() { [NSSocket_windows class]; // initialize winsock entry = [@"SYSTEM\\CurrentControlSet\\Services\\Eventlog\\Application\\" - stringByAppendingString: processName()]; + stringByAppendingString: processName()]; if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, [entry cString], 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &handle, @@ -127,8 +128,8 @@ static NSString *processName() { (LPBYTE) module, strlen(module) + 1)) ; // oh well, an error - allowed = - EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE; + allowed = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | + EVENTLOG_INFORMATION_TYPE; if (RegSetValueEx(handle, "TypesSupported", 0, REG_DWORD, (LPBYTE) &allowed, sizeof(DWORD))) ; // oh well, an error @@ -183,8 +184,8 @@ static NSString *processName() { } - (NSString *) userName { - NSString *result = - [[[NSProcessInfo processInfo] environment] objectForKey: @"USERNAME"]; + NSString *result = [[[NSProcessInfo processInfo] environment] + objectForKey: @"USERNAME"]; if (result == nil) [NSException raise: NSInvalidArgumentException @@ -194,8 +195,8 @@ static NSString *processName() { } - (NSString *) fullUserName { - NSString *result = - [[[NSProcessInfo processInfo] environment] objectForKey: @"USERNAME"]; + NSString *result = [[[NSProcessInfo processInfo] environment] + objectForKey: @"USERNAME"]; if (result == nil) [NSException raise: NSInvalidArgumentException @@ -205,10 +206,10 @@ static NSString *processName() { } - (NSString *) homeDirectory { - NSString *drive = - [[[NSProcessInfo processInfo] environment] objectForKey: @"HOMEDRIVE"]; - NSString *path = - [[[NSProcessInfo processInfo] environment] objectForKey: @"HOMEPATH"]; + NSString *drive = [[[NSProcessInfo processInfo] environment] + objectForKey: @"HOMEDRIVE"]; + NSString *path = [[[NSProcessInfo processInfo] environment] + objectForKey: @"HOMEPATH"]; if (drive == nil) return nil; @@ -217,28 +218,28 @@ static NSString *processName() { return nil; return convertBackslashToSlash( - [drive stringByAppendingPathComponent: path]); + [drive stringByAppendingPathComponent: path]); } - (NSString *) libraryDirectory { - NSString *appdata = - [[[NSProcessInfo processInfo] environment] objectForKey: @"APPDATA"]; + NSString *appdata = [[[NSProcessInfo processInfo] environment] + objectForKey: @"APPDATA"]; return convertBackslashToSlash( - [appdata stringByAppendingPathComponent: @"CocotronLibrary"]); + [appdata stringByAppendingPathComponent: @"CocotronLibrary"]); } - (NSString *) temporaryDirectory { NSString *result = - [[[NSProcessInfo processInfo] environment] objectForKey: @"TEMP"]; + [[[NSProcessInfo processInfo] environment] objectForKey: @"TEMP"]; if (result == nil) - result = - [[[NSProcessInfo processInfo] environment] objectForKey: @"TMP"]; + result = [[[NSProcessInfo processInfo] environment] + objectForKey: @"TMP"]; if (result == nil) { - result = - [[[NSProcessInfo processInfo] environment] objectForKey: @"windir"]; + result = [[[NSProcessInfo processInfo] environment] + objectForKey: @"windir"]; result = [result stringByAppendingPathComponent: @"Temp"]; } @@ -265,9 +266,9 @@ NSString *const NSPlatformLoadableObjectFilePrefix = @""; LPWSTR *argv = CommandLineToArgvW(cmd, &argc); if (argv) { for (i = 0; i < argc; i++) { - [result - addObject: [NSString stringWithCharacters: (unichar *) argv[i] - length: wcslen(argv[i])]]; + [result addObject: [NSString + stringWithCharacters: (unichar *) argv[i] + length: wcslen(argv[i])]]; } LocalFree(argv); } @@ -423,7 +424,7 @@ void NSPlatformSleepThreadForTimeInterval(NSTimeInterval interval) { void NSPlatformLogString(NSString *string) { NSData *data = [NSPropertyListWriter_vintage - nullTerminatedASCIIDataWithString: string]; + nullTerminatedASCIIDataWithString: string]; const char *cString = [data bytes]; NSUInteger length = [data length] - 1; // skip 0 @@ -445,9 +446,10 @@ void NSPlatformLogString(NSString *string) { } void *NSPlatformContentsOfFile(NSString *path, NSUInteger *lengthp) { - HANDLE file = CreateFileW( - [path fileSystemRepresentationW], GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); + HANDLE file = CreateFileW([path fileSystemRepresentationW], GENERIC_READ, + FILE_SHARE_READ, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, + NULL); DWORD length, readLength; void *result; @@ -609,8 +611,8 @@ BOOL NSPlatformGreaterThanOrEqualToWindowsXP(void) { return ((osVersion.dwMajorVersion == 5 && osVersion.dwMinorVersion >= 1) || osVersion.dwMajorVersion > 5) - ? YES - : NO; + ? YES + : NO; } BOOL NSPlatformGreaterThanOrEqualToWindows2000(void) { diff --git a/Foundation/platform_windows/NSReadInBackground_win32.m b/Foundation/platform_windows/NSReadInBackground_win32.m index 8f4fbc8e..b97c7665 100644 --- a/Foundation/platform_windows/NSReadInBackground_win32.m +++ b/Foundation/platform_windows/NSReadInBackground_win32.m @@ -53,8 +53,8 @@ static DWORD WINAPI readInBackground(LPVOID arg) { _modes = [modes copy]; _threadHandle = CreateThread(NULL, 0, readInBackground, self, 0, &threadID); - _threadMonitor = - [[NSHandleMonitor_win32 handleMonitorWithHandle: _threadHandle] retain]; + _threadMonitor = [[NSHandleMonitor_win32 + handleMonitorWithHandle: _threadHandle] retain]; [_threadMonitor setDelegate: self]; for (i = 0; i < count; i++) @@ -92,8 +92,8 @@ static DWORD WINAPI readInBackground(LPVOID arg) { for (i = 0; i < count; i++) [[NSRunLoop currentRunLoop] - removeInputSource: _threadMonitor - forMode: [_modes objectAtIndex: i]]; + removeInputSource: _threadMonitor + forMode: [_modes objectAtIndex: i]]; [_threadMonitor setDelegate: nil]; } diff --git a/Foundation/platform_windows/NSRunLoopState_windows.m b/Foundation/platform_windows/NSRunLoopState_windows.m index 2e8c88f4..890bcd60 100644 --- a/Foundation/platform_windows/NSRunLoopState_windows.m +++ b/Foundation/platform_windows/NSRunLoopState_windows.m @@ -18,8 +18,9 @@ - init { _inputSourceSet = [[NSHandleMonitorSet_win32 alloc] init]; _asyncInputSourceSets = [[NSArray alloc] - initWithObjects: [[[NSSelectInputSourceSet alloc] init] autorelease], - nil]; + initWithObjects: [[[NSSelectInputSourceSet alloc] init] + autorelease], + nil]; _timers = [NSMutableArray new]; _cancelSource = [[NSCancelInputSource_win32 alloc] init]; [self addInputSource: _cancelSource]; diff --git a/Foundation/platform_windows/NSSelectSet_windows.m b/Foundation/platform_windows/NSSelectSet_windows.m index aa0e48e9..6a475535 100644 --- a/Foundation/platform_windows/NSSelectSet_windows.m +++ b/Foundation/platform_windows/NSSelectSet_windows.m @@ -68,8 +68,8 @@ void native_set_set(native_set *native, SOCKET handle) { if (native->fdset->fd_count >= native->max) { native->max *= 2; native->fdset = NSZoneRealloc( - NULL, native->fdset, - sizeof(fd_set) + sizeof(SOCKET) * (native->max - FD_SETSIZE)); + NULL, native->fdset, + sizeof(fd_set) + sizeof(SOCKET) * (native->max - FD_SETSIZE)); } native->fdset->fd_array[native->fdset->fd_count++] = handle; } @@ -95,8 +95,8 @@ void native_set_copy(native_set *native, native_set *copy) { while (copy->max < native->fdset->fd_count) { copy->max *= 2; copy->fdset = NSZoneRealloc( - NULL, copy->fdset, - sizeof(fd_set) + sizeof(SOCKET) * (copy->max - FD_SETSIZE)); + NULL, copy->fdset, + sizeof(fd_set) + sizeof(SOCKET) * (copy->max - FD_SETSIZE)); } for (i = 0; i < native->fdset->fd_count; i++) @@ -280,19 +280,19 @@ static struct NSSelectSetBackgroundInfo *asyncThreadInfo() { pthread_once(&asyncThreadKeyOnce, asyncThreadKeyInitialize); struct NSSelectSetBackgroundInfo *result = - pthread_getspecific(asyncThreadKey); + pthread_getspecific(asyncThreadKey); if (result == NULL) { result = NSZoneMalloc(NULL, sizeof(struct NSSelectSetBackgroundInfo)); result->eventHandle = CreateEvent(NULL, FALSE, FALSE, NULL); result->eventMonitor = [[NSHandleMonitor_win32 - handleMonitorWithHandle: result->eventHandle] retain]; + handleMonitorWithHandle: result->eventHandle] retain]; [result->eventMonitor setDelegate: [NSSelectSet_windows class]]; [result->eventMonitor setCurrentActivity: Win32HandleSignaled]; result->eventMonitorModes = [NSMutableArray new]; result->pingWrite = - [[NSSocket alloc] initConnectedToSocket: &result->pingRead]; + [[NSSocket alloc] initConnectedToSocket: &result->pingRead]; [result->pingRead retain]; result->pingWriteHandle = [result->pingWrite socketHandle]; @@ -330,7 +330,7 @@ void NSSelectSetShutdownForCurrentThread() { pthread_once(&asyncThreadKeyOnce, asyncThreadKeyInitialize); struct NSSelectSetBackgroundInfo *async = - pthread_getspecific(asyncThreadKey); + pthread_getspecific(asyncThreadKey); if (async != NULL) { pthread_setspecific(asyncThreadKey, NULL); @@ -363,8 +363,9 @@ static void transferNativeToSet(native_set *native, NSMutableSet *set) { for (i = 0; i < native->fdset->fd_count; i++) [set addObject: [[[NSSocket_windows alloc] - initWithSocketHandle: native->fdset->fd_array[i]] - autorelease]]; + initWithSocketHandle: native->fdset + ->fd_array[i]] + autorelease]]; } static void transferNativeToSetWithOriginals(native_set *native, @@ -393,8 +394,8 @@ static void transferNativeToSetWithOriginals(native_set *native, LeaveCriticalSection(async->lock); [[NSNotificationCenter defaultCenter] - postNotificationName: NSSelectSetOutputNotification - object: outputSet]; + postNotificationName: NSSelectSetOutputNotification + object: outputSet]; } - (void) waitInBackgroundInMode: (NSString *) mode { @@ -466,7 +467,7 @@ static void transferNativeToSetWithOriginals(native_set *native, if (result == nil) { NSSelectSet_windows *outputSet = - [[[NSSelectSet alloc] init] autorelease]; + [[[NSSelectSet alloc] init] autorelease]; transferNativeToSetWithOriginals(activeRead, outputSet->_readSet, _readSet, cheater); diff --git a/Foundation/platform_windows/NSSocket_windows.m b/Foundation/platform_windows/NSSocket_windows.m index 3a36e787..ffaac789 100644 --- a/Foundation/platform_windows/NSSocket_windows.m +++ b/Foundation/platform_windows/NSSocket_windows.m @@ -62,8 +62,8 @@ static inline void byteZero(void *vsrc, size_t size) { WSAStartup(vR, &wsaData); NSString *path = [[NSBundle bundleForClass: [self class]] - pathForResource: @"CFSSLHandler_openssl" - ofType: @"bundle"]; + pathForResource: @"CFSSLHandler_openssl" + ofType: @"bundle"]; if (path != nil) { NSBundle *bundle = [NSBundle bundleWithPath: path]; @@ -100,9 +100,9 @@ static inline void byteZero(void *vsrc, size_t size) { #ifdef DEBUG NSCLog("NSSocket_windows -initTCPStream"); #endif - NSError *error = [self - errorForReturnValue: _handle = - socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)]; + NSError *error = + [self errorForReturnValue: _handle = socket(PF_INET, SOCK_STREAM, + IPPROTO_TCP)]; if (error != nil) { [self dealloc]; return nil; @@ -114,9 +114,9 @@ static inline void byteZero(void *vsrc, size_t size) { #ifdef DEBUG NSCLog("NSSocket_windows -initUDPStream"); #endif - NSError *error = [self - errorForReturnValue: _handle = - socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)]; + NSError *error = + [self errorForReturnValue: _handle = socket(PF_INET, SOCK_DGRAM, + IPPROTO_UDP)]; if (error != nil) { [self dealloc]; return nil; @@ -179,9 +179,10 @@ static inline void byteZero(void *vsrc, size_t size) { address.sin_addr.s_addr = inet_addr("127.0.0.1"); address.sin_port = 0; if ((error = [self - errorForReturnValue: bind(other->_handle, - (struct sockaddr *) &address, - sizeof(struct sockaddr_in))]) != nil) { + errorForReturnValue: bind(other->_handle, + (struct sockaddr *) &address, + sizeof(struct sockaddr_in))]) != + nil) { [self closeAndDealloc]; [other closeAndDealloc]; return nil; @@ -189,17 +190,18 @@ static inline void byteZero(void *vsrc, size_t size) { namelen = sizeof(address); if ((error = [self - errorForReturnValue: getsockname(other->_handle, - (struct sockaddr *) &address, - &namelen)]) != nil) { + errorForReturnValue: getsockname(other->_handle, + (struct sockaddr *) &address, + &namelen)]) != nil) { [self closeAndDealloc]; [other closeAndDealloc]; return nil; } if ((error = [self - errorForReturnValue: connect(_handle, (struct sockaddr *) &address, - sizeof(struct sockaddr_in))]) != + errorForReturnValue: connect(_handle, + (struct sockaddr *) &address, + sizeof(struct sockaddr_in))]) != nil) { [self closeAndDealloc]; [other closeAndDealloc]; @@ -376,16 +378,17 @@ static inline void byteZero(void *vsrc, size_t size) { NSError *error; error = [self - errorForReturnValue: newSocket = accept(_handle, &addr, &addrlen)]; + errorForReturnValue: newSocket = accept(_handle, &addr, &addrlen)]; if (errorp != nil) { *errorp = error; #ifdef DEBUG NSCLog("accept() error: %zd", [error code]); #endif } - return (error != nil) ? nil - : [[[NSSocket_windows alloc] - initWithSocketHandle: newSocket] autorelease]; + return (error != nil) + ? nil + : [[[NSSocket_windows alloc] initWithSocketHandle: newSocket] + autorelease]; } - (CFSSLHandler *) sslHandler { @@ -396,7 +399,7 @@ static inline void byteZero(void *vsrc, size_t size) { if (_sslHandler == nil) { _sslHandler = [[NSClassFromString(@"CFSSLHandler_openssl") alloc] - initWithProperties: sslProperties]; + initWithProperties: sslProperties]; } else { // FIXME: what do we do if different properties are set } @@ -406,7 +409,8 @@ static inline void byteZero(void *vsrc, size_t size) { @end NSData *NSSocketAddressDataForNetworkOrderAddressBytesAndPort( - const void *address, NSUInteger length, uint16_t port, uint32_t interface) + const void *address, NSUInteger length, uint16_t port, + uint32_t interface) { if (length == 4) { // IPV4 struct sockaddr_in ip4; diff --git a/Foundation/platform_windows/NSString_defaultEncoding_windows.m b/Foundation/platform_windows/NSString_defaultEncoding_windows.m index 58744e63..0a3e5a24 100644 --- a/Foundation/platform_windows/NSString_defaultEncoding_windows.m +++ b/Foundation/platform_windows/NSString_defaultEncoding_windows.m @@ -31,7 +31,7 @@ NSStringEncoding defaultEncoding() { UINT codepage = GetACP(); CFStringEncoding encoding = - CFStringConvertWindowsCodepageToEncoding(codepage); + CFStringConvertWindowsCodepageToEncoding(codepage); if (encoding != kCFStringEncodingInvalidId) { return CFStringConvertEncodingToNSStringEncoding(encoding); } diff --git a/Foundation/platform_windows/NSTask_win32.m b/Foundation/platform_windows/NSTask_win32.m index bf6517bd..5596d63e 100644 --- a/Foundation/platform_windows/NSTask_win32.m +++ b/Foundation/platform_windows/NSTask_win32.m @@ -108,43 +108,43 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ startupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE); else if ([standardInput isKindOfClass: [NSPipe class]]) startupInfo.hStdInput = - [(NSFileHandle_win32 *) [standardInput fileHandleForReading] - fileHandle]; + [(NSFileHandle_win32 *) [standardInput fileHandleForReading] + fileHandle]; else startupInfo.hStdInput = [standardInput fileHandle]; SetHandleInformation( - [(NSFileHandle_win32 *) [standardInput fileHandleForWriting] - fileHandle], - HANDLE_FLAG_INHERIT, 0); + [(NSFileHandle_win32 *) [standardInput fileHandleForWriting] + fileHandle], + HANDLE_FLAG_INHERIT, 0); if (standardOutput == nil) startupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); else if ([standardOutput isKindOfClass: [NSPipe class]]) startupInfo.hStdOutput = - [(NSFileHandle_win32 *) [standardOutput fileHandleForWriting] - fileHandle]; + [(NSFileHandle_win32 *) [standardOutput fileHandleForWriting] + fileHandle]; else startupInfo.hStdOutput = [standardOutput fileHandle]; SetHandleInformation( - [(NSFileHandle_win32 *) [standardOutput fileHandleForReading] - fileHandle], - HANDLE_FLAG_INHERIT, 0); + [(NSFileHandle_win32 *) [standardOutput fileHandleForReading] + fileHandle], + HANDLE_FLAG_INHERIT, 0); if (standardError == nil) startupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE); else if ([standardError isKindOfClass: [NSPipe class]]) startupInfo.hStdError = - [(NSFileHandle_win32 *) [standardError fileHandleForWriting] - fileHandle]; + [(NSFileHandle_win32 *) [standardError fileHandleForWriting] + fileHandle]; else startupInfo.hStdError = [standardError fileHandle]; SetHandleInformation( - [(NSFileHandle_win32 *) [standardError fileHandleForReading] - fileHandle], - HANDLE_FLAG_INHERIT, 0); + [(NSFileHandle_win32 *) [standardError fileHandleForReading] + fileHandle], + HANDLE_FLAG_INHERIT, 0); ZeroMemory(&_processInfo, sizeof(_processInfo)); @@ -153,9 +153,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // alloc enough space for environment // maybe a better solution is with realloc cenv = NSZoneMalloc( - NULL, - [[[environment description] - dataUsingEncoding: [NSString defaultCStringEncoding]] length]); + NULL, + [[[environment description] + dataUsingEncoding: [NSString defaultCStringEncoding]] + length]); cenvp = cenv; NSString *key; @@ -191,12 +192,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if ([launchPath length] > 0) { launchPathStr = (char *) [launchPath fileSystemRepresentation]; } - [NSException - raise: NSInvalidArgumentException - format: - @"CreateProcess(\"%s\", \"%s\", \"%s\") failed with error: %d", - launchPathStr, [[self _argumentsData] bytes], - [currentDirectoryPath fileSystemRepresentation], lastError]; + [NSException raise: NSInvalidArgumentException + format: @"CreateProcess(\"%s\", \"%s\", \"%s\") failed " + @"with error: %d", + launchPathStr, [[self _argumentsData] bytes], + [currentDirectoryPath fileSystemRepresentation], + lastError]; return; } if (cenv) { @@ -211,7 +212,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [[standardError fileHandleForWriting] closeFile]; _monitor = [[NSHandleMonitor_win32 allocWithZone: NULL] - initWithHandle: _processInfo.hProcess]; + initWithHandle: _processInfo.hProcess]; [_monitor setDelegate: self]; [[NSRunLoop currentRunLoop] addInputSource: _monitor forMode: NSDefaultRunLoopMode]; @@ -245,8 +246,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_exitCode != STILL_ACTIVE) { [self finalizeProcess]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSTaskDidTerminateNotification - object: self]; + postNotificationName: NSTaskDidTerminateNotification + object: self]; } } @@ -256,8 +257,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ [self finalizeProcess]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSTaskDidTerminateNotification - object: self]; + postNotificationName: NSTaskDidTerminateNotification + object: self]; } - (int) processIdentifier { diff --git a/Foundation/platform_windows/NSTimeZone_win32.m b/Foundation/platform_windows/NSTimeZone_win32.m index 5f82ee4d..3f2a7def 100644 --- a/Foundation/platform_windows/NSTimeZone_win32.m +++ b/Foundation/platform_windows/NSTimeZone_win32.m @@ -55,8 +55,8 @@ typedef struct _REG_TZI_FORMAT { // this function (without suffix '_priv') should be in kernel32, but in mingw // its not :-( WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( - LPTIME_ZONE_INFORMATION lpTimeZoneInformation, LPSYSTEMTIME lpLocalTime, - LPSYSTEMTIME lpUniversalTime) + LPTIME_ZONE_INFORMATION lpTimeZoneInformation, LPSYSTEMTIME lpLocalTime, + LPSYSTEMTIME lpUniversalTime) { DWORD dwTzID = 0; FILETIME ft = {0}; @@ -122,9 +122,9 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( NSArray *values = [abbDict objectForKey: key]; if ([values indexOfObject: name] != NSNotFound) { - data = - [NSTimeZone_win32 _getDataWithWindowsName: key - registryName: ®istryName]; + data = [NSTimeZone_win32 + _getDataWithWindowsName: key + registryName: ®istryName]; break; } } @@ -135,8 +135,8 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( } } - _abbreviation = - [[NSTimeZone_win32 _registryNameToAbbreviation: registryName] retain]; + _abbreviation = [[NSTimeZone_win32 + _registryNameToAbbreviation: registryName] retain]; _data = [data retain]; _name = [name retain]; @@ -171,7 +171,7 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( GetTimeZoneInformation(&timeZoneInformation); timeZoneName = - NSStringFromNullTerminatedUnicode(timeZoneInformation.StandardName); + NSStringFromNullTerminatedUnicode(timeZoneInformation.StandardName); return [self timeZoneWithName: timeZoneName]; } @@ -220,9 +220,9 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( } - (NSString *) description { - return - [NSString stringWithFormat: @"<%@[0x%lx] name: %@ (%@)>", [self class], - self, [self name], [self abbreviation]]; + return [NSString stringWithFormat: @"<%@[0x%lx] name: %@ (%@)>", + [self class], self, [self name], + [self abbreviation]]; } - (TIME_ZONE_INFORMATION) _timeZoneInformation { @@ -246,10 +246,10 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( DWORD retCode; TCHAR valueName[MAX_VALUE_NAME]; - NSString *regPath = [NSString - stringWithFormat: - @"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones\\%@", - registryname]; + NSString *regPath = + [NSString stringWithFormat: @"SOFTWARE\\Microsoft\\Windows " + @"NT\\CurrentVersion\\Time Zones\\%@", + registryname]; if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT([regPath cString]), 0, KEY_READ, &hTimeZoneKey) == ERROR_SUCCESS) { @@ -277,9 +277,9 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( DWORD valueLength = MAX_VALUE_NAME; valueName[0] = '\0'; - retCode = - RegEnumValue(hTimeZoneKey, j, valueName, &valueLength, - NULL, NULL, lpData, &dataSize); + retCode = RegEnumValue(hTimeZoneKey, j, valueName, + &valueLength, NULL, NULL, lpData, + &dataSize); if (retCode == ERROR_SUCCESS) { if (strcmp(valueName, "Std") == 0) { strcpy(stdname, lpData); @@ -299,11 +299,11 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( if (stdName != NULL) { *stdName = - [NSString stringWithCString: stdname]; + [NSString stringWithCString: stdname]; } if (daylightName != NULL) { - *daylightName = - [NSString stringWithCString: daylightname]; + *daylightName = [NSString + stringWithCString: daylightname]; } RegCloseKey(hTimeZoneKey); @@ -329,10 +329,10 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( { HKEY hTimeZonesKey; - if (RegOpenKeyEx( - HKEY_LOCAL_MACHINE, - TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones"), - 0, KEY_READ, &hTimeZonesKey) == ERROR_SUCCESS) { + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, + TEXT("SOFTWARE\\Microsoft\\Windows " + "NT\\CurrentVersion\\Time Zones"), + 0, KEY_READ, &hTimeZonesKey) == ERROR_SUCCESS) { @try { TCHAR achKey[MAX_KEY_LENGTH]; // buffer for subkey name DWORD cbName; // size of name string @@ -360,18 +360,20 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( NSString *normname; if ((data = [NSTimeZone_win32 - _windowsDataFromRegistry: - [NSString stringWithCString: achKey] - stdName: &normname - daylightName: &daylightName]) != + _windowsDataFromRegistry: + [NSString + stringWithCString: achKey] + stdName: &normname + daylightName: & + daylightName]) != nil) { - if ([name - isEqualToString: - [NSString stringWithCString: achKey]] || + if ([name isEqualToString: + [NSString stringWithCString: + achKey]] || [name isEqualToString: normname]) { if (registryName != NULL) { - *registryName = - [NSString stringWithCString: achKey]; + *registryName = [NSString + stringWithCString: achKey]; } return data; } @@ -399,9 +401,8 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( SystemTimeToFileTime(&systemtime, &filetime); - return [NSDate - dateWithTimeIntervalSinceReferenceDate: Win32TimeIntervalFromFileTime( - filetime)]; + return [NSDate dateWithTimeIntervalSinceReferenceDate: + Win32TimeIntervalFromFileTime(filetime)]; } + (SYSTEMTIME) _dateToSystemTime: (NSDate *) date { @@ -425,10 +426,10 @@ WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime_priv( if (windowsZonesDictionary == nil) { NSString *pathToPlist = [[NSBundle bundleForClass: self] - pathForResource: @"NSTimeZoneWindowsZones" - ofType: @"plist"]; + pathForResource: @"NSTimeZoneWindowsZones" + ofType: @"plist"]; windowsZonesDictionary = [[NSDictionary allocWithZone: NULL] - initWithContentsOfFile: pathToPlist]; + initWithContentsOfFile: pathToPlist]; } return windowsZonesDictionary; diff --git a/Foundation/xml/NSXMLDTD.m b/Foundation/xml/NSXMLDTD.m index 8c868d50..77799b92 100644 --- a/Foundation/xml/NSXMLDTD.m +++ b/Foundation/xml/NSXMLDTD.m @@ -29,8 +29,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithData: (NSData *) data - options: (NSUInteger) options - error: (NSError **) error + options: (NSUInteger) options + error: (NSError **) error { NSUnimplementedMethod(); return nil; diff --git a/Foundation/xml/NSXMLDocument.m b/Foundation/xml/NSXMLDocument.m index d1843966..4b3cdcb9 100644 --- a/Foundation/xml/NSXMLDocument.m +++ b/Foundation/xml/NSXMLDocument.m @@ -50,10 +50,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) parser: (NSXMLParser *) parser - didStartElement: (NSString *) elementName - namespaceURI: (NSString *) namespaceURI - qualifiedName: (NSString *) qualifiedName - attributes: (NSDictionary *) attributes + didStartElement: (NSString *) elementName + namespaceURI: (NSString *) namespaceURI + qualifiedName: (NSString *) qualifiedName + attributes: (NSDictionary *) attributes { NSXMLElement *element = [[NSXMLElement alloc] initWithName: elementName]; @@ -72,9 +72,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) parser: (NSXMLParser *) parser - didEndElement: (NSString *) elementName - namespaceURI: (NSString *) namespaceURI - qualifiedName: (NSString *) qualifiedName + didEndElement: (NSString *) elementName + namespaceURI: (NSString *) namespaceURI + qualifiedName: (NSString *) qualifiedName { [_elementStack removeLastObject]; } @@ -84,11 +84,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // NSLog(@"foundCharacters=%@",string); [element setStringValue: [[element stringValue] - stringByAppendingString: string]]; + stringByAppendingString: string]]; } - (void) parser: (NSXMLParser *) parser - foundIgnorableWhitespace: (NSString *) whitespace + foundIgnorableWhitespace: (NSString *) whitespace { if (_options & NSXMLDocumentTidyXML) @@ -98,8 +98,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithData: (NSData *) data - options: (NSUInteger) options - error: (NSError **) error + options: (NSUInteger) options + error: (NSError **) error { [super initWithKind: NSXMLDocumentKind options: NSXMLNodeOptionsNone]; // NSLog(@"xml=%@",[[[NSString alloc] initWithData:data diff --git a/Foundation/xml/NSXMLElement.h b/Foundation/xml/NSXMLElement.h index c5fef9ed..e8f8170e 100644 --- a/Foundation/xml/NSXMLElement.h +++ b/Foundation/xml/NSXMLElement.h @@ -20,7 +20,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSXMLNode, NSArray, NSError, NSDictionary, NSMutableDictionary, - NSMutableArray; + NSMutableArray; @interface NSXMLElement : NSXMLNode { NSMutableDictionary *_attributes; diff --git a/Foundation/xml/NSXMLElement.m b/Foundation/xml/NSXMLElement.m index b3c7e43c..18dfb184 100644 --- a/Foundation/xml/NSXMLElement.m +++ b/Foundation/xml/NSXMLElement.m @@ -209,8 +209,8 @@ static void appendStringWithCharacterEntities(NSMutableString *result, if (entity != nil) { if (i - location > 0) { NSString *chunk = - [[NSString alloc] initWithCharacters: buffer + location - length: i - location]; + [[NSString alloc] initWithCharacters: buffer + location + length: i - location]; [result appendString: chunk]; [chunk release]; } @@ -224,8 +224,8 @@ static void appendStringWithCharacterEntities(NSMutableString *result, [result appendString: string]; else if (i - location > 0) { NSString *chunk = - [[NSString alloc] initWithCharacters: buffer + location - length: i - location]; + [[NSString alloc] initWithCharacters: buffer + location + length: i - location]; [result appendString: chunk]; [chunk release]; } diff --git a/Foundation/xml/NSXMLNode.h b/Foundation/xml/NSXMLNode.h index fb3ddace..c4169a6d 100644 --- a/Foundation/xml/NSXMLNode.h +++ b/Foundation/xml/NSXMLNode.h @@ -20,7 +20,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSArray, NSError, NSDictionary, NSXMLElement, NSXMLNode, NSXMLDocument, - NSMutableArray; + NSMutableArray; typedef enum { NSXMLInvalidKind, @@ -120,7 +120,7 @@ enum { - (void) setObjectValue: object; - (void) setStringValue: (NSString *) string; - (void) setStringValue: (NSString *) string - resolvingEntities: (BOOL) resolveEntities; + resolvingEntities: (BOOL) resolveEntities; - (void) detach; - (NSArray *) nodesForXPath: (NSString *) xpath error: (NSError **) error; diff --git a/Foundation/xml/NSXMLNode.m b/Foundation/xml/NSXMLNode.m index 8b093403..824f8a1d 100644 --- a/Foundation/xml/NSXMLNode.m +++ b/Foundation/xml/NSXMLNode.m @@ -39,11 +39,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + elementWithName: (NSString *) name - children: (NSArray *) children - attributes: (NSArray *) attributes + children: (NSArray *) children + attributes: (NSArray *) attributes { NSXMLElement *result = - [[[NSXMLElement alloc] initWithName: name] autorelease]; + [[[NSXMLElement alloc] initWithName: name] autorelease]; [result setChildren: children]; [result setAttributes: attributes]; @@ -58,7 +58,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + attributeWithName: (NSString *) name stringValue: (NSString *) string { NSXMLNode *result = - [[[self alloc] initWithKind: NSXMLAttributeKind] autorelease]; + [[[self alloc] initWithKind: NSXMLAttributeKind] autorelease]; [result setName: name]; [result setStringValue: string]; @@ -68,7 +68,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + commentWithStringValue: (NSString *) string { NSXMLNode *result = - [[[self alloc] initWithKind: NSXMLCommentKind] autorelease]; + [[[self alloc] initWithKind: NSXMLCommentKind] autorelease]; [result setStringValue: string]; @@ -77,7 +77,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + textWithStringValue: (NSString *) string { NSXMLNode *result = - [[[self alloc] initWithKind: NSXMLTextKind] autorelease]; + [[[self alloc] initWithKind: NSXMLTextKind] autorelease]; [result setStringValue: string]; @@ -88,7 +88,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ stringValue: (NSString *) string { NSXMLNode *result = [[[self alloc] - initWithKind: NSXMLProcessingInstructionKind] autorelease]; + initWithKind: NSXMLProcessingInstructionKind] autorelease]; [result setName: name]; [result setStringValue: string]; @@ -102,7 +102,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + namespaceWithName: (NSString *) name stringValue: (NSString *) string { NSXMLNode *result = - [[[self alloc] initWithKind: NSXMLNamespaceKind] autorelease]; + [[[self alloc] initWithKind: NSXMLNamespaceKind] autorelease]; [result setName: name]; [result setStringValue: string]; @@ -257,7 +257,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) setStringValue: (NSString *) string - resolvingEntities: (BOOL) resolveEntities + resolvingEntities: (BOOL) resolveEntities { NSUnimplementedMethod(); } @@ -283,7 +283,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } } else { NSString *firstComponent = - [xpath substringWithRange: NSMakeRange(0, range.location)]; + [xpath substringWithRange: NSMakeRange(0, range.location)]; NSString *remainder = [xpath substringFromIndex: NSMaxRange(range)]; for (NSXMLNode *node in _children) { diff --git a/Foundation/xml/NSXMLParser.h b/Foundation/xml/NSXMLParser.h index aa3187b3..45c76ae5 100644 --- a/Foundation/xml/NSXMLParser.h +++ b/Foundation/xml/NSXMLParser.h @@ -22,7 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class NSURL, NSData, NSError, NSXMLParser, NSDictionary, NSMutableArray, - NSMutableDictionary; + NSMutableDictionary; @protocol NSXMLParserDelegate @@ -30,62 +30,62 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) parserDidEndDocument: (NSXMLParser *) parser; - (void) parser: (NSXMLParser *) parser - foundElementDeclarationWithName: (NSString *) elementName - model: (NSString *) model; + foundElementDeclarationWithName: (NSString *) elementName + model: (NSString *) model; - (void) parser: (NSXMLParser *) parser - didStartElement: (NSString *) elementName - namespaceURI: (NSString *) namespaceURI - qualifiedName: (NSString *) qualifiedName - attributes: (NSDictionary *) attributes; + didStartElement: (NSString *) elementName + namespaceURI: (NSString *) namespaceURI + qualifiedName: (NSString *) qualifiedName + attributes: (NSDictionary *) attributes; - (void) parser: (NSXMLParser *) parser - didEndElement: (NSString *) elementName - namespaceURI: (NSString *) namespaceURI - qualifiedName: (NSString *) qualifiedName; + didEndElement: (NSString *) elementName + namespaceURI: (NSString *) namespaceURI + qualifiedName: (NSString *) qualifiedName; - (void) parser: (NSXMLParser *) parser - foundAttributeDeclarationWithName: (NSString *) attributeName - forElement: (NSString *) elementName - type: (NSString *) type - defaultValue: (NSString *) defaultValue; + foundAttributeDeclarationWithName: (NSString *) attributeName + forElement: (NSString *) elementName + type: (NSString *) type + defaultValue: (NSString *) defaultValue; - (void) parser: (NSXMLParser *) parser - didStartMappingPrefix: (NSString *) prefix - toURI: (NSString *) uri; + didStartMappingPrefix: (NSString *) prefix + toURI: (NSString *) uri; - (void) parser: (NSXMLParser *) parser - didEndMappingPrefix: (NSString *) prefix; + didEndMappingPrefix: (NSString *) prefix; - (void) parser: (NSXMLParser *) parser foundCDATA: (NSData *) cdata; - (void) parser: (NSXMLParser *) parser foundCharacters: (NSString *) string; - (void) parser: (NSXMLParser *) parser foundComment: (NSString *) comment; - (void) parser: (NSXMLParser *) parser - foundIgnorableWhitespace: (NSString *) whitespace; + foundIgnorableWhitespace: (NSString *) whitespace; - (void) parser: (NSXMLParser *) parser - foundExternalEntityDeclarationWithName: (NSString *) entityName - publicID: (NSString *) publicID - systemID: (NSString *) systemID; + foundExternalEntityDeclarationWithName: (NSString *) entityName + publicID: (NSString *) publicID + systemID: (NSString *) systemID; - (void) parser: (NSXMLParser *) parser - foundInternalEntityDeclarationWithName: (NSString *) entityName - value: (NSString *) value; + foundInternalEntityDeclarationWithName: (NSString *) entityName + value: (NSString *) value; - (void) parser: (NSXMLParser *) parser - foundNotationDeclarationWithName: (NSString *) name - publicID: (NSString *) publicID - systemID: (NSString *) systemID; + foundNotationDeclarationWithName: (NSString *) name + publicID: (NSString *) publicID + systemID: (NSString *) systemID; - (void) parser: (NSXMLParser *) parser - foundProcessingInstructionWithTarget: (NSString *) target - data: (NSString *) data; + foundProcessingInstructionWithTarget: (NSString *) target + data: (NSString *) data; - (void) parser: (NSXMLParser *) parser - foundUnparsedEntityDeclarationWithName: (NSString *) name - publicID: (NSString *) publicID - systemID: (NSString *) systemID - notationName: (NSString *) notationName; + foundUnparsedEntityDeclarationWithName: (NSString *) name + publicID: (NSString *) publicID + systemID: (NSString *) systemID + notationName: (NSString *) notationName; - (void) parser: (NSXMLParser *) parser - parseErrorOccurred: (NSError *) parseError; + parseErrorOccurred: (NSError *) parseError; - (NSData *) parser: (NSXMLParser *) parser - resolveExternalEntityName: (NSString *) entityName - systemID: (NSString *) systemID; + resolveExternalEntityName: (NSString *) entityName + systemID: (NSString *) systemID; - (void) parser: (NSXMLParser *) parser - validationErrorOccurred: (NSError *) validationError; + validationErrorOccurred: (NSError *) validationError; @end diff --git a/Foundation/xml/NSXMLParser.m b/Foundation/xml/NSXMLParser.m index 971ac5da..612f4ab9 100644 --- a/Foundation/xml/NSXMLParser.m +++ b/Foundation/xml/NSXMLParser.m @@ -135,7 +135,7 @@ enum { - (void) ignoreableWhitespace: (NSString *) string { if ([_delegate respondsToSelector: @selector(parser: - foundIgnorableWhitespace:)]) + foundIgnorableWhitespace:)]) [_delegate parser: self foundIgnorableWhitespace: string]; } @@ -166,12 +166,13 @@ enum { if ([_delegate respondsToSelector: @selector (parser: - didStartElement:namespaceURI:qualifiedName:attributes:)]) + didStartElement:namespaceURI:qualifiedName:attributes + :)]) [_delegate parser: self - didStartElement: elementName - namespaceURI: nil - qualifiedName: nil - attributes: _currentAttributes]; + didStartElement: elementName + namespaceURI: nil + qualifiedName: nil + attributes: _currentAttributes]; [_currentAttributes release]; _currentAttributes = nil; @@ -180,9 +181,9 @@ enum { - (void) didEndElement { NSString *elementName = [_elementNameStack lastObject]; [_delegate parser: self - didEndElement: elementName - namespaceURI: nil - qualifiedName: nil]; + didEndElement: elementName + namespaceURI: nil + qualifiedName: nil]; [_elementNameStack removeLastObject]; } diff --git a/IOKit/IOKitLib.m b/IOKit/IOKitLib.m index 469cb550..f4d99398 100644 --- a/IOKit/IOKitLib.m +++ b/IOKit/IOKitLib.m @@ -20,8 +20,8 @@ static NSData *PrimaryEthernetMAC() { if (check->Type == MIB_IF_TYPE_ETHERNET) { if (check->AddressLength == 6) { NSData *result = - [[NSData alloc] initWithBytes: check->Address - length: check->AddressLength]; + [[NSData alloc] initWithBytes: check->Address + length: check->AddressLength]; return result; } } @@ -118,8 +118,8 @@ const mach_port_t kIOMasterPortDefault = 0; CFMutableDictionaryRef IOServiceMatching(const char *name) { return [NSMutableDictionary - dictionaryWithObject: [NSString stringWithCString: name] - forKey: CFSTR(kIOProviderClassKey)]; + dictionaryWithObject: [NSString stringWithCString: name] + forKey: CFSTR(kIOProviderClassKey)]; } io_service_t IOServiceGetMatchingService(mach_port_t masterPort, @@ -142,13 +142,13 @@ kern_return_t IOServiceGetMatchingServices(mach_port_t masterPort, if ([type isEqual: @"IOEthernetInterface"]) { NSDictionary *propertyMatch = - [matching objectForKey: CFSTR(kIOPropertyMatchKey)]; + [matching objectForKey: CFSTR(kIOPropertyMatchKey)]; NSNumber *isPrimary = - [propertyMatch objectForKey: CFSTR(kIOPrimaryInterface)]; + [propertyMatch objectForKey: CFSTR(kIOPrimaryInterface)]; if ([isPrimary boolValue]) { [result addObject: [[[IOEthernetInterface alloc] initPrimary] - autorelease]]; + autorelease]]; } } diff --git a/ImageKit/IKImageBrowserView.h b/ImageKit/IKImageBrowserView.h index 304cf00d..d66441c2 100644 --- a/ImageKit/IKImageBrowserView.h +++ b/ImageKit/IKImageBrowserView.h @@ -22,7 +22,7 @@ IMAGEKIT_EXPORT NSString *const IKImageBrowserQTMovieRepresentationType; IMAGEKIT_EXPORT NSString *const IKImageBrowserQTMoviePathRepresentationType; IMAGEKIT_EXPORT NSString *const IKImageBrowserQCCompositionRepresentationType; IMAGEKIT_EXPORT NSString - *const IKImageBrowserQCCompositionPathRepresentationType; + *const IKImageBrowserQCCompositionPathRepresentationType; IMAGEKIT_EXPORT NSString *const IKImageBrowserQuickLookPathRepresentationType; IMAGEKIT_EXPORT NSString *const IKImageBrowserIconRefPathRepresentationType; IMAGEKIT_EXPORT NSString *const IKImageBrowserIconRefRepresentationType; @@ -170,12 +170,12 @@ typedef enum { - (void) imageBrowserSelectionDidChange: (IKImageBrowserView *) browser; - (void) imageBrowser: (IKImageBrowserView *) browser - backgroundWasRightClickedWithEvent: (NSEvent *) event; + backgroundWasRightClickedWithEvent: (NSEvent *) event; - (void) imageBrowser: (IKImageBrowserView *) browser - cellWasRightClickedAtIndex: (NSUInteger) index - withEvent: (NSEvent *) event; + cellWasRightClickedAtIndex: (NSUInteger) index + withEvent: (NSEvent *) event; - (void) imageBrowser: (IKImageBrowserView *) browser - cellWasDoubleClickedAtIndex: (NSUInteger) index; + cellWasDoubleClickedAtIndex: (NSUInteger) index; @end @interface NSObject (IKImageBrowserDataSource) @@ -185,10 +185,10 @@ typedef enum { - imageBrowser: (IKImageBrowserView *) browser itemAtIndex: (NSUInteger) index; - (BOOL) imageBrowser: (IKImageBrowserView *) browser - moveItemsAtIndexes: (NSIndexSet *) indexes - toIndex: (NSUInteger) destinationIndex; + moveItemsAtIndexes: (NSIndexSet *) indexes + toIndex: (NSUInteger) destinationIndex; - (void) imageBrowser: (IKImageBrowserView *) browser - removeItemsAtIndexes: (NSIndexSet *) indexes; + removeItemsAtIndexes: (NSIndexSet *) indexes; - (NSUInteger) imageBrowser: (IKImageBrowserView *) browser writeItemsAtIndexes: (NSIndexSet *) itemIndexes toPasteboard: (NSPasteboard *) pasteboard; diff --git a/ImageKit/IKImageBrowserView.m b/ImageKit/IKImageBrowserView.m index c60f4164..fd002a5e 100644 --- a/ImageKit/IKImageBrowserView.m +++ b/ImageKit/IKImageBrowserView.m @@ -2,7 +2,7 @@ #import NSString *const IKImageBrowserQuickLookPathRepresentationType = - @"IKImageBrowserQuickLookPathRepresentationType"; + @"IKImageBrowserQuickLookPathRepresentationType"; NSString *const IKImageBrowserGroupRangeKey = @"IKImageBrowserGroupRangeKey"; NSString *const IKImageBrowserGroupTitleKey = @"IKImageBrowserGroupTitleKey"; diff --git a/InstallCDT/Resources/tools/retargetBundle.m b/InstallCDT/Resources/tools/retargetBundle.m index 8c4e05b7..cb095672 100644 --- a/InstallCDT/Resources/tools/retargetBundle.m +++ b/InstallCDT/Resources/tools/retargetBundle.m @@ -97,9 +97,9 @@ static void copyRegularAtInto(NSFileManager *fileManager, NSString *original, if (![fileManager createSymbolicLinkAtPath: copy withDestinationPath: original error: &error]) - NSLog( - @"createSymbolicLinkAtPath:%@ pathContent:%@ FAILED, error=%@", - copy, original, error); + NSLog(@"createSymbolicLinkAtPath:%@ pathContent:%@ FAILED, " + @"error=%@", + copy, original, error); } else { if (![fileManager copyItemAtPath: original toPath: copy error: &error]) NSLog(@"copyPath:%@ toPath:%@ FAILED, error=%@", original, copy, @@ -130,7 +130,7 @@ static void copyPathAtInto(NSFileManager *fileManager, NSString *original, return; } original = [[original stringByDeletingLastPathComponent] - stringByAppendingPathComponent: dest]; + stringByAppendingPathComponent: dest]; attributes = [fileManager attributesOfItemAtPath: original error: &error]; fileType = [attributes objectForKey: NSFileType]; @@ -144,14 +144,14 @@ static void copyPathAtInto(NSFileManager *fileManager, NSString *original, unsigned i, count = [children count]; [fileManager createDirectoryAtPath: copy - withIntermediateDirectories: YES - attributes: nil - error: &error]; + withIntermediateDirectories: YES + attributes: nil + error: &error]; for (i = 0; i < count; i++) { NSString *check = [children objectAtIndex: i]; NSString *originalChild = - [original stringByAppendingPathComponent: check]; + [original stringByAppendingPathComponent: check]; NSString *copyChild = [copy stringByAppendingPathComponent: check]; copyPathAtInto(fileManager, originalChild, copyChild, ignore); @@ -183,7 +183,7 @@ static void copyChangedFilesAtInto(NSFileManager *fileManager, return; } original = [[original stringByDeletingLastPathComponent] - stringByAppendingPathComponent: dest]; + stringByAppendingPathComponent: dest]; attributes = [fileManager attributesOfItemAtPath: original error: &error]; fileType = [attributes objectForKey: NSFileType]; @@ -206,11 +206,12 @@ static void copyChangedFilesAtInto(NSFileManager *fileManager, exit(-1); } else if ([fileType isEqual: NSFileTypeRegular]) { if (![[attributes objectForKey: NSFileSize] - isEqual: [shouldBe objectForKey: NSFileSize]]) + isEqual: [shouldBe objectForKey: NSFileSize]]) copyRegularAtInto(fileManager, original, copy); if (ignoreTime || ([[attributes objectForKey: NSFileModificationDate] - compare: [shouldBe objectForKey: NSFileModificationDate]] == + compare: [shouldBe + objectForKey: NSFileModificationDate]] == NSOrderedDescending)) copyRegularAtInto(fileManager, original, copy); } else if ([fileType isEqual: NSFileTypeDirectory]) { @@ -221,7 +222,7 @@ static void copyChangedFilesAtInto(NSFileManager *fileManager, for (i = 0; i < count; i++) { NSString *check = [children objectAtIndex: i]; NSString *originalChild = - [original stringByAppendingPathComponent: check]; + [original stringByAppendingPathComponent: check]; NSString *copyChild = [copy stringByAppendingPathComponent: check]; copyChangedFilesAtInto(fileManager, originalChild, copyChild, @@ -256,16 +257,16 @@ static NSMutableArray *ignoredFilesInFramework(NSFileManager *fileManager, NSString *original) { NSString *name = - [[original lastPathComponent] stringByDeletingPathExtension]; + [[original lastPathComponent] stringByDeletingPathExtension]; NSMutableArray *result = [NSMutableArray array]; [result addObject: [[[original stringByAppendingPathComponent: @"lib"] - stringByAppendingString: name] - stringByAppendingPathExtension: @"a"]]; + stringByAppendingString: name] + stringByAppendingPathExtension: @"a"]]; [result addObject: [original stringByAppendingPathComponent: @"Versions"]]; [result addObject: [original stringByAppendingPathComponent: @"Headers"]]; - [result addObject: [original - stringByAppendingPathComponent: @"PrivateHeaders"]]; + [result addObject: [original stringByAppendingPathComponent: + @"PrivateHeaders"]]; return result; } @@ -279,7 +280,7 @@ static void copyFrameworkAtIntoDirectory(NSFileManager *fileManager, NSString *soFile = sharedObjectFileInFramework(fileManager, original); NSString *soOriginal = [original stringByAppendingPathComponent: soFile]; NSString *soDestination = - [destination stringByAppendingPathComponent: soFile]; + [destination stringByAppendingPathComponent: soFile]; [ignore addObject: soOriginal]; @@ -287,7 +288,7 @@ static void copyFrameworkAtIntoDirectory(NSFileManager *fileManager, copyChangedFilesAtInto(fileManager, soOriginal, soDestination, nil); NSString *copy = [destination - stringByAppendingPathComponent: [original lastPathComponent]]; + stringByAppendingPathComponent: [original lastPathComponent]]; if (useSymlinks) { copyRegularAtInto(fileManager, original, copy); @@ -303,7 +304,7 @@ NSString *resolveFrameworkWithPath(NSFileManager *fileManager, NSString *name, for (i = 0; i < count; i++) { NSString *directory = [path objectAtIndex: i]; NSString *check = [[directory stringByAppendingPathComponent: name] - stringByAppendingPathExtension: @"framework"]; + stringByAppendingPathExtension: @"framework"]; BOOL isDirectory; if ([fileManager fileExistsAtPath: check isDirectory: &isDirectory] && @@ -324,8 +325,8 @@ int main(int argc, char **argv) { NSString *destination = nil; NSArray *settingsPath = - [[environment objectForKey: @"FRAMEWORK_SEARCH_PATHS"] - componentsSeparatedByString: @" "]; + [[environment objectForKey: @"FRAMEWORK_SEARCH_PATHS"] + componentsSeparatedByString: @" "]; [searchPath addObjectsFromArray: settingsPath]; @@ -341,7 +342,7 @@ int main(int argc, char **argv) { else { NSString *name = [arguments objectAtIndex: i]; NSString *path = - resolveFrameworkWithPath(fileManager, name, searchPath); + resolveFrameworkWithPath(fileManager, name, searchPath); if (path == nil) { NSLog(@"Unable to find -framework %@ on path %@", name, @@ -394,12 +395,12 @@ int main(int argc, char **argv) { NSString *gdbserverPort = [environment objectForKey: @"GDBSERVER_PORT"]; NSString *gdbserverHost = [environment objectForKey: @"GDBSERVER_HOST"]; NSString *builtProductsDir = - [environment objectForKey: @"BUILT_PRODUCTS_DIR"]; + [environment objectForKey: @"BUILT_PRODUCTS_DIR"]; if (gdbserver != nil) { NSString *debugger = - [[destination stringByAppendingPathComponent: @"gdbserver"] - stringByAppendingPathExtension: @"exe"]; + [[destination stringByAppendingPathComponent: @"gdbserver"] + stringByAppendingPathExtension: @"exe"]; copyPathAtInto(fileManager, gdbserver, debugger, nil); @@ -407,28 +408,29 @@ int main(int argc, char **argv) { gdbserverPort = @"999"; NSString *startline = [NSString - stringWithFormat: @"START \"GDBServer listening at port %@\" " - @"gdbserver --multi localhost:%@\x0D\x0A", - gdbserverPort, gdbserverPort]; + stringWithFormat: @"START \"GDBServer listening at port %@\" " + @"gdbserver --multi localhost:%@\x0D\x0A", + gdbserverPort, gdbserverPort]; NSData *data = [startline dataUsingEncoding: NSASCIIStringEncoding]; NSString *debug = - [[destination stringByAppendingPathComponent: @"debug"] - stringByAppendingPathExtension: @"bat"]; + [[destination stringByAppendingPathComponent: @"debug"] + stringByAppendingPathExtension: @"bat"]; [fileManager createFileAtPath: debug contents: data attributes: nil]; NSString *wrapperName = [environment objectForKey: @"WRAPPER_NAME"]; NSString *executableName = - [environment objectForKey: @"EXECUTABLE_NAME"]; + [environment objectForKey: @"EXECUTABLE_NAME"]; NSString *remoteTarget = [NSString - stringWithFormat: @"cd %@/Contents/Windows\nset remote exec-file " - @"%@\ntarget extended-remote %@:%@\n", - wrapperName, executableName, gdbserverHost, - gdbserverPort]; + stringWithFormat: + @"cd %@/Contents/Windows\nset remote exec-file " + @"%@\ntarget extended-remote %@:%@\n", + wrapperName, executableName, gdbserverHost, + gdbserverPort]; NSData *remoteTargetData = - [remoteTarget dataUsingEncoding: NSASCIIStringEncoding]; + [remoteTarget dataUsingEncoding: NSASCIIStringEncoding]; NSString *remoteTargetTxt = [builtProductsDir - stringByAppendingPathComponent: @"Remote-Target.txt"]; + stringByAppendingPathComponent: @"Remote-Target.txt"]; [fileManager createFileAtPath: remoteTargetTxt contents: remoteTargetData diff --git a/NSSpellEngine_hunspell/NSSpellEngine_hunspell.mm b/NSSpellEngine_hunspell/NSSpellEngine_hunspell.mm index 3e96101b..084d6655 100644 --- a/NSSpellEngine_hunspell/NSSpellEngine_hunspell.mm +++ b/NSSpellEngine_hunspell/NSSpellEngine_hunspell.mm @@ -20,18 +20,18 @@ + (NSArray *) spellEngines { NSBundle *bundle = [NSBundle bundleForClass: self]; NSString *directory = - [[bundle resourcePath] stringByAppendingPathComponent: @"Spelling"]; + [[bundle resourcePath] stringByAppendingPathComponent: @"Spelling"]; NSSpellEngine_hunspell *engine = [[[NSSpellEngine_hunspell alloc] - initWithContentsOfFile: directory] autorelease]; + initWithContentsOfFile: directory] autorelease]; return [NSArray arrayWithObject: engine]; } - initWithContentsOfFile: (NSString *) path { NSArray *contents = - [[NSFileManager defaultManager] contentsOfDirectoryAtPath: path - error: NULL]; + [[NSFileManager defaultManager] contentsOfDirectoryAtPath: path + error: NULL]; _dictionaries = [[NSMutableDictionary alloc] init]; @@ -40,8 +40,8 @@ if ([[aff pathExtension] isEqualToString: @"aff"]) { NSString *affPath = [path stringByAppendingPathComponent: aff]; NSSpellEngine_hunspellDictionary *dict = - [[[NSSpellEngine_hunspellDictionary alloc] - initWithContentsOfFile: affPath] autorelease]; + [[[NSSpellEngine_hunspellDictionary alloc] + initWithContentsOfFile: affPath] autorelease]; [_dictionaries setObject: dict forKey: [dict language]]; } @@ -67,13 +67,13 @@ } - (NSSpellEngine_hunspellDictionary *) _dictionaryForLanguage: - (NSString *) language + (NSString *) language { if (language == nil) { language = [[NSLocale currentLocale] localeIdentifier]; } NSSpellEngine_hunspellDictionary *dict = - [_dictionaries objectForKey: language]; + [_dictionaries objectForKey: language]; if (dict == nil) { // If the lang is "xx_YY", then try the first dict starting with "xx" // So "fr_CA", "fr_BE"... can use the french dictionary for example if @@ -107,7 +107,7 @@ NSString *language = [orthography dominantLanguage]; NSSpellEngine_hunspellDictionary *dict = - [self _dictionaryForLanguage: language]; + [self _dictionaryForLanguage: language]; NSUInteger length = [stringToCheck length]; NSUInteger bufferCapacity = 10, bufferOffset = offset, bufferIndex = 0, @@ -116,7 +116,7 @@ NSUInteger wordCapacity = 10, wordLength = 0; unichar *wordBuffer = - (unichar *) NSZoneMalloc(NULL, sizeof(unichar) * wordCapacity); + (unichar *) NSZoneMalloc(NULL, sizeof(unichar) * wordCapacity); NSCharacterSet *letters = [NSCharacterSet letterCharacterSet]; @@ -126,8 +126,8 @@ // the binary charset representations. static NSCharacterSet *marks = nil; if (marks == nil) { - marks = - [[NSCharacterSet characterSetWithCharactersInString: @"'"] retain]; + marks = [[NSCharacterSet characterSetWithCharactersInString: @"'"] + retain]; } enum { @@ -150,8 +150,8 @@ bufferLength = MIN(bufferCapacity, length - bufferOffset); [stringToCheck - getCharacters: buffer - range: NSMakeRange(bufferOffset, bufferLength)]; + getCharacters: buffer + range: NSMakeRange(bufferOffset, bufferLength)]; } code = buffer[bufferIndex]; @@ -184,22 +184,21 @@ if (wordLength >= wordCapacity) { wordCapacity *= 2; wordBuffer = (unichar *) NSZoneRealloc( - NULL, wordBuffer, sizeof(unichar) * wordCapacity); + NULL, wordBuffer, sizeof(unichar) * wordCapacity); } wordBuffer[wordLength++] = code; } if (checkWord) { - [result - addObjectsFromArray: - [dict textCheckingResultWithRange: NSMakeRange( - bufferOffset + - (bufferIndex - - wordLength), - wordLength) - forCharacters: wordBuffer - length: wordLength]]; + [result addObjectsFromArray: + [dict textCheckingResultWithRange: + NSMakeRange(bufferOffset + + (bufferIndex - + wordLength), + wordLength) + forCharacters: wordBuffer + length: wordLength]]; wordLength = 0; } } @@ -211,7 +210,7 @@ inLanguage: (NSString *) language { NSSpellEngine_hunspellDictionary *dict = - [self _dictionaryForLanguage: language]; + [self _dictionaryForLanguage: language]; return [dict suggestGuessesForWord: word]; } diff --git a/NSSpellEngine_hunspell/NSSpellEngine_hunspellDictionary.mm b/NSSpellEngine_hunspell/NSSpellEngine_hunspellDictionary.mm index e77202dd..d409d7f6 100644 --- a/NSSpellEngine_hunspell/NSSpellEngine_hunspellDictionary.mm +++ b/NSSpellEngine_hunspell/NSSpellEngine_hunspellDictionary.mm @@ -29,11 +29,11 @@ _path = [path copy]; NSString *affPath = _path; NSString *dicPath = [[_path stringByDeletingPathExtension] - stringByAppendingPathExtension: @"dic"]; + stringByAppendingPathExtension: @"dic"]; _hunspell = - hunspell_initialize((char *) [affPath fileSystemRepresentation], - (char *) [dicPath fileSystemRepresentation]); + hunspell_initialize((char *) [affPath fileSystemRepresentation], + (char *) [dicPath fileSystemRepresentation]); return self; } @@ -90,13 +90,13 @@ /* Word contains a character outside of IS8859-1, I guess this is a * spelling error. */ NSTextCheckingResult *result = - [NSTextCheckingResult spellCheckingResultWithRange: range]; + [NSTextCheckingResult spellCheckingResultWithRange: range]; return [NSArray arrayWithObject: result]; } else { if (hunspell_spell((Hunspell *) _hunspell, string) == 0) { NSTextCheckingResult *result = - [NSTextCheckingResult spellCheckingResultWithRange: range]; + [NSTextCheckingResult spellCheckingResultWithRange: range]; return [NSArray arrayWithObject: result]; } @@ -120,9 +120,9 @@ for (i = 0; i < len && slst != NULL; i++) { NSString *guess = [[[NSString alloc] - initWithBytes: slst[i] - length: strlen(slst[i]) - encoding: NSUTF8StringEncoding] autorelease]; + initWithBytes: slst[i] + length: strlen(slst[i]) + encoding: NSUTF8StringEncoding] autorelease]; [result addObject: guess]; } diff --git a/O2Context_AntiGrain/O2Context_AntiGrain.h b/O2Context_AntiGrain/O2Context_AntiGrain.h index 237bef71..f005434c 100644 --- a/O2Context_AntiGrain/O2Context_AntiGrain.h +++ b/O2Context_AntiGrain/O2Context_AntiGrain.h @@ -60,8 +60,8 @@ class context_renderer; typedef agg::pixfmt_gray8_pre pixfmt_alphaMaskType; typedef agg::renderer_base BaseRendererWithAlphaMaskType; typedef agg::rasterizer_scanline_aa<> - RasterizerType; // We use an anti-aliased scanline rasterizer for AGG - // rendering. + RasterizerType; // We use an anti-aliased scanline rasterizer for AGG + // rendering. typedef agg::amask_no_clip_gray8 MaskType; @interface O2Context_AntiGrain : O2Context_builtin_gdi { @@ -75,8 +75,8 @@ typedef agg::amask_no_clip_gray8 MaskType; agg::scanline_u8 *scanline_u8; // used for mixed opaque/transparent // rendering (stroking,text...) - agg::scanline_p8 - *scanline_p8; // used for mostly opaque rendering (filling, images...) + agg::scanline_p8 *scanline_p8; // used for mostly opaque rendering (filling, + // images...) // Rendering buffer to use for alpha masking (bezier path clipping) agg::rendering_buffer *rBufAlphaMask[2]; @@ -84,7 +84,7 @@ typedef agg::amask_no_clip_gray8 MaskType; pixfmt_alphaMaskType *pixelFormatAlphaMask[2]; BaseRendererWithAlphaMaskType *baseRendererAlphaMask[2]; agg::renderer_scanline_aa_solid - *solidScanlineRendererAlphaMask[2]; + *solidScanlineRendererAlphaMask[2]; int currentMask; NSArray *savedClipPhases; diff --git a/O2Context_AntiGrain/O2Context_AntiGrain.mm b/O2Context_AntiGrain/O2Context_AntiGrain.mm index 09c07034..19066b58 100644 --- a/O2Context_AntiGrain/O2Context_AntiGrain.mm +++ b/O2Context_AntiGrain/O2Context_AntiGrain.mm @@ -284,7 +284,7 @@ class context_renderer { class context_renderer_helper : public context_renderer_helper_base { typedef o2agg::pixfmt_custom_blend_rgba - pixfmt_type; + pixfmt_type; typedef o2agg::pixfmt_bgra32_pre pixfmt_shadow_type; @@ -363,10 +363,10 @@ class context_renderer { int bytesPerRow = ren_base->ren().stride(); pixelShadowBytes = new uint8_t[height * bytesPerRow]; renderingBufferShadow = new agg::rendering_buffer( - pixelShadowBytes, width, height, bytesPerRow); + pixelShadowBytes, width, height, bytesPerRow); pixelFormatShadow = - new pixfmt_shadow_type(*renderingBufferShadow); + new pixfmt_shadow_type(*renderingBufferShadow); ren_shadow = new renderer_shadow(*pixelFormatShadow); } ren_shadow->reset_clipping(1); @@ -478,26 +478,26 @@ class context_renderer { agg::span_allocator sa; typedef agg::image_accessor_clone - img_accessor_type; + img_accessor_type; typedef agg::span_interpolator_linear - interpolator_type; + interpolator_type; img_accessor_type ia(*pixelFormatShadow); agg::trans_affine transform; transform.translate( - -fract(shadowOffset.width), - fract(shadowOffset.height)); // Translate using the fract part - // of the shadow offset + -fract(shadowOffset.width), + fract(shadowOffset.height)); // Translate using the fract + // part of the shadow offset interpolator_type interpolator(transform); typedef agg::span_image_filter_rgba_nn - span_gen_type; + span_gen_type; span_gen_type sg(ia, interpolator); unsigned oldBlendMode = pixelFormat->comp_op(); pixelFormat->comp_op( - o2agg::comp_op_src_over); // Always use src_over when copying - // the shadow + o2agg::comp_op_src_over); // Always use src_over when + // copying the shadow agg::render_scanlines_aa(r, sl, *ren_base, sa, sg); pixelFormat->comp_op(oldBlendMode); } @@ -538,11 +538,11 @@ class context_renderer { // we can skip the blur pass which is also applying the // color o2agg::rgba8 color = - o2agg::rgba(shadowColor.r, shadowColor.g, shadowColor.b, - shadowColor.a * alpha); + o2agg::rgba(shadowColor.r, shadowColor.g, + shadowColor.b, shadowColor.a * alpha); span_color_converter color_converter(color, premultiply); agg::span_converter converter( - type, color_converter); + type, color_converter); // Render to the shadow location (rounded - we are working // with pixels here) so we're sure we can properly blur the @@ -590,7 +590,7 @@ class context_renderer { span_alpha_converter alpha_converter(alpha, premultiply); agg::span_converter> - converter(type, alpha_converter); + converter(type, alpha_converter); agg::render_scanlines_aa(rasterizer, sl, *ren_base, span_allocator, converter); } @@ -624,8 +624,8 @@ class context_renderer { // Draw using our shadow rendererer using our shadow color (and // global alpha) T color = - o2agg::rgba(shadowColor.r, shadowColor.g, shadowColor.b, - shadowColor.a * type.opacity()); + o2agg::rgba(shadowColor.r, shadowColor.g, shadowColor.b, + shadowColor.a * type.opacity()); color.premultiply(); // Render to the shadow location (rounded - we are working with @@ -633,8 +633,9 @@ class context_renderer { // We'll take into account the fractional part when copying the // shadow to the final buffer render_scanlines_aa_solid_translate( - rasterizer, sl, *ren_shadow, color, - truncf(shadowOffset.width), -truncf(shadowOffset.height)); + rasterizer, sl, *ren_shadow, color, + truncf(shadowOffset.width), + -truncf(shadowOffset.height)); // Get the used part of the rasterizer - we don't need to blur a // bigger area than that @@ -681,29 +682,29 @@ class context_renderer { context_renderer_helper_base *helper; typedef class context_renderer_helper< - o2agg::comp_op_adaptor_rgba> - rgba_helper; + o2agg::comp_op_adaptor_rgba> + rgba_helper; typedef class context_renderer_helper< - o2agg::comp_op_adaptor_rgba> - bgra_helper; + o2agg::comp_op_adaptor_rgba> + bgra_helper; typedef class context_renderer_helper< - o2agg::comp_op_adaptor_rgba> - argb_helper; + o2agg::comp_op_adaptor_rgba> + argb_helper; typedef class context_renderer_helper< - o2agg::comp_op_adaptor_rgba> - abgr_helper; + o2agg::comp_op_adaptor_rgba> + abgr_helper; typedef class context_renderer_helper< - o2agg::comp_op_adaptor_rgba_pre> - rgba_helper_pre; + o2agg::comp_op_adaptor_rgba_pre> + rgba_helper_pre; typedef class context_renderer_helper< - o2agg::comp_op_adaptor_rgba_pre> - bgra_helper_pre; + o2agg::comp_op_adaptor_rgba_pre> + bgra_helper_pre; typedef class context_renderer_helper< - o2agg::comp_op_adaptor_rgba_pre> - argb_helper_pre; + o2agg::comp_op_adaptor_rgba_pre> + argb_helper_pre; typedef class context_renderer_helper< - o2agg::comp_op_adaptor_rgba_pre> - abgr_helper_pre; + o2agg::comp_op_adaptor_rgba_pre> + abgr_helper_pre; public: bool premultiplied; @@ -720,7 +721,7 @@ class context_renderer { template void init_pre(agg::rendering_buffer &renderingBuffer) { typedef o2agg::comp_op_adaptor_rgba_pre - blender_type; + blender_type; premultiplied = true; helper = new context_renderer_helper(renderingBuffer); helper->setPremultiply(premultiplied); @@ -735,30 +736,30 @@ class context_renderer { if (premultiplied) { if (helper->isRGBA()) { ((rgba_helper_pre *) helper) - ->render_scanlines(rasterizer, sl, type); + ->render_scanlines(rasterizer, sl, type); } else if (helper->isABGR()) { ((abgr_helper_pre *) helper) - ->render_scanlines(rasterizer, sl, type); + ->render_scanlines(rasterizer, sl, type); } else if (helper->isBGRA()) { ((bgra_helper_pre *) helper) - ->render_scanlines(rasterizer, sl, type); + ->render_scanlines(rasterizer, sl, type); } else if (helper->isBGRA()) { ((bgra_helper_pre *) helper) - ->render_scanlines(rasterizer, sl, type); + ->render_scanlines(rasterizer, sl, type); } } else { if (helper->isRGBA()) { ((rgba_helper *) helper) - ->render_scanlines(rasterizer, sl, type); + ->render_scanlines(rasterizer, sl, type); } else if (helper->isABGR()) { ((abgr_helper *) helper) - ->render_scanlines(rasterizer, sl, type); + ->render_scanlines(rasterizer, sl, type); } else if (helper->isBGRA()) { ((bgra_helper *) helper) - ->render_scanlines(rasterizer, sl, type); + ->render_scanlines(rasterizer, sl, type); } else if (helper->isBGRA()) { ((bgra_helper *) helper) - ->render_scanlines(rasterizer, sl, type); + ->render_scanlines(rasterizer, sl, type); } } } @@ -769,30 +770,38 @@ class context_renderer { if (premultiplied) { if (helper->isRGBA()) { ((rgba_helper_pre *) helper) - ->render_scanlines_aa(rasterizer, sl, span_allocator, type); + ->render_scanlines_aa(rasterizer, sl, span_allocator, + type); } else if (helper->isABGR()) { ((abgr_helper_pre *) helper) - ->render_scanlines_aa(rasterizer, sl, span_allocator, type); + ->render_scanlines_aa(rasterizer, sl, span_allocator, + type); } else if (helper->isBGRA()) { ((bgra_helper_pre *) helper) - ->render_scanlines_aa(rasterizer, sl, span_allocator, type); + ->render_scanlines_aa(rasterizer, sl, span_allocator, + type); } else if (helper->isBGRA()) { ((bgra_helper_pre *) helper) - ->render_scanlines_aa(rasterizer, sl, span_allocator, type); + ->render_scanlines_aa(rasterizer, sl, span_allocator, + type); } } else { if (helper->isRGBA()) { ((rgba_helper *) helper) - ->render_scanlines_aa(rasterizer, sl, span_allocator, type); + ->render_scanlines_aa(rasterizer, sl, span_allocator, + type); } else if (helper->isABGR()) { ((abgr_helper *) helper) - ->render_scanlines_aa(rasterizer, sl, span_allocator, type); + ->render_scanlines_aa(rasterizer, sl, span_allocator, + type); } else if (helper->isBGRA()) { ((bgra_helper *) helper) - ->render_scanlines_aa(rasterizer, sl, span_allocator, type); + ->render_scanlines_aa(rasterizer, sl, span_allocator, + type); } else if (helper->isBGRA()) { ((bgra_helper *) helper) - ->render_scanlines_aa(rasterizer, sl, span_allocator, type); + ->render_scanlines_aa(rasterizer, sl, span_allocator, + type); } } } @@ -802,30 +811,30 @@ class context_renderer { if (premultiplied) { if (helper->isRGBA()) { ((rgba_helper_pre *) helper) - ->render_scanlines_aa_solid(rasterizer, sl, type); + ->render_scanlines_aa_solid(rasterizer, sl, type); } else if (helper->isABGR()) { ((abgr_helper_pre *) helper) - ->render_scanlines_aa_solid(rasterizer, sl, type); + ->render_scanlines_aa_solid(rasterizer, sl, type); } else if (helper->isBGRA()) { ((bgra_helper_pre *) helper) - ->render_scanlines_aa_solid(rasterizer, sl, type); + ->render_scanlines_aa_solid(rasterizer, sl, type); } else if (helper->isBGRA()) { ((bgra_helper_pre *) helper) - ->render_scanlines_aa_solid(rasterizer, sl, type); + ->render_scanlines_aa_solid(rasterizer, sl, type); } } else { if (helper->isRGBA()) { ((rgba_helper *) helper) - ->render_scanlines_aa_solid(rasterizer, sl, type); + ->render_scanlines_aa_solid(rasterizer, sl, type); } else if (helper->isABGR()) { ((abgr_helper *) helper) - ->render_scanlines_aa_solid(rasterizer, sl, type); + ->render_scanlines_aa_solid(rasterizer, sl, type); } else if (helper->isBGRA()) { ((bgra_helper *) helper) - ->render_scanlines_aa_solid(rasterizer, sl, type); + ->render_scanlines_aa_solid(rasterizer, sl, type); } else if (helper->isBGRA()) { ((bgra_helper *) helper) - ->render_scanlines_aa_solid(rasterizer, sl, type); + ->render_scanlines_aa_solid(rasterizer, sl, type); } } } @@ -954,14 +963,14 @@ void O2AGGContextDrawShading(O2Context_AntiGrain *self, O2Shading *shading, float x, float y, float width, float height) { typedef o2agg::pixfmt_bgra32_pre - pixfmt_type; // That should be the same pixel type as the context ? + pixfmt_type; // That should be the same pixel type as the context ? typedef pixfmt_type::color_type color_type; typedef gradient_evaluator color_func_type; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::span_allocator span_allocator_type; typedef agg::span_gradient - span_gradient_type; + span_gradient_type; O2GState *gState = O2ContextCurrentGState(self); O2ClipState *clipState = O2GStateClipState(gState); @@ -971,9 +980,9 @@ void O2AGGContextDrawShading(O2Context_AntiGrain *self, O2Shading *shading, deviceTransform.tx, deviceTransform.ty); O2Point deviceStart = - O2PointApplyAffineTransform([shading startPoint], deviceTransform); + O2PointApplyAffineTransform([shading startPoint], deviceTransform); O2Point deviceEnd = - O2PointApplyAffineTransform([shading endPoint], deviceTransform); + O2PointApplyAffineTransform([shading endPoint], deviceTransform); double x1 = deviceStart.x; double y1 = deviceStart.y; @@ -1061,7 +1070,7 @@ void O2AGGContextDrawImage(O2Context_AntiGrain *self, case kImageInterpolationNone: { typedef agg::span_image_filter_rgba_nn - span_gen_type; + span_gen_type; span_gen_type sg(ia, interpolator); render_scanlines_aa(self, sa, sg); @@ -1070,7 +1079,7 @@ void O2AGGContextDrawImage(O2Context_AntiGrain *self, case kImageInterpolationBilinear: { typedef agg::span_image_filter_rgba_bilinear - span_gen_type; + span_gen_type; span_gen_type sg(ia, interpolator); render_scanlines_aa(self, sa, sg); @@ -1081,7 +1090,7 @@ void O2AGGContextDrawImage(O2Context_AntiGrain *self, typedef agg::span_image_filter_rgba - span_gen_type; + span_gen_type; span_gen_type sg(ia, interpolator, filter); render_scanlines_aa(self, sa, sg); @@ -1102,12 +1111,12 @@ void O2AGGContextDrawImage(O2Context_AntiGrain *self, case kImageInterpolationRepeat: { typedef agg::image_accessor_wrap - img_accessor_type; + img_accessor_type; img_accessor_type ia(img_pixf); typedef agg::span_image_filter_rgba_bilinear - span_gen_type; + span_gen_type; span_gen_type sg(ia, interpolator); render_scanlines_aa(self, sa, sg); @@ -1123,7 +1132,7 @@ void O2AGGContextDrawImage(O2Context_AntiGrain *self, agg::image_filter_lut filter(filter_kernel, true); typedef o2agg::span_image_resample_rgba_affine - span_gen_type; + span_gen_type; span_gen_type sg(ia, interpolator, filter); render_scanlines_aa(self, sa, sg); @@ -1133,7 +1142,7 @@ void O2AGGContextDrawImage(O2Context_AntiGrain *self, agg::image_filter_lut filter(filter_kernel, true); typedef o2agg::span_image_resample_rgba_affine - span_gen_type; + span_gen_type; span_gen_type sg(ia, interpolator, filter); render_scanlines_aa(self, sa, sg); @@ -1154,7 +1163,7 @@ void O2AGGContextDrawImage(O2Context_AntiGrain *self, case kImageInterpolationRepeat: { typedef agg::image_accessor_wrap - img_accessor_type; + img_accessor_type; img_accessor_type ia(img_pixf); agg::image_filter_bilinear filter_kernel; @@ -1163,7 +1172,7 @@ void O2AGGContextDrawImage(O2Context_AntiGrain *self, // seems some y wrapping is missing in the optimized resampling code // - so use the slower plain AGG version for now typedef agg::span_image_resample_rgba_affine - span_gen_type; + span_gen_type; span_gen_type sg(ia, interpolator, filter); render_scanlines_aa(self, sa, sg); @@ -1289,7 +1298,7 @@ static void O2AGGContextFillPathWithRule(O2Context_AntiGrain *self, { agg::conv_curve curve(*(self->path)); agg::conv_transform, agg::trans_affine> - trans(curve, deviceMatrix); + trans(curve, deviceMatrix); curve.approximation_scale(deviceMatrix.scale()); @@ -1310,7 +1319,7 @@ static void O2AGGContextStrokePath(O2Context_AntiGrain *self, o2agg::rgba color, if (gState->_dashLengthsCount > 1) { agg::conv_dash> dash(curve); agg::conv_stroke>> - stroke(dash); + stroke(dash); dash.dash_start(gState->_dashPhase); for (int i = 0; i < gState->_dashLengthsCount; i += 2) { if (i == gState->_dashLengthsCount - 1) { @@ -1343,7 +1352,7 @@ static void O2AGGReplaceStrokedPath(O2Context_AntiGrain *self, if (gState->_dashLengthsCount > 1) { agg::conv_dash> dash(curve); agg::conv_stroke>> - stroke(dash); + stroke(dash); dash.dash_start(gState->_dashPhase); for (int i = 0; i < gState->_dashLengthsCount; i += 2) { if (i == gState->_dashLengthsCount - 1) { @@ -1386,34 +1395,34 @@ static void buildAGGPathFromO2PathAndTransform(agg::path_storage *aggPath, case kO2PathElementMoveToPoint: { O2Point point = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); aggPath->move_to(point.x, point.y); } break; case kO2PathElementAddLineToPoint: { O2Point point = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); aggPath->line_to(point.x, point.y); } break; case kO2PathElementAddCurveToPoint: { O2Point cp1 = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); O2Point cp2 = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); O2Point end = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); aggPath->curve4(cp1.x, cp1.y, cp2.x, cp2.y, end.x, end.y); } break; case kO2PathElementAddQuadCurveToPoint: { O2Point cp1 = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); O2Point cp2 = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); aggPath->curve3(cp1.x, cp1.y, cp2.x, cp2.y); } break; @@ -1441,7 +1450,7 @@ static void transferPath(O2Context_AntiGrain *self, O2PathRef path, static NSMutableArray *kfontLRU = nil; if (kfontCache == nil) { kfontCache = - [[NSMutableDictionary alloc] initWithCapacity: kKFontCacheSize]; + [[NSMutableDictionary alloc] initWithCapacity: kKFontCacheSize]; } if (kfontLRU == nil) { kfontLRU = [[NSMutableArray alloc] initWithCapacity: kKFontCacheSize]; @@ -1481,14 +1490,14 @@ unsigned O2AGGContextShowGlyphs(O2Context_AntiGrain *self, // Pipeline to process the vectors glyph paths (curves) typedef agg::conv_curve - conv_curve_type; + conv_curve_type; conv_curve_type curves(font_manager->path_adaptor()); O2GState *gState = O2ContextCurrentGState(self); O2Font *font = O2GStateFont(gState); NSString *fontName = - [(NSString *) O2FontCopyFullName(font) autorelease]; + [(NSString *) O2FontCopyFullName(font) autorelease]; float pointSize = O2GStatePointSize(gState); O2AffineTransform Trm = self->_textMatrix; @@ -1514,7 +1523,7 @@ unsigned O2AGGContextShowGlyphs(O2Context_AntiGrain *self, self->rasterizer->filling_rule(agg::fill_non_zero); font_engine->hinting( - false); // For some reason, it looks better without hinting... + false); // For some reason, it looks better without hinting... font_engine->height((int) pointSize); font_engine->width(0.); // Automatic width font_engine->flip_y(false); @@ -1524,7 +1533,7 @@ unsigned O2AGGContextShowGlyphs(O2Context_AntiGrain *self, if (font_engine->create_font([fontName UTF8String], agg::glyph_ren_outline)) { agg::conv_transform trans( - curves, transformMatrix); + curves, transformMatrix); CGSize defaultAdvances[count]; if (advances == NULL) { @@ -1589,8 +1598,9 @@ unsigned O2AGGContextShowGlyphs(O2Context_AntiGrain *self, int bytesPerRow = O2SurfaceGetBytesPerRow(surface); renderingBuffer = new agg::rendering_buffer( - (unsigned char *) O2SurfaceGetPixelBytes(surface), - O2SurfaceGetWidth(surface), O2SurfaceGetHeight(surface), bytesPerRow); + (unsigned char *) O2SurfaceGetPixelBytes(surface), + O2SurfaceGetWidth(surface), O2SurfaceGetHeight(surface), + bytesPerRow); rasterizer = new RasterizerType(); scanline_u8 = new agg::scanline_u8; @@ -1701,16 +1711,15 @@ unsigned O2AGGContextShowGlyphs(O2Context_AntiGrain *self, void *alphaBuffer = malloc(O2SurfaceGetWidth(surface) * (O2SurfaceGetHeight(surface) + 1)); rBufAlphaMask[i] = new agg::rendering_buffer( - (unsigned char *) alphaBuffer, O2SurfaceGetWidth(surface), - O2SurfaceGetHeight(surface), O2SurfaceGetWidth(surface)); + (unsigned char *) alphaBuffer, O2SurfaceGetWidth(surface), + O2SurfaceGetHeight(surface), O2SurfaceGetWidth(surface)); alphaMask[i] = new MaskType(*rBufAlphaMask[i]); pixelFormatAlphaMask[i] = new pixfmt_alphaMaskType(*rBufAlphaMask[i]); baseRendererAlphaMask[i] = - new BaseRendererWithAlphaMaskType(*pixelFormatAlphaMask[i]); + new BaseRendererWithAlphaMaskType(*pixelFormatAlphaMask[i]); - solidScanlineRendererAlphaMask[i] = - new agg::renderer_scanline_aa_solid( - *baseRendererAlphaMask[i]); + solidScanlineRendererAlphaMask[i] = new agg::renderer_scanline_aa_solid< + BaseRendererWithAlphaMaskType>(*baseRendererAlphaMask[i]); solidScanlineRendererAlphaMask[i]->color(agg::gray8(255, 255)); } } @@ -1752,23 +1761,23 @@ unsigned O2AGGContextShowGlyphs(O2Context_AntiGrain *self, // Onyx2D -> AGG blend mode conversion // O2Log("Setting blend mode to %d", blendMode); enum o2agg::comp_op_e blendModeMap[28] = { - o2agg::comp_op_src_over, o2agg::comp_op_multiply, - o2agg::comp_op_screen, o2agg::comp_op_overlay, - o2agg::comp_op_darken, o2agg::comp_op_lighten, - o2agg::comp_op_color_dodge, o2agg::comp_op_color_burn, - o2agg::comp_op_hard_light, o2agg::comp_op_soft_light, - o2agg::comp_op_difference, o2agg::comp_op_exclusion, - o2agg::comp_op_src_over, // should be Hue - o2agg::comp_op_src_over, // should be Saturation - o2agg::comp_op_color, - o2agg::comp_op_src_over, // should be Luminosity - o2agg::comp_op_clear, o2agg::comp_op_src, - o2agg::comp_op_src_in, o2agg::comp_op_src_out, - o2agg::comp_op_src_atop, o2agg::comp_op_dst_over, - o2agg::comp_op_dst_in, o2agg::comp_op_dst_out, - o2agg::comp_op_dst_atop, o2agg::comp_op_xor, - o2agg::comp_op_plus_darker, - o2agg::comp_op_minus, // shoud be MinusLighter + o2agg::comp_op_src_over, o2agg::comp_op_multiply, + o2agg::comp_op_screen, o2agg::comp_op_overlay, + o2agg::comp_op_darken, o2agg::comp_op_lighten, + o2agg::comp_op_color_dodge, o2agg::comp_op_color_burn, + o2agg::comp_op_hard_light, o2agg::comp_op_soft_light, + o2agg::comp_op_difference, o2agg::comp_op_exclusion, + o2agg::comp_op_src_over, // should be Hue + o2agg::comp_op_src_over, // should be Saturation + o2agg::comp_op_color, + o2agg::comp_op_src_over, // should be Luminosity + o2agg::comp_op_clear, o2agg::comp_op_src, + o2agg::comp_op_src_in, o2agg::comp_op_src_out, + o2agg::comp_op_src_atop, o2agg::comp_op_dst_over, + o2agg::comp_op_dst_in, o2agg::comp_op_dst_out, + o2agg::comp_op_dst_atop, o2agg::comp_op_xor, + o2agg::comp_op_plus_darker, + o2agg::comp_op_minus, // shoud be MinusLighter }; O2GState *gState = O2ContextCurrentGState(self); @@ -1831,29 +1840,31 @@ unsigned O2AGGContextShowGlyphs(O2Context_AntiGrain *self, [self createMaskRenderer]; } baseRendererAlphaMask[0]->clip_box( - self->_vpx - 1, self->_vpy, - self->_vpx + self->_vpwidth, - self->_vpy + self->_vpheight); + self->_vpx - 1, self->_vpy, + self->_vpx + self->_vpwidth, + self->_vpy + self->_vpheight); // We only need to fill the clipped rect area baseRendererAlphaMask[0]->copy_bar( - self->_vpx, self->_vpy, self->_vpx + self->_vpwidth, - self->_vpy + self->_vpheight, agg::gray8(255, 255)); + self->_vpx, self->_vpy, + self->_vpx + self->_vpwidth, + self->_vpy + self->_vpheight, + agg::gray8(255, 255)); } // Switch masks currentMask = !currentMask; // Clear the new mask baseRendererAlphaMask[currentMask]->clip_box( - self->_vpx, self->_vpy, self->_vpx + self->_vpwidth, - self->_vpy + self->_vpheight); + self->_vpx, self->_vpy, self->_vpx + self->_vpwidth, + self->_vpy + self->_vpheight); // We only need to clear the clipped rect area baseRendererAlphaMask[currentMask]->copy_bar( - self->_vpx, self->_vpy, self->_vpx + self->_vpwidth, - self->_vpy + self->_vpheight, agg::gray8(0)); + self->_vpx, self->_vpy, self->_vpx + self->_vpwidth, + self->_vpy + self->_vpheight, agg::gray8(0)); buildAGGPathFromO2PathAndTransform( - &aggPath, maskPath, O2AffineTransformIdentity); + &aggPath, maskPath, O2AffineTransformIdentity); agg::conv_curve curve(aggPath); curve.approximation_scale(deviceMatrix.scale()); @@ -1868,8 +1879,8 @@ unsigned O2AGGContextShowGlyphs(O2Context_AntiGrain *self, // Render the path masked by the previous mask scanline_mask_type sl(*self->alphaMask[!currentMask]); renderer->render_scanlines( - *rasterizer, sl, - *solidScanlineRendererAlphaMask[currentMask]); + *rasterizer, sl, + *solidScanlineRendererAlphaMask[currentMask]); } break; } @@ -1886,7 +1897,7 @@ unsigned O2AGGContextShowGlyphs(O2Context_AntiGrain *self, // Clip the viewport with the path bounds static void O2ContextClipViewportToPath(O2Context_builtin *self, O2Path *path) { O2Rect viewport = - O2RectMake(self->_vpx, self->_vpy, self->_vpwidth, self->_vpheight); + O2RectMake(self->_vpx, self->_vpy, self->_vpwidth, self->_vpheight); O2Rect rect = O2PathGetBoundingBox(path); rect = O2RectIntegral(rect); @@ -2023,7 +2034,7 @@ static void O2ContextClipViewportToState(O2Context_builtin *self, O2Surface *surface = [self createSurfaceWithWidth: [pattern xstep] height: [pattern ystep]]; O2Context_AntiGrain *context = - [[self->isa alloc] initWithSurface: surface flipped: YES]; + [[self->isa alloc] initWithSurface: surface flipped: YES]; // Draw the pattern tile [pattern drawInContext: context]; @@ -2031,8 +2042,8 @@ static void O2ContextClipViewportToState(O2Context_builtin *self, // Build the global transform from the pattern to the device O2AffineTransform matrix = O2AffineTransformConcat( - ([pattern matrix]), - O2AffineTransformInvert(gState->_userSpaceTransform)); + ([pattern matrix]), + O2AffineTransformInvert(gState->_userSpaceTransform)); agg::trans_affine globalTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty); @@ -2041,33 +2052,37 @@ static void O2ContextClipViewportToState(O2Context_builtin *self, // Create an agg buffer from the Surface content uint8_t *imgBytes = (uint8_t *) [surface pixelBytes]; - agg::rendering_buffer imageBuffer( - imgBytes, O2SurfaceGetWidth(surface), - O2SurfaceGetHeight(surface), O2SurfaceGetBytesPerRow(surface)); + agg::rendering_buffer imageBuffer(imgBytes, + O2SurfaceGetWidth(surface), + O2SurfaceGetHeight(surface), + O2SurfaceGetBytesPerRow(surface)); // Fill the current agg path with the repeated tile agg::conv_curve curve(*(self->path)); agg::conv_transform, agg::trans_affine> - trans(curve, aggDeviceMatrix); + trans(curve, aggDeviceMatrix); self->rasterizer->add_path(trans); renderer->premultiplied = YES; O2AGGContextDrawImage( - self, imageBuffer, globalTransform, kImageInterpolationRepeat); + self, imageBuffer, globalTransform, + kImageInterpolationRepeat); [surface release]; } else { O2ColorRef fillColor = - O2ColorConvertToDeviceRGB(gState->_fillColor); + O2ColorConvertToDeviceRGB(gState->_fillColor); const float *fillComps = O2ColorGetComponents(fillColor); o2agg::rgba aggFillColor(fillComps[0], fillComps[1], fillComps[2], fillComps[3]); if (doFill) { - O2AGGContextFillPathWithRule( - self, aggFillColor, aggDeviceMatrix, agg::fill_non_zero); + O2AGGContextFillPathWithRule(self, aggFillColor, + aggDeviceMatrix, + agg::fill_non_zero); } else { - O2AGGContextFillPathWithRule( - self, aggFillColor, aggDeviceMatrix, agg::fill_even_odd); + O2AGGContextFillPathWithRule(self, aggFillColor, + aggDeviceMatrix, + agg::fill_even_odd); } O2ColorRelease(fillColor); } @@ -2076,7 +2091,7 @@ static void O2ContextClipViewportToState(O2Context_builtin *self, if (doStroke) { // Note: pattern stroking not supported for now O2ColorRef strokeColor = - O2ColorConvertToDeviceRGB(gState->_strokeColor); + O2ColorConvertToDeviceRGB(gState->_strokeColor); const float *strokeComps = O2ColorGetComponents(strokeColor); o2agg::rgba aggStrokeColor(strokeComps[0], strokeComps[1], strokeComps[2], strokeComps[3]); @@ -2134,16 +2149,16 @@ static void O2ContextClipViewportToState(O2Context_builtin *self, deviceTransform.tx, deviceTransform.ty); agg::conv_transform trans( - p2, transform); // Global Affine transformer + p2, transform); // Global Affine transformer rasterizer->add_path(trans); // Flipped scaled transfrom from the original image bounds to the // destination rect O2AffineTransform imageTransform = O2AffineTransformMakeTranslation( - rect.origin.x, rect.origin.y + rect.size.height); + rect.origin.x, rect.origin.y + rect.size.height); imageTransform = O2AffineTransformScale( - imageTransform, rect.size.width / float(width), - -rect.size.height / float(height)); + imageTransform, rect.size.width / float(width), + -rect.size.height / float(height)); agg::trans_affine globalTransform(imageTransform.a, imageTransform.b, imageTransform.c, imageTransform.d, @@ -2219,22 +2234,22 @@ static void O2ContextClipViewportToState(O2Context_builtin *self, case kO2ImageAlphaPremultipliedLast: renderer->premultiplied = YES; O2AGGContextDrawImage( - self, imageBuffer, globalTransform, interpolationType); + self, imageBuffer, globalTransform, interpolationType); break; case kO2ImageAlphaLast: renderer->premultiplied = NO; O2AGGContextDrawImage( - self, imageBuffer, globalTransform, interpolationType); + self, imageBuffer, globalTransform, interpolationType); break; case kO2ImageAlphaPremultipliedFirst: renderer->premultiplied = YES; O2AGGContextDrawImage( - self, imageBuffer, globalTransform, interpolationType); + self, imageBuffer, globalTransform, interpolationType); break; case kO2ImageAlphaFirst: renderer->premultiplied = NO; O2AGGContextDrawImage( - self, imageBuffer, globalTransform, interpolationType); + self, imageBuffer, globalTransform, interpolationType); break; default: O2Log("UNKNOW ALPHA"); @@ -2250,22 +2265,22 @@ static void O2ContextClipViewportToState(O2Context_builtin *self, case kO2ImageAlphaPremultipliedLast: renderer->premultiplied = YES; O2AGGContextDrawImage( - self, imageBuffer, globalTransform, interpolationType); + self, imageBuffer, globalTransform, interpolationType); break; case kO2ImageAlphaLast: renderer->premultiplied = NO; O2AGGContextDrawImage( - self, imageBuffer, globalTransform, interpolationType); + self, imageBuffer, globalTransform, interpolationType); break; case kO2ImageAlphaPremultipliedFirst: renderer->premultiplied = YES; O2AGGContextDrawImage( - self, imageBuffer, globalTransform, interpolationType); + self, imageBuffer, globalTransform, interpolationType); break; case kO2ImageAlphaFirst: renderer->premultiplied = NO; O2AGGContextDrawImage( - self, imageBuffer, globalTransform, interpolationType); + self, imageBuffer, globalTransform, interpolationType); break; default: // Fallback to the default implementation - that means clipping, @@ -2354,7 +2369,7 @@ static void O2ContextClipViewportToState(O2Context_builtin *self, // any or the context one) O2LayerRef newTopLayer = [self->_layerStack lastObject]; O2Surface *surface = - newTopLayer ? O2LayerGetSurface(newTopLayer) : _surface; + newTopLayer ? O2LayerGetSurface(newTopLayer) : _surface; renderingBuffer->attach((unsigned char *) O2SurfaceGetPixelBytes(surface), O2SurfaceGetWidth(surface), O2SurfaceGetHeight(surface), diff --git a/O2Context_AntiGrain/agg_font_win32_tt.mm b/O2Context_AntiGrain/agg_font_win32_tt.mm index 8091429a..1fd5b3bb 100644 --- a/O2Context_AntiGrain/agg_font_win32_tt.mm +++ b/O2Context_AntiGrain/agg_font_win32_tt.mm @@ -51,49 +51,49 @@ namespace agg { //------------------------------------------------------------------------------ static const unsigned crc32tab[256] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, - 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, - 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, - 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, - 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, - 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, - 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, - 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, - 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, - 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, - 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, - 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, - 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, - 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, - 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, - 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, - 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, - 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, - 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; //------------------------------------------------------------------------------ @@ -265,16 +265,16 @@ bool decompose_win32_glyph_outline(const char *gbuf, unsigned total_size, u++) // Walk through points in spline { POINTFX pnt_b = - pc->apfx[u]; // B is always the current point + pc->apfx[u]; // B is always the current point POINTFX pnt_c = pc->apfx[u + 1]; if (u < pc->cpfx - 2) // If not on last spline, compute C { // midpoint (x,y) *(int *) &pnt_c.x = - (*(int *) &pnt_b.x + *(int *) &pnt_c.x) / 2; + (*(int *) &pnt_b.x + *(int *) &pnt_c.x) / 2; *(int *) &pnt_c.y = - (*(int *) &pnt_b.y + *(int *) &pnt_c.y) / 2; + (*(int *) &pnt_b.y + *(int *) &pnt_c.y) / 2; } double x2, y2; @@ -520,8 +520,8 @@ bool font_engine_win32_tt_base::prepare_glyph(unsigned glyph_code) { // structure. So, we have to query the metrics // separately (basically we need gmCellIncX). int total_size = GetGlyphOutlineX( - m_dc, glyph_code, GGO_METRICS | GGO_GLYPH_INDEX, &gm, buf_size, - (void *) m_gbuf, &m_matrix); + m_dc, glyph_code, GGO_METRICS | GGO_GLYPH_INDEX, &gm, + buf_size, (void *) m_gbuf, &m_matrix); if (total_size < 0) return false; @@ -536,9 +536,10 @@ bool font_engine_win32_tt_base::prepare_glyph(unsigned glyph_code) { switch (m_glyph_rendering) { case glyph_ren_native_mono: decompose_win32_glyph_bitmap_mono( - m_gbuf, gm.gmBlackBoxX, gm.gmBlackBoxY, gm.gmptGlyphOrigin.x, - m_flip_y ? -gm.gmptGlyphOrigin.y : gm.gmptGlyphOrigin.y, - m_flip_y, m_scanline_bin, m_scanlines_bin); + m_gbuf, gm.gmBlackBoxX, gm.gmBlackBoxY, + gm.gmptGlyphOrigin.x, + m_flip_y ? -gm.gmptGlyphOrigin.y : gm.gmptGlyphOrigin.y, + m_flip_y, m_scanline_bin, m_scanlines_bin); m_bounds.x1 = m_scanlines_bin.min_x(); m_bounds.y1 = m_scanlines_bin.min_y(); m_bounds.x2 = m_scanlines_bin.max_x() + 1; @@ -549,9 +550,10 @@ bool font_engine_win32_tt_base::prepare_glyph(unsigned glyph_code) { case glyph_ren_native_gray8: decompose_win32_glyph_bitmap_gray8( - m_gbuf, gm.gmBlackBoxX, gm.gmBlackBoxY, gm.gmptGlyphOrigin.x, - m_flip_y ? -gm.gmptGlyphOrigin.y : gm.gmptGlyphOrigin.y, - m_flip_y, m_rasterizer, m_scanline_aa, m_scanlines_aa); + m_gbuf, gm.gmBlackBoxX, gm.gmBlackBoxY, + gm.gmptGlyphOrigin.x, + m_flip_y ? -gm.gmptGlyphOrigin.y : gm.gmptGlyphOrigin.y, + m_flip_y, m_rasterizer, m_scanline_aa, m_scanlines_aa); m_bounds.x1 = m_scanlines_aa.min_x(); m_bounds.y1 = m_scanlines_aa.min_y(); m_bounds.x2 = m_scanlines_aa.max_x() + 1; @@ -685,7 +687,7 @@ void font_engine_win32_tt_base::load_kerning_pairs() { m_max_kerning_pairs = 16384 - 16; } m_num_kerning_pairs = - ::GetKerningPairs(m_dc, m_max_kerning_pairs, m_kerning_pairs); + ::GetKerningPairs(m_dc, m_max_kerning_pairs, m_kerning_pairs); if (m_num_kerning_pairs) { // Check to see if the kerning pairs are sorted and diff --git a/Onyx2D/O2AffineTransform.m b/Onyx2D/O2AffineTransform.m index a091993b..68c7a7e3 100644 --- a/Onyx2D/O2AffineTransform.m +++ b/Onyx2D/O2AffineTransform.m @@ -30,7 +30,7 @@ O2AffineTransform O2AffineTransformMake(O2Float a, O2Float b, O2Float c, O2AffineTransform O2AffineTransformMakeRotation(O2Float radians) { O2AffineTransform xform = { - cos(radians), sin(radians), -sin(radians), cos(radians), 0, 0}; + cos(radians), sin(radians), -sin(radians), cos(radians), 0, 0}; return xform; } diff --git a/Onyx2D/O2BitmapContext.m b/Onyx2D/O2BitmapContext.m index 9434fb42..4e80d692 100644 --- a/Onyx2D/O2BitmapContext.m +++ b/Onyx2D/O2BitmapContext.m @@ -29,11 +29,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithSurface: (O2Surface *) surface flipped: (BOOL) flipped { O2AffineTransform flip = - flipped - ? O2AffineTransformIdentity - : O2AffineTransformMake(1, 0, 0, -1, 0, O2ImageGetHeight(surface)); + flipped ? O2AffineTransformIdentity + : O2AffineTransformMake(1, 0, 0, -1, 0, + O2ImageGetHeight(surface)); O2GState *initialState = - [[[O2GState alloc] initWithDeviceTransform: flip] autorelease]; + [[[O2GState alloc] initWithDeviceTransform: flip] autorelease]; [super initWithGraphicsState: initialState]; _surface = [surface retain]; @@ -45,23 +45,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithBytes: (void *) bytes - width: (size_t) width - height: (size_t) height - bitsPerComponent: (size_t) bitsPerComponent - bytesPerRow: (size_t) bytesPerRow - colorSpace: (O2ColorSpaceRef) colorSpace - bitmapInfo: (O2BitmapInfo) bitmapInfo - releaseCallback: (O2BitmapContextReleaseDataCallback) releaseCallback - releaseInfo: (void *) releaseInfo + width: (size_t) width + height: (size_t) height + bitsPerComponent: (size_t) bitsPerComponent + bytesPerRow: (size_t) bytesPerRow + colorSpace: (O2ColorSpaceRef) colorSpace + bitmapInfo: (O2BitmapInfo) bitmapInfo + releaseCallback: (O2BitmapContextReleaseDataCallback) releaseCallback + releaseInfo: (void *) releaseInfo { O2Surface *surface = - [[[self surfaceClass] alloc] initWithBytes: bytes - width: width - height: height - bitsPerComponent: bitsPerComponent - bytesPerRow: bytesPerRow - colorSpace: colorSpace - bitmapInfo: bitmapInfo]; + [[[self surfaceClass] alloc] initWithBytes: bytes + width: width + height: height + bitsPerComponent: bitsPerComponent + bytesPerRow: bytesPerRow + colorSpace: colorSpace + bitmapInfo: bitmapInfo]; [self initWithSurface: surface flipped: NO]; [surface release]; @@ -78,9 +78,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } O2ContextRef O2BitmapContextCreateWithData( - void *data, size_t width, size_t height, size_t bitsPerComponent, - size_t bytesPerRow, O2ColorSpaceRef colorSpace, O2BitmapInfo bitmapInfo, - O2BitmapContextReleaseDataCallback releaseCallback, void *releaseInfo) + void *data, size_t width, size_t height, size_t bitsPerComponent, + size_t bytesPerRow, O2ColorSpaceRef colorSpace, O2BitmapInfo bitmapInfo, + O2BitmapContextReleaseDataCallback releaseCallback, void *releaseInfo) { return [O2Context createWithBytes: data width: width @@ -128,9 +128,9 @@ size_t O2BitmapContextGetBitsPerComponent(O2ContextRef selfX) { } size_t O2BitmapContextGetBitsPerPixel(O2ContextRef self) { - size_t result = - O2BitmapContextGetBitsPerComponent(self) * - O2ColorSpaceGetNumberOfComponents(O2BitmapContextGetColorSpace(self)); + size_t result = O2BitmapContextGetBitsPerComponent(self) * + O2ColorSpaceGetNumberOfComponents( + O2BitmapContextGetColorSpace(self)); switch (O2BitmapContextGetAlphaInfo(self)) { diff --git a/Onyx2D/O2ClipPhase.m b/Onyx2D/O2ClipPhase.m index 5f0e62f1..4fc7aa42 100644 --- a/Onyx2D/O2ClipPhase.m +++ b/Onyx2D/O2ClipPhase.m @@ -15,8 +15,8 @@ O2ClipPhase *O2ClipPhaseInitWithNonZeroPath(O2ClipPhase *self, O2Path *path) { } - initWithMask: (O2Image *) mask - rect: (O2Rect) rect - transform: (O2AffineTransform) transform + rect: (O2Rect) rect + transform: (O2AffineTransform) transform { _type = O2ClipPhaseMask; _object = [mask retain]; diff --git a/Onyx2D/O2ClipState.m b/Onyx2D/O2ClipState.m index b3c4da07..8c2672b8 100644 --- a/Onyx2D/O2ClipState.m +++ b/Onyx2D/O2ClipState.m @@ -108,7 +108,7 @@ O2Path *O2ClipStateOnePath(O2ClipState *self) { phase = [[O2ClipPhase allocWithZone: NULL] initWithEOPath: path]; else phase = O2ClipPhaseInitWithNonZeroPath( - [O2ClipPhase allocWithZone: NULL], path); + [O2ClipPhase allocWithZone: NULL], path); if (_phases == nil) _phases = [[NSMutableArray alloc] init]; @@ -129,8 +129,8 @@ O2Path *O2ClipStateOnePath(O2ClipState *self) { } - (void) addMask: (O2Image *) image - inRect: (O2Rect) rect - transform: (O2AffineTransform) transform + inRect: (O2Rect) rect + transform: (O2AffineTransform) transform { O2ClipPhase *phase = [[O2ClipPhase alloc] initWithMask: image rect: rect diff --git a/Onyx2D/O2Color.m b/Onyx2D/O2Color.m index 73e03ff4..a5f62472 100644 --- a/Onyx2D/O2Color.m +++ b/Onyx2D/O2Color.m @@ -32,7 +32,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _pattern = [pattern retain]; _numberOfComponents = O2ColorSpaceGetNumberOfComponents(_colorSpace) + 1; _components = - NSZoneMalloc([self zone], sizeof(O2Float) * _numberOfComponents); + NSZoneMalloc([self zone], sizeof(O2Float) * _numberOfComponents); for (i = 0; i < _numberOfComponents; i++) _components[i] = components[i]; @@ -48,9 +48,9 @@ O2ColorRef O2ColorInitWithColorSpace(O2ColorRef self, self->_colorSpace = [colorSpace retain]; self->_pattern = nil; self->_numberOfComponents = - O2ColorSpaceGetNumberOfComponents(self->_colorSpace) + 1; - self->_components = - NSZoneMalloc([self zone], sizeof(O2Float) * self->_numberOfComponents); + O2ColorSpaceGetNumberOfComponents(self->_colorSpace) + 1; + self->_components = NSZoneMalloc( + [self zone], sizeof(O2Float) * self->_numberOfComponents); for (i = 0; i < self->_numberOfComponents; i++) self->_components[i] = components[i]; @@ -239,9 +239,9 @@ int O2ColorConvertComponentsToDeviceRGB(O2ColorSpaceRef inputSpace, return 1; case kO2ColorSpaceModelLab: - NSLog( - @"O2ColorConvertComponentsToDeviceRGB unimplemented conversion %d", - model); + NSLog(@"O2ColorConvertComponentsToDeviceRGB unimplemented conversion " + @"%d", + model); rgbComponents[0] = 0; rgbComponents[1] = 0; rgbComponents[2] = 0; @@ -251,11 +251,11 @@ int O2ColorConvertComponentsToDeviceRGB(O2ColorSpaceRef inputSpace, case kO2ColorSpaceModelDeviceN: { O2ColorSpace_DeviceN *deviceN = (O2ColorSpace_DeviceN *) inputSpace; size_t deviceNNumberOfComponents = - O2ColorSpaceGetNumberOfComponents(deviceN); + O2ColorSpaceGetNumberOfComponents(deviceN); O2ColorSpaceRef altSpace = [deviceN alternateSpace]; O2FunctionRef tintTransform = [deviceN tintTransform]; size_t altNumberOfComponents = - O2ColorSpaceGetNumberOfComponents(altSpace) + 1; + O2ColorSpaceGetNumberOfComponents(altSpace) + 1; CGFloat altComponents[altNumberOfComponents]; if (deviceNNumberOfComponents != 1) { @@ -273,9 +273,9 @@ int O2ColorConvertComponentsToDeviceRGB(O2ColorSpaceRef inputSpace, } break; case kO2ColorSpaceModelIndexed: - NSLog( - @"O2ColorConvertComponentsToDeviceRGB unimplemented conversion %d", - model); + NSLog(@"O2ColorConvertComponentsToDeviceRGB unimplemented conversion " + @"%d", + model); rgbComponents[0] = 0; rgbComponents[1] = 0; rgbComponents[2] = 0; @@ -284,9 +284,9 @@ int O2ColorConvertComponentsToDeviceRGB(O2ColorSpaceRef inputSpace, case kO2ColorSpaceModelPattern: default: - NSLog( - @"O2ColorConvertComponentsToDeviceRGB unimplemented conversion %d", - model); + NSLog(@"O2ColorConvertComponentsToDeviceRGB unimplemented conversion " + @"%d", + model); rgbComponents[0] = 0; rgbComponents[1] = 0; rgbComponents[2] = 0; diff --git a/Onyx2D/O2ColorSpace+PDF.m b/Onyx2D/O2ColorSpace+PDF.m index af493944..727382ec 100644 --- a/Onyx2D/O2ColorSpace+PDF.m +++ b/Onyx2D/O2ColorSpace+PDF.m @@ -71,7 +71,7 @@ } if ((baseColorSpace = [O2ColorSpace - createColorSpaceFromPDFObject: baseObject]) == NULL) { + createColorSpaceFromPDFObject: baseObject]) == NULL) { NSLog(@"Indexed color space invalid base %@", baseObject); return nil; } @@ -86,7 +86,7 @@ return nil; } baseNumberOfComponents = - O2ColorSpaceGetNumberOfComponents(baseColorSpace); + O2ColorSpaceGetNumberOfComponents(baseColorSpace); tableSize = baseNumberOfComponents * (hival + 1); if ([colorSpaceArray getStringAtIndex: 3 value: &tableString]) { @@ -96,10 +96,10 @@ return nil; } return [[O2ColorSpace_indexed alloc] - initWithColorSpace: baseColorSpace - hival: hival - bytes: (const unsigned char *) - [tableString bytes]]; + initWithColorSpace: baseColorSpace + hival: hival + bytes: (const unsigned char *) + [tableString bytes]]; } else if ([colorSpaceArray getStreamAtIndex: 3 value: &tableStream]) { NSData *data = [tableStream data]; @@ -110,9 +110,10 @@ return nil; } return [[O2ColorSpace_indexed alloc] - initWithColorSpace: baseColorSpace - hival: hival - bytes: (const unsigned char *) [data bytes]]; + initWithColorSpace: baseColorSpace + hival: hival + bytes: (const unsigned char *) + [data bytes]]; } else { NSLog(@"indexed color space table invalid"); } @@ -175,7 +176,7 @@ } O2ColorSpaceRef alternateSpace = - [self createColorSpaceFromPDFObject: alternateDictionary]; + [self createColorSpaceFromPDFObject: alternateDictionary]; if (alternateSpace == NULL) O2PDFError(__FILE__, __LINE__, @@ -185,11 +186,11 @@ if ([tintObject objectType] == kO2PDFObjectTypeDictionary) tintFunction = [O2Function - createFunctionWithDictionary: (O2PDFDictionary *) - tintObject]; + createFunctionWithDictionary: (O2PDFDictionary *) + tintObject]; else if ([tintObject objectType] == kO2PDFObjectTypeStream) tintFunction = [O2Function - createFunctionWithStream: (O2PDFStream *) tintObject]; + createFunctionWithStream: (O2PDFStream *) tintObject]; else O2PDFError(__FILE__, __LINE__, @"tintFunction unknown type %d", [tintObject objectType]); @@ -231,7 +232,7 @@ } O2ColorSpaceRef alternateSpace = - [self createColorSpaceFromPDFObject: alternateDictionary]; + [self createColorSpaceFromPDFObject: alternateDictionary]; if (alternateSpace == NULL) O2PDFError(__FILE__, __LINE__, @"unable to intiialize alternateSpace"); @@ -240,11 +241,11 @@ if ([tintObject objectType] == kO2PDFObjectTypeDictionary) tintFunction = [O2Function - createFunctionWithDictionary: (O2PDFDictionary *) - tintObject]; + createFunctionWithDictionary: (O2PDFDictionary *) + tintObject]; else if ([tintObject objectType] == kO2PDFObjectTypeStream) tintFunction = [O2Function - createFunctionWithStream: (O2PDFStream *) tintObject]; + createFunctionWithStream: (O2PDFStream *) tintObject]; else O2PDFError(__FILE__, __LINE__, @"tintFunction unknown type %d", [tintObject objectType]); diff --git a/Onyx2D/O2ColorSpace.m b/Onyx2D/O2ColorSpace.m index fd818331..d1b260cc 100644 --- a/Onyx2D/O2ColorSpace.m +++ b/Onyx2D/O2ColorSpace.m @@ -26,30 +26,30 @@ const CFStringRef kO2ColorSpaceGenericGray = CFSTR("kCGColorSpaceGenericGray"); const CFStringRef kO2ColorSpaceGenericRGB = CFSTR("kCGColorSpaceGenericRGB"); const CFStringRef kO2ColorSpaceGenericCMYK = CFSTR("kCGColorSpaceGenericCMYK"); const CFStringRef kO2ColorSpaceGenericRGBLinear = - CFSTR("kCGColorSpaceGenericRGBLinear"); + CFSTR("kCGColorSpaceGenericRGBLinear"); const CFStringRef kO2ColorSpaceAdobeRGB1998 = - CFSTR("kCGColorSpaceAdobeRGB1998"); + CFSTR("kCGColorSpaceAdobeRGB1998"); const CFStringRef kO2ColorSpaceSRGB = CFSTR("kCGColorSpaceSRGB"); const CFStringRef kO2ColorSpaceGenericGrayGamma2_2 = - CFSTR("kCGColorSpaceGenericGrayGamma2_2"); + CFSTR("kCGColorSpaceGenericGrayGamma2_2"); const CFStringRef kO2ColorSpaceGenericXYZ = CFSTR("kCGColorSpaceGenericXYZ"); const CFStringRef kO2ColorSpaceGenericLab = CFSTR("kCGColorSpaceGenericLab"); const CFStringRef kO2ColorSpaceACESCGLinear = - CFSTR("kCGColorSpaceACESCGLinear"); + CFSTR("kCGColorSpaceACESCGLinear"); const CFStringRef kO2ColorSpaceITUR_709 = CFSTR("kCGColorSpaceITUR_709"); const CFStringRef kO2ColorSpaceITUR_2020 = CFSTR("kCGColorSpaceITUR_2020"); const CFStringRef kO2ColorSpaceROMMRGB = CFSTR("kCGColorSpaceROMMRGB"); const CFStringRef kO2ColorSpaceDCIP3 = CFSTR("kCGColorSpaceDCIP3"); const CFStringRef kO2ColorSpaceExtendedSRGB = - CFSTR("kCGColorSpaceExtendedSRGB"); + CFSTR("kCGColorSpaceExtendedSRGB"); const CFStringRef kO2ColorSpaceLinearSRGB = CFSTR("kCGColorSpaceLinearSRGB"); const CFStringRef kO2ColorSpaceExtendedLinearSRGB = - CFSTR("kCGColorSpaceExtendedLinearSRGB"); + CFSTR("kCGColorSpaceExtendedLinearSRGB"); const CFStringRef kO2ColorSpaceExtendedGray = - CFSTR("kCGColorSpaceExtendedGray"); + CFSTR("kCGColorSpaceExtendedGray"); const CFStringRef kO2ColorSpaceLinearGray = CFSTR("kCGColorSpaceLinearGray"); const CFStringRef kO2ColorSpaceExtendedLinearGray = - CFSTR("kCGColorSpaceExtendedLinearGray"); + CFSTR("kCGColorSpaceExtendedLinearGray"); @implementation O2ColorSpace @@ -188,7 +188,7 @@ O2ColorSpaceModel O2ColorSpaceGetModel(O2ColorSpaceRef self) { - (NSString *) description { return [NSString - stringWithFormat: @"<%@: %p, type=%d>", [self class], self, _type]; + stringWithFormat: @"<%@: %p, type=%d>", [self class], self, _type]; } @end @@ -199,8 +199,8 @@ O2ColorSpaceModel O2ColorSpaceGetModel(O2ColorSpaceRef self) { hival: (size_t) hival bytes: (const unsigned char *) bytes { - size_t i, - max = O2ColorSpaceGetNumberOfComponents(baseColorSpace) * (hival + 1); + size_t i, max = O2ColorSpaceGetNumberOfComponents(baseColorSpace) * + (hival + 1); _type = kO2ColorSpaceModelIndexed; _base = [baseColorSpace retain]; diff --git a/Onyx2D/O2Context.m b/Onyx2D/O2Context.m index 4dfe1913..6a9c926e 100644 --- a/Onyx2D/O2Context.m +++ b/Onyx2D/O2Context.m @@ -38,14 +38,14 @@ void O2ContextDefaultShowText(O2ContextRef self, const char *text, @implementation O2Context - initWithBytes: (void *) bytes - width: (size_t) width - height: (size_t) height - bitsPerComponent: (size_t) bitsPerComponent - bytesPerRow: (size_t) bytesPerRow - colorSpace: (O2ColorSpaceRef) colorSpace - bitmapInfo: (O2BitmapInfo) bitmapInfo - releaseCallback: (O2BitmapContextReleaseDataCallback) releaseCallback - releaseInfo: (void *) releaseInfo + width: (size_t) width + height: (size_t) height + bitsPerComponent: (size_t) bitsPerComponent + bytesPerRow: (size_t) bytesPerRow + colorSpace: (O2ColorSpaceRef) colorSpace + bitmapInfo: (O2BitmapInfo) bitmapInfo + releaseCallback: (O2BitmapContextReleaseDataCallback) releaseCallback + releaseInfo: (void *) releaseInfo { return nil; } @@ -65,7 +65,7 @@ void O2ContextDefaultShowText(O2ContextRef self, const char *text, _textMatrix = O2AffineTransformIdentity; _showTextFunction = O2ContextDefaultShowText; _showGlyphsFunction = (O2ContextShowGlyphsFunction) - [self methodForSelector: @selector(showGlyphs:advances:count:)]; + [self methodForSelector: @selector(showGlyphs:advances:count:)]; return self; } @@ -104,7 +104,7 @@ O2ColorRef O2ContextFillColor(O2ContextRef self) { - (void) setStrokeAlpha: (O2Float) alpha { O2ColorRef color = - O2ColorCreateCopyWithAlpha(O2ContextStrokeColor(self), alpha); + O2ColorCreateCopyWithAlpha(O2ContextStrokeColor(self), alpha); O2ContextSetStrokeColorWithColor(self, color); O2ColorRelease(color); } @@ -131,7 +131,7 @@ O2ColorRef O2ContextFillColor(O2ContextRef self) { - (void) setFillAlpha: (O2Float) alpha { O2ColorRef color = - O2ColorCreateCopyWithAlpha(O2ContextFillColor(self), alpha); + O2ColorCreateCopyWithAlpha(O2ContextFillColor(self), alpha); O2ContextSetFillColorWithColor(self, color); O2ColorRelease(color); } @@ -356,7 +356,7 @@ void O2ContextMoveToPoint(O2ContextRef self, O2Float x, O2Float y) { return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathMoveToPoint(self->_path, &ctm, x, y); } @@ -366,7 +366,7 @@ void O2ContextAddLineToPoint(O2ContextRef self, O2Float x, O2Float y) { return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathAddLineToPoint(self->_path, &ctm, x, y); } @@ -378,7 +378,7 @@ void O2ContextAddCurveToPoint(O2ContextRef self, O2Float cx1, O2Float cy1, return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathAddCurveToPoint(self->_path, &ctm, cx1, cy1, cx2, cy2, x, y); } @@ -390,7 +390,7 @@ void O2ContextAddQuadCurveToPoint(O2ContextRef self, O2Float cx1, O2Float cy1, return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathAddQuadCurveToPoint(self->_path, &ctm, cx1, cy1, x, y); } @@ -402,7 +402,7 @@ void O2ContextAddLines(O2ContextRef self, const O2Point *points, return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathAddLines(self->_path, &ctm, points, count); } @@ -412,7 +412,7 @@ void O2ContextAddRect(O2ContextRef self, O2Rect rect) { return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathAddRect(self->_path, &ctm, rect); } @@ -423,7 +423,7 @@ void O2ContextAddRects(O2ContextRef self, const O2Rect *rects, NSUInteger count) return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathAddRects(self->_path, &ctm, rects, count); } @@ -435,7 +435,7 @@ void O2ContextAddArc(O2ContextRef self, O2Float x, O2Float y, O2Float radius, return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathAddArc(self->_path, &ctm, x, y, radius, startRadian, endRadian, clockwise); @@ -448,7 +448,7 @@ void O2ContextAddArcToPoint(O2ContextRef self, O2Float x1, O2Float y1, return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathAddArcToPoint(self->_path, &ctm, x1, y1, x2, y2, radius); } @@ -458,7 +458,7 @@ void O2ContextAddEllipseInRect(O2ContextRef self, O2Rect rect) { return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathAddEllipseInRect(self->_path, &ctm, rect); } @@ -468,7 +468,7 @@ void O2ContextAddPath(O2ContextRef self, O2PathRef path) { return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathAddPath(self->_path, &ctm, path); } @@ -619,7 +619,7 @@ void O2ContextTranslateCTM(O2ContextRef self, O2Float translatex, return; O2ContextConcatCTM( - self, O2AffineTransformMakeTranslation(translatex, translatey)); + self, O2AffineTransformMakeTranslation(translatex, translatey)); } void O2ContextScaleCTM(O2ContextRef self, O2Float scalex, O2Float scaley) { @@ -692,7 +692,7 @@ void O2ContextClipToRect(O2ContextRef self, O2Rect rect) { return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathReset(self->_path); O2PathAddRect(self->_path, &ctm, rect); @@ -706,7 +706,7 @@ void O2ContextClipToRects(O2ContextRef self, const O2Rect *rects, return; O2AffineTransform ctm = - O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self)); O2PathReset(self->_path); O2PathAddRects(self->_path, &ctm, rects, count); @@ -755,7 +755,7 @@ void O2ContextSetStrokeColor(O2ContextRef self, const O2Float *components) { return; O2ColorSpaceRef colorSpace = - O2ColorGetColorSpace(O2ContextStrokeColor(self)); + O2ColorGetColorSpace(O2ContextStrokeColor(self)); O2ColorRef color = O2ColorCreate(colorSpace, components); O2ContextSetStrokeColorWithColor(self, color); @@ -1511,7 +1511,7 @@ void O2ContextSetAllowsFontSmoothing(O2ContextRef self, } void O2ContextSetAllowsFontSubpixelQuantization( - O2ContextRef self, BOOL allowsFontSubpixelQuantization) + O2ContextRef self, BOOL allowsFontSubpixelQuantization) { self->_allowsFontSubpixelQuantization = allowsFontSubpixelQuantization; } @@ -1523,7 +1523,7 @@ void O2ContextSetShouldSubpixelQuantizeFonts(O2ContextRef self, } void O2ContextSetAllowsFontSubpixelPositioning( - O2ContextRef self, BOOL allowsFontSubpixelPositioning) + O2ContextRef self, BOOL allowsFontSubpixelPositioning) { self->_allowsFontSubpixelPositioning = allowsFontSubpixelPositioning; } diff --git a/Onyx2D/O2Context_builtin.m b/Onyx2D/O2Context_builtin.m index a784823d..0d6a3262 100644 --- a/Onyx2D/O2Context_builtin.m +++ b/Onyx2D/O2Context_builtin.m @@ -68,9 +68,9 @@ void O2DContextClipAndFillEdges(O2Context_builtin *self, int fillRuleMask); _clipContext = nil; O2PaintRef paint = - [[O2Paint_color alloc] initWithGray: 0 - alpha: 1 - surfaceToPaintTransform: O2AffineTransformIdentity]; + [[O2Paint_color alloc] initWithGray: 0 + alpha: 1 + surfaceToPaintTransform: O2AffineTransformIdentity]; O2ContextSetupPaintAndBlendMode(self, paint, kO2BlendModeNormal); @@ -82,7 +82,7 @@ void O2DContextClipAndFillEdges(O2Context_builtin *self, int fillRuleMask); _edgeCapacity = 256; _edges = NSZoneMalloc(NULL, self->_edgeCapacity * sizeof(Edge *)); _sortCache = - NSZoneMalloc(NULL, (self->_edgeCapacity / 2 + 1) * sizeof(Edge *)); + NSZoneMalloc(NULL, (self->_edgeCapacity / 2 + 1) * sizeof(Edge *)); sampleSizeShift = 0; numSamples = 0; @@ -124,8 +124,8 @@ void O2DContextClipAndFillEdges(O2Context_builtin *self, int fillRuleMask); } - (void) setWidth: (size_t) width - height: (size_t) height - reallocateOnlyIfRequired: (BOOL) roir + height: (size_t) height + reallocateOnlyIfRequired: (BOOL) roir { [_surface setWidth: width height: height reallocateOnlyIfRequired: roir]; [self reallocateForSurface]; @@ -137,13 +137,13 @@ void O2DContextClipAndFillEdges(O2Context_builtin *self, int fillRuleMask); - (O2Surface *) createSurfaceWithWidth: (size_t) width height: (size_t) height { return [[[self surfaceClass] alloc] - initWithBytes: NULL - width: width - height: height - bitsPerComponent: O2ImageGetBitsPerComponent(_surface) - bytesPerRow: 0 - colorSpace: O2ImageGetColorSpace(_surface) - bitmapInfo: O2ImageGetBitmapInfo(_surface)]; + initWithBytes: NULL + width: width + height: height + bitsPerComponent: O2ImageGetBitsPerComponent(_surface) + bytesPerRow: 0 + colorSpace: O2ImageGetColorSpace(_surface) + bitmapInfo: O2ImageGetBitmapInfo(_surface)]; } - (O2Size) size { @@ -180,18 +180,18 @@ void O2DContextClipAndFillEdges(O2Context_builtin *self, int fillRuleMask); if (O2ContextCurrentGState(self)->_shadowKernel) { O2Surface *shadow = - [self createSurfaceWithWidth: O2ImageGetWidth(_surface) - height: O2ImageGetHeight(_surface)]; + [self createSurfaceWithWidth: O2ImageGetWidth(_surface) + height: O2ImageGetHeight(_surface)]; O2SurfaceGaussianBlur(shadow, O2LayerGetSurface(layer), O2ContextCurrentGState(self)->_shadowKernel, O2ContextCurrentGState(self)->_shadowColor); O2ContextDrawImage( - self, - O2RectMake(O2ContextCurrentGState(self)->_shadowOffset.width, - O2ContextCurrentGState(self)->_shadowOffset.height, - size.width, size.height), - shadow); + self, + O2RectMake(O2ContextCurrentGState(self)->_shadowOffset.width, + O2ContextCurrentGState(self)->_shadowOffset.height, + size.width, size.height), + shadow); } O2ContextDrawLayerInRect(self, O2RectMake(0, 0, size.width, size.height), @@ -208,7 +208,7 @@ ONYX2D_STATIC void O2ContextClipViewportToPath(O2Context_builtin *self, O2Path *path) { O2Rect viewport = - O2RectMake(self->_vpx, self->_vpy, self->_vpwidth, self->_vpheight); + O2RectMake(self->_vpx, self->_vpy, self->_vpwidth, self->_vpheight); O2Rect rect = O2PathGetBoundingBox(path); rect = O2RectIntegral(rect); @@ -274,16 +274,16 @@ ONYX2D_STATIC O2Paint *paintFromColor(O2Context_builtin *self, O2ColorRef color, O2Surface *surface = [self createSurfaceWithWidth: size.width height: size.height]; O2BitmapContext *context = - [[[self class] alloc] initWithSurface: surface flipped: NO]; + [[[self class] alloc] initWithSurface: surface flipped: NO]; O2ContextClearRect(context, O2RectMake(0, 0, size.width, size.height)); // do save/restore? probably pointless [pattern drawInContext: context]; result = [[O2Paint_pattern alloc] - initWithImage: surface - surfaceToPaintTransform: surfaceToPaintMatrix - phase: O2GStatePatternPhase(gState)]; + initWithImage: surface + surfaceToPaintTransform: surfaceToPaintMatrix + phase: O2GStatePatternPhase(gState)]; O2ContextRelease(context); [surface release]; @@ -335,13 +335,13 @@ ONYX2D_STATIC O2Paint *paintFromColor(O2Context_builtin *self, O2ColorRef color, if (drawingMode != kO2PathStroke) { O2AffineTransform surfaceToPaintMatrix = - userToSurfaceMatrix; // context->m_pathUserToSurface * - // context->m_fillPaintToUser; + userToSurfaceMatrix; // context->m_pathUserToSurface * + // context->m_fillPaintToUser; surfaceToPaintMatrix = O2AffineTransformInvert(surfaceToPaintMatrix); O2Paint *paint = - paintFromColor(self, gState->_fillColor, surfaceToPaintMatrix); + paintFromColor(self, gState->_fillColor, surfaceToPaintMatrix); O2ContextSetupPaintAndBlendMode(self, paint, gState->_blendMode); O2PaintRelease(paint); @@ -349,9 +349,9 @@ ONYX2D_STATIC O2Paint *paintFromColor(O2Context_builtin *self, O2ColorRef color, VGPathFill(vgPath, userToSurfaceMatrix, self); VGFillRuleMask fillRule = - (drawingMode == kO2PathFill || drawingMode == kO2PathFillStroke) - ? VG_NON_ZERO - : VG_EVEN_ODD; + (drawingMode == kO2PathFill || drawingMode == kO2PathFillStroke) + ? VG_NON_ZERO + : VG_EVEN_ODD; O2DContextClipAndFillEdges(self, fillRule); } @@ -359,11 +359,11 @@ ONYX2D_STATIC O2Paint *paintFromColor(O2Context_builtin *self, O2ColorRef color, if (drawingMode >= kO2PathStroke) { if (gState->_lineWidth > 0.0f) { O2AffineTransform surfaceToPaintMatrix = - userToSurfaceMatrix; // = context->m_pathUserToSurface * - // context->m_strokePaintToUser; + userToSurfaceMatrix; // = context->m_pathUserToSurface * + // context->m_strokePaintToUser; surfaceToPaintMatrix = - O2AffineTransformInvert(surfaceToPaintMatrix); + O2AffineTransformInvert(surfaceToPaintMatrix); O2Paint *paint = paintFromColor(self, gState->_strokeColor, surfaceToPaintMatrix); @@ -414,12 +414,12 @@ ONYX2D_STATIC O2Paint *paintFromColor(O2Context_builtin *self, O2ColorRef color, if ([shading isAxial]) paint = [[O2Paint_axialGradient alloc] - initWithShading: shading - deviceTransform: gState->_deviceSpaceTransform]; + initWithShading: shading + deviceTransform: gState->_deviceSpaceTransform]; else paint = [[O2Paint_radialGradient alloc] - initWithShading: shading - deviceTransform: gState->_deviceSpaceTransform]; + initWithShading: shading + deviceTransform: gState->_deviceSpaceTransform]; O2ContextSetupPaintAndBlendMode(self, paint, gState->_blendMode); O2PaintRelease(paint); @@ -429,7 +429,7 @@ ONYX2D_STATIC O2Paint *paintFromColor(O2Context_builtin *self, O2ColorRef color, case O2ClipStateTypeOnePath: case O2ClipStateTypeOneRectOnePath:; VGPath *vgPath = - [[VGPath alloc] initWithKGPath: O2ClipStateOnePath(clipState)]; + [[VGPath alloc] initWithKGPath: O2ClipStateOnePath(clipState)]; VGPathFill(vgPath, O2AffineTransformIdentity, self); break; @@ -441,9 +441,9 @@ ONYX2D_STATIC O2Paint *paintFromColor(O2Context_builtin *self, O2ColorRef color, case O2ClipStateTypeManyPathsAndMasks: O2DContextAddEdge(self, O2PointMake(0, 0), O2PointMake(0, O2ImageGetHeight(_surface))); - O2DContextAddEdge( - self, O2PointMake(O2ImageGetWidth(_surface), 0), - O2PointMake(O2ImageGetWidth(_surface), O2ImageGetHeight(_surface))); + O2DContextAddEdge(self, O2PointMake(O2ImageGetWidth(_surface), 0), + O2PointMake(O2ImageGetWidth(_surface), + O2ImageGetHeight(_surface))); break; } @@ -457,15 +457,15 @@ createImageToSurfaceTransform(O2ImageRef image, O2Rect rect, O2AffineTransform deviceTransform) { O2AffineTransform result = - O2AffineTransformMakeTranslation(rect.origin.x, rect.origin.y); + O2AffineTransformMakeTranslation(rect.origin.x, rect.origin.y); result = O2AffineTransformScale( - result, rect.size.width / (O2Float) O2ImageGetWidth(image), - rect.size.height / (O2Float) O2ImageGetHeight(image)); + result, rect.size.width / (O2Float) O2ImageGetWidth(image), + rect.size.height / (O2Float) O2ImageGetHeight(image)); result = O2AffineTransformConcat(result, deviceTransform); O2AffineTransform i2u = - O2AffineTransformMakeTranslation(0, O2ImageGetHeight(image)); + O2AffineTransformMakeTranslation(0, O2ImageGetHeight(image)); i2u = O2AffineTransformScale(i2u, 1, -1); result = O2AffineTransformConcat(i2u, result); @@ -478,14 +478,14 @@ createImageToSurfaceTransform(O2ImageRef image, O2Rect rect, O2ImageRef softMask = O2ImageGetMask(image); O2AffineTransform imageToSurface = createImageToSurfaceTransform( - image, rect, gState->_deviceSpaceTransform); + image, rect, gState->_deviceSpaceTransform); O2AffineTransform maskToSurface; if (softMask == NULL) maskToSurface = O2AffineTransformIdentity; else maskToSurface = createImageToSurfaceTransform( - softMask, rect, gState->_deviceSpaceTransform); + softMask, rect, gState->_deviceSpaceTransform); // transform image corners into the surface space O2Point p0 = O2PointMake(0, 0); @@ -505,12 +505,12 @@ createImageToSurfaceTransform(O2ImageRef image, O2Rect rect, O2AffineTransform fillPaintToUser = O2AffineTransformIdentity; O2AffineTransform surfaceToPaintMatrix = - O2AffineTransformConcat(imageToSurface, fillPaintToUser); + O2AffineTransformConcat(imageToSurface, fillPaintToUser); surfaceToPaintMatrix = O2AffineTransformInvert(surfaceToPaintMatrix); O2Paint *paint = - paintFromColor(self, gState->_fillColor, surfaceToPaintMatrix); + paintFromColor(self, gState->_fillColor, surfaceToPaintMatrix); O2InterpolationQuality iq; if (gState->_interpolationQuality == kO2InterpolationDefault) iq = kO2InterpolationLow; @@ -518,13 +518,13 @@ createImageToSurfaceTransform(O2ImageRef image, O2Rect rect, iq = gState->_interpolationQuality; O2Paint *imagePaint = [[O2Paint_image allocWithZone: NULL] - initWithImage: image - mask: softMask - mode: VG_DRAW_IMAGE_NORMAL - paint: paint - interpolationQuality: iq - surfaceToImage: O2AffineTransformInvert(imageToSurface) - surfaceToMask: O2AffineTransformInvert(maskToSurface)]; + initWithImage: image + mask: softMask + mode: VG_DRAW_IMAGE_NORMAL + paint: paint + interpolationQuality: iq + surfaceToImage: O2AffineTransformInvert(imageToSurface) + surfaceToMask: O2AffineTransformInvert(maskToSurface)]; O2ContextSetupPaintAndBlendMode(self, imagePaint, gState->_blendMode); @@ -588,8 +588,8 @@ void O2DContextAddEdge(O2Context_builtin *self, const O2Point v0, self->_edges = NSZoneRealloc(NULL, self->_edges, self->_edgeCapacity * sizeof(Edge *)); self->_sortCache = - NSZoneRealloc(NULL, self->_sortCache, - (self->_edgeCapacity / 2 + 1) * sizeof(Edge *)); + NSZoneRealloc(NULL, self->_sortCache, + (self->_edgeCapacity / 2 + 1) * sizeof(Edge *)); } self->_edges[self->_edgeCount] = edge; self->_edgeCount++; @@ -668,8 +668,11 @@ void O2RasterizerSetShouldAntialias(O2Context_builtin *self, BOOL antialias, } } -ONYX2D_STATIC void O2ApplyCoverageAndMaskToSpan_largb32f_PRE( - O2argb32f *dst, int icoverage, O2Float *mask, O2argb32f *src, int length) +ONYX2D_STATIC void O2ApplyCoverageAndMaskToSpan_largb32f_PRE(O2argb32f *dst, + int icoverage, + O2Float *mask, + O2argb32f *src, + int length) { int i; @@ -707,8 +710,8 @@ ONYX2D_STATIC void O2ApplyCoverageToSpan_largb32f_PRE(O2argb32f *dst, * to make sure we cover the entire span so we loop until the span is complete. */ ONYX2D_STATIC_INLINE void O2RasterizeWriteCoverageSpan8888_Normal( - O2Surface *surface, O2Surface *mask, O2Paint *paint, int x, int y, - int coverage, int length, O2BlendSpan_argb8u blendFunction) + O2Surface *surface, O2Surface *mask, O2Paint *paint, int x, int y, + int coverage, int length, O2BlendSpan_argb8u blendFunction) { O2argb8u *dst = __builtin_alloca(length * sizeof(O2argb8u)); O2argb8u *direct = surface->_read_argb8u(surface, x, y, dst, length); @@ -743,8 +746,8 @@ ONYX2D_STATIC_INLINE void O2RasterizeWriteCoverageSpan8888_Normal( } ONYX2D_STATIC_INLINE void O2RasterizeWriteCoverageSpan8888_Copy( - O2Surface *surface, O2Surface *mask, O2Paint *paint, int x, int y, - int coverage, int length, O2BlendSpan_argb8u blendFunction) + O2Surface *surface, O2Surface *mask, O2Paint *paint, int x, int y, + int coverage, int length, O2BlendSpan_argb8u blendFunction) { O2argb8u *dst = __builtin_alloca(length * sizeof(O2argb8u)); O2argb8u *direct = surface->_read_argb8u(surface, x, y, dst, length); @@ -1088,8 +1091,8 @@ void O2DContextFillEdgesOnSurface(O2Context_builtin *self, O2Surface *surface, } #endif self->_writeCoverageFunction( - surface, mask, paint, node->scanx, scany, - node->coverage, node->length, self->_blendFunction); + surface, mask, paint, node->scanx, scany, + node->coverage, node->length, self->_blendFunction); } continue; } @@ -1137,8 +1140,8 @@ void O2DContextFillEdgesOnSurface(O2Context_builtin *self, O2Surface *surface, O2Float normalX = edge->v0.y - edge->v1.y; O2Float normalY = edge->v0.x - edge->v1.x; - O2Float pcxnormal = - (scanx - edge->v0.x) * normalX - (scany - edge->v0.y) * normalY; + O2Float pcxnormal = (scanx - edge->v0.x) * normalX - + (scany - edge->v0.y) * normalY; int *windptr = winding + (scanx << shiftNumberOfSamples); @@ -1205,8 +1208,8 @@ void O2DContextFillEdgesOnSurface(O2Context_builtin *self, O2Surface *surface, int accum = 0; - int *windptr = - winding + ((increase - self->_increase) << shiftNumberOfSamples); + int *windptr = winding + + ((increase - self->_increase) << shiftNumberOfSamples); int *windend = windptr + numberOfSamples; CoverageNode *node; @@ -1309,7 +1312,7 @@ void O2DContextFillEdgesOnSurface(O2Context_builtin *self, O2Surface *surface, void O2DContextClipAndFillEdges(O2Context_builtin *self, int fillRuleMask) { O2Image *mask = - (self->_clipContext != nil) ? self->_clipContext->_surface : nil; + (self->_clipContext != nil) ? self->_clipContext->_surface : nil; O2Surface *surface; if ([self->_layerStack count] > 0) @@ -1341,7 +1344,7 @@ void O2ContextSetupPaintAndBlendMode(O2Context_builtin *self, O2PaintRef paint, self->_blend_argb8u_PRE = O2BlendSpanNormal_8888; self->_blend_argb32f_PRE = O2BlendSpanNormal_ffff; self->_writeCoverage_argb8u_PRE = - O2RasterizeWriteCoverageSpan8888_Normal; + O2RasterizeWriteCoverageSpan8888_Normal; break; case kO2BlendModeMultiply: diff --git a/Onyx2D/O2Context_builtin_FT.m b/Onyx2D/O2Context_builtin_FT.m index 53dcaf3b..a8bf3fa6 100644 --- a/Onyx2D/O2Context_builtin_FT.m +++ b/Onyx2D/O2Context_builtin_FT.m @@ -13,7 +13,7 @@ colorSpace: (O2ColorSpaceRef) colorSpace bitmapInfo: (O2BitmapInfo) bitmapInfo releaseCallback: - (O2BitmapContextReleaseDataCallback) releaseCallback + (O2BitmapContextReleaseDataCallback) releaseCallback releaseInfo: (void *) releaseInfo { @@ -123,13 +123,13 @@ static void renderFreeTypeBitmap(O2Context_builtin_FT *self, O2Surface *surface, // We're going to advance these pointers as we move along this row. unsigned char *coverage = - bitmap->buffer + (curY - y) * fullWidth + (curX - x); + bitmap->buffer + (curY - y) * fullWidth + (curX - x); O2argb8u *src = srcBuffer; O2argb8u *dst = dstBuffer; // Try to get direct access to the surface data. - O2argb8u *direct = - surface->_read_argb8u(surface, curX, curY, dst, remainingLength); + O2argb8u *direct = surface->_read_argb8u(surface, curX, curY, dst, + remainingLength); // If that succeeded, write there directly with no temporary buffer. if (direct != NULL) dst = direct; @@ -183,9 +183,9 @@ static void renderFreeTypeBitmap(O2Context_builtin_FT *self, O2Surface *surface, O2Float scaleX = sqrt((Trm.a * Trm.a) + (Trm.c * Trm.c)); O2Float scaleY = sqrt((Trm.b * Trm.b) + (Trm.d * Trm.d)); O2AffineTransform scalingTransform = - O2AffineTransformMakeScale(scaleX, scaleY); + O2AffineTransformMakeScale(scaleX, scaleY); O2Size fontSize = O2SizeApplyAffineTransform( - O2SizeMake(0, O2GStatePointSize(gState)), scalingTransform); + O2SizeMake(0, O2GStatePointSize(gState)), scalingTransform); [self establishFontStateInDeviceIfDirty]; @@ -204,7 +204,7 @@ static void renderFreeTypeBitmap(O2Context_builtin_FT *self, O2Surface *surface, FT_GlyphSlot slot = face->glyph; if ((ftError = - FT_Set_Char_Size(face, 0, fontSize.height * 64, 72.0, 72.0))) { + FT_Set_Char_Size(face, 0, fontSize.height * 64, 72.0, 72.0))) { NSLog(@"FT_Set_Char_Size returned %d", ftError); O2SurfaceUnlock(_surface); return; diff --git a/Onyx2D/O2Context_distill.m b/Onyx2D/O2Context_distill.m index 58d2ae08..4a70afbf 100644 --- a/Onyx2D/O2Context_distill.m +++ b/Onyx2D/O2Context_distill.m @@ -12,7 +12,7 @@ static void O2ContextDistillShowText(O2ContextRef self, const char *text, O2AffineTransform Trm = O2ContextGetTextRenderingMatrix(self); NSPoint point = O2PointApplyAffineTransform(NSMakePoint(0, 0), Trm); O2Size fontSize = O2SizeApplyAffineTransform( - O2SizeMake(0, O2GStatePointSize(gState)), Trm); + O2SizeMake(0, O2GStatePointSize(gState)), Trm); O2Encoding *encoding = [gState encoding]; O2PDFCharWidths *widths = [gState pdfCharWidths]; O2Glyph glyphs[length]; @@ -61,10 +61,10 @@ static void O2ContextDistillShowText(O2ContextRef self, const char *text, O2ContextConcatAdvancesToTextMatrix(self, advances, length); [((O2Context_distill *) self)->_delegate - distiller: (O2Context_distill *) self - unicode: unicode - rects: glyphRects - count: length]; + distiller: (O2Context_distill *) self + unicode: unicode + rects: glyphRects + count: length]; } - (void) drawPath: (O2PathDrawingMode) pathMode { diff --git a/Onyx2D/O2DataConsumer.m b/Onyx2D/O2DataConsumer.m index 4cbab5c9..94acb37c 100644 --- a/Onyx2D/O2DataConsumer.m +++ b/Onyx2D/O2DataConsumer.m @@ -40,7 +40,7 @@ static void O2DataConsumerFileReleaseInfoCallback(void *info) { } - initWithInfo: (void *) info - callbacks: (const O2DataConsumerCallbacks *) callbacks + callbacks: (const O2DataConsumerCallbacks *) callbacks { if ((self = [super init])) { _info = info; @@ -66,11 +66,11 @@ static void O2DataConsumerFileReleaseInfoCallback(void *info) { contents: nil attributes: nil]; NSFileHandle *fileHandle = - [NSFileHandle fileHandleForWritingAtPath: path]; + [NSFileHandle fileHandleForWritingAtPath: path]; O2DataConsumerCallbacks callbacks = { - O2DataConsumerFilePutBytesCallback, - O2DataConsumerFileReleaseInfoCallback}; + O2DataConsumerFilePutBytesCallback, + O2DataConsumerFileReleaseInfoCallback}; [fileHandle retain]; // Will be released by the release callback return [self initWithInfo: fileHandle callbacks: &callbacks]; } else { diff --git a/Onyx2D/O2DataProvider.m b/Onyx2D/O2DataProvider.m index fc2f085c..8e80cddb 100644 --- a/Onyx2D/O2DataProvider.m +++ b/Onyx2D/O2DataProvider.m @@ -48,8 +48,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // why doesn't O2DataProvider use CFString's, ugh NSUInteger len = strlen(pathCString); _path = [[[NSFileManager defaultManager] - stringWithFileSystemRepresentation: pathCString - length: len] copy]; + stringWithFileSystemRepresentation: pathCString + length: len] copy]; _inputStream = [[NSInputStream inputStreamWithFileAtPath: _path] retain]; [_inputStream open]; _data = nil; diff --git a/Onyx2D/O2Decoder_TIFF.m b/Onyx2D/O2Decoder_TIFF.m index 1d1b81c8..16307f6e 100644 --- a/Onyx2D/O2Decoder_TIFF.m +++ b/Onyx2D/O2Decoder_TIFF.m @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (BOOL) tracingEnabled { return [[NSUserDefaults standardUserDefaults] - boolForKey: @"NSTIFFTracingEnabled"]; + boolForKey: @"NSTIFFTracingEnabled"]; } - (unsigned) currentOffset { @@ -33,10 +33,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static void seekToOffset(O2Decoder_TIFF *self, unsigned offset) { if (offset >= self->_length) - [NSException - raise: NSInvalidArgumentException - format: @"Attempt to seek past end of TIFF, length=%d,offset=%d", - self->_length, offset]; + [NSException raise: NSInvalidArgumentException + format: @"Attempt to seek past end of TIFF, " + @"length=%d,offset=%d", + self->_length, offset]; self->_position = offset; } @@ -57,9 +57,9 @@ static uint8_t nextUnsigned8(O2Decoder_TIFF *self) { if (self->_position < self->_length) return self->_bytes[self->_position++]; - [NSException - raise: NSInvalidArgumentException - format: @"Attempt to read past end of TIFF, length=%d", self->_length]; + [NSException raise: NSInvalidArgumentException + format: @"Attempt to read past end of TIFF, length=%d", + self->_length]; return 0; } @@ -305,7 +305,7 @@ static void _decodeArrayOfUnsigned32(O2Decoder_TIFF *self, unsigned **valuesp, return [[[NSString alloc] initWithBytes: ascii length: count - 1 encoding: NSISOLatin1StringEncoding] - autorelease]; + autorelease]; } - (unsigned) expectUnsigned16OrUnsigned32 { @@ -372,8 +372,8 @@ static void _decodeArrayOfUnsigned32(O2Decoder_TIFF *self, unsigned **valuesp, seekToOffset(self, offset); - imageFileDirectory = - [[[O2TIFFImageDirectory alloc] initWithTIFFReader: self] autorelease]; + imageFileDirectory = [[[O2TIFFImageDirectory alloc] + initWithTIFFReader: self] autorelease]; [_directory addObject: imageFileDirectory]; @@ -406,8 +406,8 @@ static void _decodeArrayOfUnsigned32(O2Decoder_TIFF *self, unsigned **valuesp, return NO; } - while ((nextEntryOffset = - [self parseImageFileDirectoryAtOffset: nextEntryOffset]) != 0) + while ((nextEntryOffset = [self + parseImageFileDirectoryAtOffset: nextEntryOffset]) != 0) ; NS_HANDLER diff --git a/Onyx2D/O2EXIFDecoder.m b/Onyx2D/O2EXIFDecoder.m index 36f5329b..5d0fc9ac 100644 --- a/Onyx2D/O2EXIFDecoder.m +++ b/Onyx2D/O2EXIFDecoder.m @@ -169,147 +169,149 @@ typedef struct tEXIFTagToLabel { // Put "nil" in the label to ignore the tag static tEXIFTagToLabel EXIFTagToLabel[] = { - {kImage, kImage_ImageDescription, @"ImageDescription"}, - {kImage, kImage_Make, @"Make"}, - {kImage, kImage_Model, @"Model"}, - {kImage, kImage_Orientation, @"Orientation"}, - {kImage, kImage_XResolution, @"XResolution"}, - {kImage, kImage_YResolution, @"YResolution"}, - {kImage, kImage_ResolutionUnit, @"ResolutionUnit"}, - {kImage, kImage_Software, @"Software"}, - {kImage, kImage_DateTime, @"DateTime"}, - {kImage, kImage_Artist, @"Artist"}, - {kImage, kImage_WhitePoint, @"WhitePoint"}, - {kImage, kImage_PrimaryChromaticities, @"PrimaryChromaticities"}, - {kImage, kImage_YCbCrCoefficients, @"YCbCrCoefficients"}, - {kImage, kImage_YCbCrSubSampling, @"YCbCrSubSampling"}, - {kImage, kImage_YCbCrPositioning, @"YCbCrPositioning"}, - {kImage, kImage_ReferenceBlackWhite, @"ReferenceBlackWhite"}, - {kImage, kImage_Copyright, @"Copyright"}, - {kImage, kImage_ExifIFDOffset, 0}, - {kImage, kImage_GPSIFDOffset, 0}, + {kImage, kImage_ImageDescription, @"ImageDescription"}, + {kImage, kImage_Make, @"Make"}, + {kImage, kImage_Model, @"Model"}, + {kImage, kImage_Orientation, @"Orientation"}, + {kImage, kImage_XResolution, @"XResolution"}, + {kImage, kImage_YResolution, @"YResolution"}, + {kImage, kImage_ResolutionUnit, @"ResolutionUnit"}, + {kImage, kImage_Software, @"Software"}, + {kImage, kImage_DateTime, @"DateTime"}, + {kImage, kImage_Artist, @"Artist"}, + {kImage, kImage_WhitePoint, @"WhitePoint"}, + {kImage, kImage_PrimaryChromaticities, @"PrimaryChromaticities"}, + {kImage, kImage_YCbCrCoefficients, @"YCbCrCoefficients"}, + {kImage, kImage_YCbCrSubSampling, @"YCbCrSubSampling"}, + {kImage, kImage_YCbCrPositioning, @"YCbCrPositioning"}, + {kImage, kImage_ReferenceBlackWhite, @"ReferenceBlackWhite"}, + {kImage, kImage_Copyright, @"Copyright"}, + {kImage, kImage_ExifIFDOffset, 0}, + {kImage, kImage_GPSIFDOffset, 0}, - {kTIFF, kTIFF_TIFFNewSubfileType, @"NewSubfileType"}, - {kTIFF, kTIFF_TIFFSubfileType, @"SubfileType"}, - {kTIFF, kTIFF_TIFFImageWidth, @"ImageWidth"}, - {kTIFF, kTIFF_TIFFImageHeight, @"ImageHeight"}, - {kTIFF, kTIFF_TIFFBitsPerSample, @"BitsPerSample"}, - {kTIFF, kTIFF_TIFFCompression, @"Compression"}, - {kTIFF, kTIFF_TIFFPhotometricInterpretation, @"PhotometricInterpretation"}, - {kTIFF, kTIFF_TIFFThreshholding, @"Threshholding"}, - {kTIFF, kTIFF_TIFFCellWidth, @"CellWidth"}, - {kTIFF, kTIFF_TIFFCellLength, @"CellLength"}, - {kTIFF, kTIFF_TIFFFillOrder, @"FillOrder"}, - {kTIFF, kTIFF_TIFFImageDescription, @"ImageDescription"}, - {kTIFF, kTIFF_TIFFMake, @"Make"}, - {kTIFF, kTIFF_TIFFModel, @"Model"}, - {kTIFF, kTIFF_TIFFStripOffsets, 0}, - {kTIFF, kTIFF_TIFFOrientation, @"Orientation"}, - {kTIFF, kTIFF_TIFFSamplesPerPixel, @"SamplesPerPixel"}, - {kTIFF, kTIFF_TIFFRowsPerStrip, @"RowsPerStrip"}, - {kTIFF, kTIFF_TIFFStripByteCounts, @"StripByteCounts"}, - {kTIFF, kTIFF_TIFFMinSampleValue, @"MinSampleValue"}, - {kTIFF, kTIFF_TIFFMaxSampleValue, @"MaxSampleValue"}, - {kTIFF, kTIFF_TIFFXResolution, @"XResolution"}, - {kTIFF, kTIFF_TIFFYResolution, @"YResolution"}, - {kTIFF, kTIFF_TIFFPlanarConfiguration, @"PlanarConfiguration"}, - {kTIFF, kTIFF_TIFFGrayResponseUnit, @"GrayResponseUnit"}, - {kTIFF, kTIFF_TIFFGrayResponseCurve, @"GrayResponseCurve"}, - {kTIFF, kTIFF_TIFFResolutionUnit, @"ResolutionUnit"}, - {kTIFF, kTIFF_TIFFSoftware, @"Software"}, - {kTIFF, kTIFF_TIFFDateTime, @"DateTime"}, - {kTIFF, kTIFF_TIFFArtist, @"Artist"}, - {kTIFF, kTIFF_TIFFHostComputer, @"HostComputer"}, - {kTIFF, kTIFF_TIFFColorMap, @"ColorMap"}, - {kTIFF, kTIFF_TIFFExtraSamples, @"ExtraSamples"}, - {kTIFF, kTIFF_TIFFJFIFOffset, nil}, - {kTIFF, kTIFF_TIFFJFIFLength, nil}, - {kTIFF, kTIFF_TIFFYCbCrCoefficients, @"YCbCrCoefficients"}, - {kTIFF, kTIFF_TIFFYCbCrSubSampling, @"YCbCrSubSampling"}, - {kTIFF, kTIFF_TIFFYCbCrPositioning, @"YCbCrPositioning"}, - {kTIFF, kTIFF_TIFFReferenceBlackWhite, @"ReferenceBlackWhite"}, - {kTIFF, kTIFF_TIFFCopyright, @"Copyright"}, - {kTIFF, kTIFF_TIFFUserComment, @"UserComment"}, + {kTIFF, kTIFF_TIFFNewSubfileType, @"NewSubfileType"}, + {kTIFF, kTIFF_TIFFSubfileType, @"SubfileType"}, + {kTIFF, kTIFF_TIFFImageWidth, @"ImageWidth"}, + {kTIFF, kTIFF_TIFFImageHeight, @"ImageHeight"}, + {kTIFF, kTIFF_TIFFBitsPerSample, @"BitsPerSample"}, + {kTIFF, kTIFF_TIFFCompression, @"Compression"}, + {kTIFF, kTIFF_TIFFPhotometricInterpretation, + @"PhotometricInterpretation"}, + {kTIFF, kTIFF_TIFFThreshholding, @"Threshholding"}, + {kTIFF, kTIFF_TIFFCellWidth, @"CellWidth"}, + {kTIFF, kTIFF_TIFFCellLength, @"CellLength"}, + {kTIFF, kTIFF_TIFFFillOrder, @"FillOrder"}, + {kTIFF, kTIFF_TIFFImageDescription, @"ImageDescription"}, + {kTIFF, kTIFF_TIFFMake, @"Make"}, + {kTIFF, kTIFF_TIFFModel, @"Model"}, + {kTIFF, kTIFF_TIFFStripOffsets, 0}, + {kTIFF, kTIFF_TIFFOrientation, @"Orientation"}, + {kTIFF, kTIFF_TIFFSamplesPerPixel, @"SamplesPerPixel"}, + {kTIFF, kTIFF_TIFFRowsPerStrip, @"RowsPerStrip"}, + {kTIFF, kTIFF_TIFFStripByteCounts, @"StripByteCounts"}, + {kTIFF, kTIFF_TIFFMinSampleValue, @"MinSampleValue"}, + {kTIFF, kTIFF_TIFFMaxSampleValue, @"MaxSampleValue"}, + {kTIFF, kTIFF_TIFFXResolution, @"XResolution"}, + {kTIFF, kTIFF_TIFFYResolution, @"YResolution"}, + {kTIFF, kTIFF_TIFFPlanarConfiguration, @"PlanarConfiguration"}, + {kTIFF, kTIFF_TIFFGrayResponseUnit, @"GrayResponseUnit"}, + {kTIFF, kTIFF_TIFFGrayResponseCurve, @"GrayResponseCurve"}, + {kTIFF, kTIFF_TIFFResolutionUnit, @"ResolutionUnit"}, + {kTIFF, kTIFF_TIFFSoftware, @"Software"}, + {kTIFF, kTIFF_TIFFDateTime, @"DateTime"}, + {kTIFF, kTIFF_TIFFArtist, @"Artist"}, + {kTIFF, kTIFF_TIFFHostComputer, @"HostComputer"}, + {kTIFF, kTIFF_TIFFColorMap, @"ColorMap"}, + {kTIFF, kTIFF_TIFFExtraSamples, @"ExtraSamples"}, + {kTIFF, kTIFF_TIFFJFIFOffset, nil}, + {kTIFF, kTIFF_TIFFJFIFLength, nil}, + {kTIFF, kTIFF_TIFFYCbCrCoefficients, @"YCbCrCoefficients"}, + {kTIFF, kTIFF_TIFFYCbCrSubSampling, @"YCbCrSubSampling"}, + {kTIFF, kTIFF_TIFFYCbCrPositioning, @"YCbCrPositioning"}, + {kTIFF, kTIFF_TIFFReferenceBlackWhite, @"ReferenceBlackWhite"}, + {kTIFF, kTIFF_TIFFCopyright, @"Copyright"}, + {kTIFF, kTIFF_TIFFUserComment, @"UserComment"}, - {kEXIF, kEXIF_ExposureTime, @"ExposureTime"}, - {kEXIF, kEXIF_FNumber, @"FNumber"}, - {kEXIF, kEXIF_ExposureProgram, @"ExposureProgram"}, - {kEXIF, kEXIF_SpectralSensitivity, @"SpectralSensitivity"}, - {kEXIF, kEXIF_ISOSpeedRatings, @"ISOSpeedRatings"}, - {kEXIF, kEXIF_OECF, @"OECF"}, - {kEXIF, kEXIF_EXIFVersion, @"EXIFVersion"}, - {kEXIF, kEXIF_DatetimeOriginal, @"DatetimeOriginal"}, - {kEXIF, kEXIF_DatetimeDigitized, @"DatetimeDigitized"}, - {kEXIF, kEXIF_ComponentsConfiguration, @"ComponentsConfiguration"}, - {kEXIF, kEXIF_CompressedBitsPerPixel, @"CompressedBitsPerPixel"}, - {kEXIF, kEXIF_ShutterSpeedValue, @"ShutterSpeedValue"}, - {kEXIF, kEXIF_ApertureValue, @"ApertureValue"}, - {kEXIF, kEXIF_BrightnessValue, @"BrightnessValue"}, - {kEXIF, kEXIF_ExposureBiasValue, @"ExposureBiasValue"}, - {kEXIF, kEXIF_MaxApertureValue, @"MaxApertureValue"}, - {kEXIF, kEXIF_SubjectDistance, @"SubjectDistance"}, - {kEXIF, kEXIF_MeteringMode, @"MeteringMode"}, - {kEXIF, kEXIF_LightSource, @"LightSource"}, - {kEXIF, kEXIF_Flash, @"Flash"}, - {kEXIF, kEXIF_FocalLength, @"FocalLength"}, - {kEXIF, kEXIF_MakerNote, @"MakerNote"}, - {kEXIF, kEXIF_UserComment, @"UserComment"}, - {kEXIF, kEXIF_SubSecTime, @"SubSecTime"}, - {kEXIF, kEXIF_SubSecTimeOriginal, @"SubSecTimeOriginal"}, - {kEXIF, kEXIF_SubSecTimeDigitized, @"SubSecTimeDigitized"}, - {kEXIF, kEXIF_FlashPixVersion, @"FlashPixVersion"}, - {kEXIF, kEXIF_ColorSpace, @"ColorSpace"}, - {kEXIF, kEXIF_PixelXDimension, @"PixelXDimension"}, - {kEXIF, kEXIF_PixelYDimension, @"PixelYDimension"}, - {kEXIF, kEXIF_RelatedSoundFile, @"RelatedSoundFile"}, - {kEXIF, kEXIF_InteropIFDOffset, nil}, - {kEXIF, kEXIF_FlashEnergy, @"FlashEnergy"}, - {kEXIF, kEXIF_SpatialFrequencyResponse, @"SpatialFrequencyResponse"}, - {kEXIF, kEXIF_FocalPlaneXResolution, @"FocalPlaneXResolution"}, - {kEXIF, kEXIF_FocalPlaneYResolution, @"FocalPlaneYResolution"}, - {kEXIF, kEXIF_FocalPlaneResolutionUnit, @"FocalPlaneResolutionUnit"}, - {kEXIF, kEXIF_SubjectLocation, @"SubjectLocation"}, - {kEXIF, kEXIF_ExposureIndex, @"ExposureIndex"}, - {kEXIF, kEXIF_SensingMethod, @"SensingMethod"}, - {kEXIF, kEXIF_FileSource, @"FileSource"}, - {kEXIF, kEXIF_SceneType, @"SceneType"}, - {kEXIF, kEXIF_CFAPattern, @"CFAPattern"}, + {kEXIF, kEXIF_ExposureTime, @"ExposureTime"}, + {kEXIF, kEXIF_FNumber, @"FNumber"}, + {kEXIF, kEXIF_ExposureProgram, @"ExposureProgram"}, + {kEXIF, kEXIF_SpectralSensitivity, @"SpectralSensitivity"}, + {kEXIF, kEXIF_ISOSpeedRatings, @"ISOSpeedRatings"}, + {kEXIF, kEXIF_OECF, @"OECF"}, + {kEXIF, kEXIF_EXIFVersion, @"EXIFVersion"}, + {kEXIF, kEXIF_DatetimeOriginal, @"DatetimeOriginal"}, + {kEXIF, kEXIF_DatetimeDigitized, @"DatetimeDigitized"}, + {kEXIF, kEXIF_ComponentsConfiguration, @"ComponentsConfiguration"}, + {kEXIF, kEXIF_CompressedBitsPerPixel, @"CompressedBitsPerPixel"}, + {kEXIF, kEXIF_ShutterSpeedValue, @"ShutterSpeedValue"}, + {kEXIF, kEXIF_ApertureValue, @"ApertureValue"}, + {kEXIF, kEXIF_BrightnessValue, @"BrightnessValue"}, + {kEXIF, kEXIF_ExposureBiasValue, @"ExposureBiasValue"}, + {kEXIF, kEXIF_MaxApertureValue, @"MaxApertureValue"}, + {kEXIF, kEXIF_SubjectDistance, @"SubjectDistance"}, + {kEXIF, kEXIF_MeteringMode, @"MeteringMode"}, + {kEXIF, kEXIF_LightSource, @"LightSource"}, + {kEXIF, kEXIF_Flash, @"Flash"}, + {kEXIF, kEXIF_FocalLength, @"FocalLength"}, + {kEXIF, kEXIF_MakerNote, @"MakerNote"}, + {kEXIF, kEXIF_UserComment, @"UserComment"}, + {kEXIF, kEXIF_SubSecTime, @"SubSecTime"}, + {kEXIF, kEXIF_SubSecTimeOriginal, @"SubSecTimeOriginal"}, + {kEXIF, kEXIF_SubSecTimeDigitized, @"SubSecTimeDigitized"}, + {kEXIF, kEXIF_FlashPixVersion, @"FlashPixVersion"}, + {kEXIF, kEXIF_ColorSpace, @"ColorSpace"}, + {kEXIF, kEXIF_PixelXDimension, @"PixelXDimension"}, + {kEXIF, kEXIF_PixelYDimension, @"PixelYDimension"}, + {kEXIF, kEXIF_RelatedSoundFile, @"RelatedSoundFile"}, + {kEXIF, kEXIF_InteropIFDOffset, nil}, + {kEXIF, kEXIF_FlashEnergy, @"FlashEnergy"}, + {kEXIF, kEXIF_SpatialFrequencyResponse, @"SpatialFrequencyResponse"}, + {kEXIF, kEXIF_FocalPlaneXResolution, @"FocalPlaneXResolution"}, + {kEXIF, kEXIF_FocalPlaneYResolution, @"FocalPlaneYResolution"}, + {kEXIF, kEXIF_FocalPlaneResolutionUnit, @"FocalPlaneResolutionUnit"}, + {kEXIF, kEXIF_SubjectLocation, @"SubjectLocation"}, + {kEXIF, kEXIF_ExposureIndex, @"ExposureIndex"}, + {kEXIF, kEXIF_SensingMethod, @"SensingMethod"}, + {kEXIF, kEXIF_FileSource, @"FileSource"}, + {kEXIF, kEXIF_SceneType, @"SceneType"}, + {kEXIF, kEXIF_CFAPattern, @"CFAPattern"}, - {kInterop, kInterop_InteroperabilityIndex, @"InteroperabilityIndex"}, - {kInterop, kInterop_InteroperabilityVersion, @"InteroperabilityVersion"}, - {kInterop, kInterop_RelatedImageFileFormat, @"RelatedImageFileFormat"}, - {kInterop, kInterop_RelatedImageWidth, @"RelatedImageWidth"}, - {kInterop, kInterop_RelatedImageLength, @"RelatedImageLength"}, + {kInterop, kInterop_InteroperabilityIndex, @"InteroperabilityIndex"}, + {kInterop, kInterop_InteroperabilityVersion, + @"InteroperabilityVersion"}, + {kInterop, kInterop_RelatedImageFileFormat, @"RelatedImageFileFormat"}, + {kInterop, kInterop_RelatedImageWidth, @"RelatedImageWidth"}, + {kInterop, kInterop_RelatedImageLength, @"RelatedImageLength"}, - {kGPS, kGPS_GPSVersionID, @"GPSVersionID"}, - {kGPS, kGPS_GPSLatitudeRef, @"GPSLatitudeRef"}, - {kGPS, kGPS_GPSLatitude, @"GPSLatitude"}, - {kGPS, kGPS_GPSLongitudeRef, @"GPSLongitudeRef"}, - {kGPS, kGPS_GPSLongitude, @"GPSLongitude"}, - {kGPS, kGPS_GPSAltitudeRef, @"GPSAltitudeRef"}, - {kGPS, kGPS_GPSAltitude, @"GPSAltitude"}, - {kGPS, kGPS_GPSTimeStamp, @"GPSTimeStamp"}, - {kGPS, kGPS_GPSSatellites, @"GPSSatellites"}, - {kGPS, kGPS_GPSStatus, @"GPSStatus"}, - {kGPS, kGPS_GPSMeasureMode, @"GPSMeasureMode"}, - {kGPS, kGPS_GPSDOP, @"GPSDOP"}, - {kGPS, kGPS_GPSSpeedRef, @"GPSSpeedRef"}, - {kGPS, kGPS_GPSSpeed, @"GPSSpeed"}, - {kGPS, kGPS_GPSTrackRef, @"GPSTrackRef"}, - {kGPS, kGPS_GPSTrack, @"GPSTrack"}, - {kGPS, kGPS_GPSImgDirectionRef, @"GPSImgDirectionRef"}, - {kGPS, kGPS_GPSImgDirection, @"GPSImgDirection"}, - {kGPS, kGPS_GPSMapDatum, @"GPSMapDatum"}, - {kGPS, kGPS_GPSDestLatitudeRef, @"GPSDestLatitudeRef"}, - {kGPS, kGPS_GPSDestLatitude, @"GPSDestLatitude"}, - {kGPS, kGPS_GPSDestLongitudeRef, @"GPSDestLongitudeRef"}, - {kGPS, kGPS_GPSDestLongitude, @"GPSDestLongitude"}, - {kGPS, kGPS_GPSDestBearingRef, @"GPSDestBearingRef"}, - {kGPS, kGPS_GPSDestBearing, @"GPSDestBearing"}, - {kGPS, kGPS_GPSDestDistanceRef, @"GPSDestDistanceRef"}, - {kGPS, kGPS_GPSDestDistance, @"GPSDestDistance"}, + {kGPS, kGPS_GPSVersionID, @"GPSVersionID"}, + {kGPS, kGPS_GPSLatitudeRef, @"GPSLatitudeRef"}, + {kGPS, kGPS_GPSLatitude, @"GPSLatitude"}, + {kGPS, kGPS_GPSLongitudeRef, @"GPSLongitudeRef"}, + {kGPS, kGPS_GPSLongitude, @"GPSLongitude"}, + {kGPS, kGPS_GPSAltitudeRef, @"GPSAltitudeRef"}, + {kGPS, kGPS_GPSAltitude, @"GPSAltitude"}, + {kGPS, kGPS_GPSTimeStamp, @"GPSTimeStamp"}, + {kGPS, kGPS_GPSSatellites, @"GPSSatellites"}, + {kGPS, kGPS_GPSStatus, @"GPSStatus"}, + {kGPS, kGPS_GPSMeasureMode, @"GPSMeasureMode"}, + {kGPS, kGPS_GPSDOP, @"GPSDOP"}, + {kGPS, kGPS_GPSSpeedRef, @"GPSSpeedRef"}, + {kGPS, kGPS_GPSSpeed, @"GPSSpeed"}, + {kGPS, kGPS_GPSTrackRef, @"GPSTrackRef"}, + {kGPS, kGPS_GPSTrack, @"GPSTrack"}, + {kGPS, kGPS_GPSImgDirectionRef, @"GPSImgDirectionRef"}, + {kGPS, kGPS_GPSImgDirection, @"GPSImgDirection"}, + {kGPS, kGPS_GPSMapDatum, @"GPSMapDatum"}, + {kGPS, kGPS_GPSDestLatitudeRef, @"GPSDestLatitudeRef"}, + {kGPS, kGPS_GPSDestLatitude, @"GPSDestLatitude"}, + {kGPS, kGPS_GPSDestLongitudeRef, @"GPSDestLongitudeRef"}, + {kGPS, kGPS_GPSDestLongitude, @"GPSDestLongitude"}, + {kGPS, kGPS_GPSDestBearingRef, @"GPSDestBearingRef"}, + {kGPS, kGPS_GPSDestBearing, @"GPSDestBearing"}, + {kGPS, kGPS_GPSDestDistanceRef, @"GPSDestDistanceRef"}, + {kGPS, kGPS_GPSDestDistance, @"GPSDestDistance"}, - {-1, -1, nil}}; + {-1, -1, nil}}; typedef enum valueType { tByte = 1, @@ -523,7 +525,7 @@ static unsigned long _getLong(const unsigned char *data, size_t offset, val = [[[NSString alloc] initWithBytes: rawValue length: count encoding: NSUTF8StringEncoding] - autorelease]; + autorelease]; break; case tShort: if (count == 1) { @@ -616,24 +618,24 @@ static unsigned long _getLong(const unsigned char *data, size_t offset, if ((mode == kIFD0) && (tag == kImage_ExifIFDOffset)) { // ExifIFDOffset [self _readIFD: data - offset: value - bigendian: bigendian - mode: kEXIF - size: size]; + offset: value + bigendian: bigendian + mode: kEXIF + size: size]; } else if ((mode == kIFD0) && (tag == kImage_GPSIFDOffset)) { // GPSIFDOffset [self _readIFD: data - offset: value - bigendian: bigendian - mode: kGPS - size: size]; + offset: value + bigendian: bigendian + mode: kGPS + size: size]; } else if ((mode == kEXIF) && (tag == kEXIF_InteropIFDOffset)) { // InteropIFDOffset [self _readIFD: data - offset: value - bigendian: bigendian - mode: kInterop - size: size]; + offset: value + bigendian: bigendian + mode: kInterop + size: size]; } if (val) { @@ -677,12 +679,10 @@ static unsigned long _getLong(const unsigned char *data, size_t offset, value: [NSNumber numberWithInt: yResolution]]; [self setTagForTypeKey: typekey numberKey: @"JFIFVersion" - value: [NSArray - arrayWithObjects: [NSNumber - numberWithInt: versionH], - [NSNumber - numberWithInt: versionL], - nil]]; + value: [NSArray arrayWithObjects: + [NSNumber numberWithInt: versionH], + [NSNumber numberWithInt: versionL], + nil]]; float DPIWidth = 0; float DPIHeight = 0; if (density == 1 || density == 2) { @@ -743,10 +743,10 @@ static unsigned long _getLong(const unsigned char *data, size_t offset, if ([_tags objectForKey: typeKey] == nil) { // No tiff data yet - let's try to decode this block [self _readIFD: bytes - offset: offset - bigendian: bigendian - mode: kIFD1 - size: length]; + offset: offset + bigendian: bigendian + mode: kIFD1 + size: length]; } } } diff --git a/Onyx2D/O2Encoder_JPG.m b/Onyx2D/O2Encoder_JPG.m index 4a8083a3..7b01bec2 100644 --- a/Onyx2D/O2Encoder_JPG.m +++ b/Onyx2D/O2Encoder_JPG.m @@ -52,7 +52,7 @@ void O2JPGEncoderWriteImage(O2JPGEncoderRef self, O2ImageRef image, jpeg_set_defaults(&cinfo); NSNumber *dpi = - [properties objectForKey: (NSString *) kO2ImageDestinationDPI]; + [properties objectForKey: (NSString *) kO2ImageDestinationDPI]; if (dpi) { int dpiValue = [dpi intValue]; cinfo.density_unit = 1; /* DPI */ @@ -61,7 +61,8 @@ void O2JPGEncoderWriteImage(O2JPGEncoderRef self, O2ImageRef image, } NSNumber *compression = [properties - objectForKey: (NSString *) kO2ImageDestinationLossyCompressionQuality]; + objectForKey: (NSString *) + kO2ImageDestinationLossyCompressionQuality]; if (compression) { jpeg_set_quality(&cinfo, 100 * [compression floatValue], TRUE); } diff --git a/Onyx2D/O2Encoder_PNG.m b/Onyx2D/O2Encoder_PNG.m index 45afc0e6..113f7667 100644 --- a/Onyx2D/O2Encoder_PNG.m +++ b/Onyx2D/O2Encoder_PNG.m @@ -52,7 +52,7 @@ void O2PNGEncoderWriteImage(O2PNGEncoderRef self, O2ImageRef image, png_byte bit_depth = 8; png_structp png_ptr = - png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); png_infop info_ptr = png_create_info_struct(png_ptr); png_set_error_fn(png_ptr, NULL, O2PNGEncoderError, NULL); @@ -61,8 +61,8 @@ void O2PNGEncoderWriteImage(O2PNGEncoderRef self, O2ImageRef image, // These settings speed it up a lot without sacrificing a lot of disk space png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, PNG_FILTER_SUB); png_set_compression_level( - png_ptr, - 3); // range is 0 (NONE) to 9 (BEST) - 3 is a reasonable compromise + png_ptr, + 3); // range is 0 (NONE) to 9 (BEST) - 3 is a reasonable compromise @try { png_set_write_fn(png_ptr, self, o2png_write_data, NULL); @@ -218,14 +218,14 @@ typedef int stb_image_write_test[sizeof(stbiw_uint32) == 4 ? 1 : -1]; #define stbi__sbgrow(a, n) stbi__sbgrowf((void **) &(a), (n), sizeof(*(a))) #define stbi__sbpush(a, v) \ - (stbi__sbmaybegrow(a, 1), (a)[stbi__sbn(a)++] = (v)) + (stbi__sbmaybegrow(a, 1), (a)[stbi__sbn(a)++] = (v)) #define stbi__sbcount(a) ((a) ? stbi__sbn(a) : 0) #define stbi__sbfree(a) ((a) ? free(stbi__sbraw(a)), 0 : 0) static void *stbi__sbgrowf(void **arr, int increment, int itemsize) { int m = *arr ? 2 * stbi__sbm(*arr) + increment : increment + 1; - void *p = - realloc(*arr ? stbi__sbraw(*arr) : 0, itemsize * m + sizeof(int) * 2); + void *p = realloc(*arr ? stbi__sbraw(*arr) : 0, + itemsize * m + sizeof(int) * 2); assert(p); if (p) { if (!*arr) @@ -300,15 +300,15 @@ unsigned char *stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality) { static unsigned short lengthc[] = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, - 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 259}; + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, + 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 259}; static unsigned char lengtheb[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; static unsigned short distc[] = { - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, - 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, - 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 32768}; + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, + 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, + 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 32768}; static unsigned char disteb[] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; @@ -425,8 +425,8 @@ unsigned int stbi__crc32(unsigned char *buffer, int len) { if (crc_table[1] == 0) for (i = 0; i < 256; i++) for (crc_table[i] = i, j = 0; j < 8; ++j) - crc_table[i] = - (crc_table[i] >> 1) ^ (crc_table[i] & 1 ? 0xedb88320 : 0); + crc_table[i] = (crc_table[i] >> 1) ^ + (crc_table[i] & 1 ? 0xedb88320 : 0); for (i = 0; i < len; ++i) crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)]; return ~crc; @@ -520,7 +520,8 @@ unsigned char *stbi_write_png_to_mem(O2ImageRef image, int x, int y, break; case 4: line_buffer[i] = - (signed char) (z[i] - stbi__paeth(0, lastZ[i], 0)); + (signed char) (z[i] - + stbi__paeth(0, lastZ[i], 0)); break; case 5: line_buffer[i] = z[i]; @@ -579,9 +580,9 @@ unsigned char *stbi_write_png_to_mem(O2ImageRef image, int x, int y, free(pixelBuffer); free(line_buffer); - zlib = - stbi_zlib_compress(filt, y * (x * n + 1), &zlen, - 8); // increase 8 to get smaller but use more memory + zlib = stbi_zlib_compress( + filt, y * (x * n + 1), &zlen, + 8); // increase 8 to get smaller but use more memory free(filt); if (!zlib) return 0; @@ -636,7 +637,7 @@ void O2PNGEncoderWriteImage(O2PNGEncoderRef self, O2ImageRef image, int length; unsigned char *png = stbi_write_png_to_mem( - image, O2ImageGetWidth(image), O2ImageGetHeight(image), &length); + image, O2ImageGetWidth(image), O2ImageGetHeight(image), &length); if (png == NULL) return; diff --git a/Onyx2D/O2Encoder_TIFF.m b/Onyx2D/O2Encoder_TIFF.m index 56e657d8..4b6ca9cb 100644 --- a/Onyx2D/O2Encoder_TIFF.m +++ b/Onyx2D/O2Encoder_TIFF.m @@ -55,7 +55,7 @@ static void ensureByteCount(O2TIFFEncoderRef self, size_t count) { self->_bufferCapacity *= 2; self->_mutableBytes = - NSZoneRealloc(NULL, self->_mutableBytes, self->_bufferCapacity); + NSZoneRealloc(NULL, self->_mutableBytes, self->_bufferCapacity); } } @@ -314,7 +314,7 @@ void O2TIFFEncoderWriteImage(O2TIFFEncoderRef self, O2ImageRef image, size_t tiffPixelByteCount = imageHeight * tiffBytesPerRow; uint32_t idealStripSize = - MAX(8192, tiffBytesPerRow); // 8k recommended by spec. + MAX(8192, tiffBytesPerRow); // 8k recommended by spec. uint32_t rowsPerStrip = (idealStripSize / tiffBytesPerRow); uint32_t stripSize = rowsPerStrip * tiffBytesPerRow; uint32_t stripCount = (tiffPixelByteCount + (stripSize - 1)) / stripSize; @@ -369,8 +369,8 @@ void O2TIFFEncoderWriteImage(O2TIFFEncoderRef self, O2ImageRef image, putUnsigned32(self, 0); for (strip = 0; strip < stripCount; strip++) { - int row, - rowCount = MIN(rowsPerStrip, imageHeight - (strip * rowsPerStrip)); + int row, rowCount = MIN(rowsPerStrip, + imageHeight - (strip * rowsPerStrip)); stripOffsets[strip] = currentPosition(self); @@ -378,8 +378,8 @@ void O2TIFFEncoderWriteImage(O2TIFFEncoderRef self, O2ImageRef image, for (row = 0; row < rowCount; row++, y++) { - imageRow = - image->_read_argb8u(image, 0, y, imageRowBuffer, imageWidth); + imageRow = image->_read_argb8u(image, 0, y, imageRowBuffer, + imageWidth); if (imageRow == NULL) imageRow = imageRowBuffer; diff --git a/Onyx2D/O2Encoding.m b/Onyx2D/O2Encoding.m index 655b44cb..6eaa5b42 100644 --- a/Onyx2D/O2Encoding.m +++ b/Onyx2D/O2Encoding.m @@ -55,35 +55,38 @@ void O2EncodingGetUnicodeForBytes(O2Encoding *self, uint16_t *unicode, void O2EncodingGetMacRomanUnicode(unichar *codes) { static const unichar MacRoman[256] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, - 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, - 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, - 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, - 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, - 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, - 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, - 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, - 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, - 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, - 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, - 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, - 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, - 0x007E, 0x007F, 0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x00D1, 0x00D6, 0x00DC, - 0x00E1, 0x00E0, 0x00E2, 0x00E4, 0x00E3, 0x00E5, 0x00E7, 0x00E9, 0x00E8, - 0x00EA, 0x00EB, 0x00ED, 0x00EC, 0x00EE, 0x00EF, 0x00F1, 0x00F3, 0x00F2, - 0x00F4, 0x00F6, 0x00F5, 0x00FA, 0x00F9, 0x00FB, 0x00FC, 0x2020, 0x00B0, - 0x00A2, 0x00A3, 0x00A7, 0x2022, 0x00B6, 0x00DF, 0x00AE, 0x00A9, 0x2122, - 0x00B4, 0x00A8, 0x2260, 0x00C6, 0x00D8, 0x221E, 0x00B1, 0x2264, 0x2265, - 0x00A5, 0x00B5, 0x2202, 0x2211, 0x220F, 0x03C0, 0x222B, 0x00AA, 0x00BA, - 0x03A9, 0x00E6, 0x00F8, 0x00BF, 0x00A1, 0x00AC, 0x221A, 0x0192, 0x2248, - 0x2206, 0x00AB, 0x00BB, 0x2026, 0x00A0, 0x00C0, 0x00C3, 0x00D5, 0x0152, - 0x0153, 0x2013, 0x2014, 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x25CA, - 0x00FF, 0x0178, 0x2044, 0x20AC, 0x2039, 0x203A, 0xFB01, 0xFB02, 0x2021, - 0x00B7, 0x201A, 0x201E, 0x2030, 0x00C2, 0x00CA, 0x00C1, 0x00CB, 0x00C8, - 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x00D3, 0x00D4, 0xF8FF, 0x00D2, 0x00DA, - 0x00DB, 0x00D9, 0x0131, 0x02C6, 0x02DC, 0x00AF, 0x02D8, 0x02D9, 0x02DA, - 0x00B8, 0x02DD, 0x02DB, 0x02C7, + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, + 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, + 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, + 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, + 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, + 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, + 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, + 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, + 0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x00D1, 0x00D6, 0x00DC, 0x00E1, + 0x00E0, 0x00E2, 0x00E4, 0x00E3, 0x00E5, 0x00E7, 0x00E9, 0x00E8, + 0x00EA, 0x00EB, 0x00ED, 0x00EC, 0x00EE, 0x00EF, 0x00F1, 0x00F3, + 0x00F2, 0x00F4, 0x00F6, 0x00F5, 0x00FA, 0x00F9, 0x00FB, 0x00FC, + 0x2020, 0x00B0, 0x00A2, 0x00A3, 0x00A7, 0x2022, 0x00B6, 0x00DF, + 0x00AE, 0x00A9, 0x2122, 0x00B4, 0x00A8, 0x2260, 0x00C6, 0x00D8, + 0x221E, 0x00B1, 0x2264, 0x2265, 0x00A5, 0x00B5, 0x2202, 0x2211, + 0x220F, 0x03C0, 0x222B, 0x00AA, 0x00BA, 0x03A9, 0x00E6, 0x00F8, + 0x00BF, 0x00A1, 0x00AC, 0x221A, 0x0192, 0x2248, 0x2206, 0x00AB, + 0x00BB, 0x2026, 0x00A0, 0x00C0, 0x00C3, 0x00D5, 0x0152, 0x0153, + 0x2013, 0x2014, 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x25CA, + 0x00FF, 0x0178, 0x2044, 0x20AC, 0x2039, 0x203A, 0xFB01, 0xFB02, + 0x2021, 0x00B7, 0x201A, 0x201E, 0x2030, 0x00C2, 0x00CA, 0x00C1, + 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x00D3, 0x00D4, + 0xF8FF, 0x00D2, 0x00DA, 0x00DB, 0x00D9, 0x0131, 0x02C6, 0x02DC, + 0x00AF, 0x02D8, 0x02D9, 0x02DA, 0x00B8, 0x02DD, 0x02DB, 0x02C7, }; int i; @@ -97,35 +100,38 @@ void O2EncodingGetMacExpertUnicode(unichar *codes) { void O2EncodingGetWinAnsiUnicode(unichar *codes) { static const unichar WinAnsi[256] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, - 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, - 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, - 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, - 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, - 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, - 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, - 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, - 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, - 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, - 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, - 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, - 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, - 0x007E, 0x007F, 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, - 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000, - 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, - 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178, 0x00A0, 0x00A1, - 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, - 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, - 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, - 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, - 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, - 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, - 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, - 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, - 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, 0x00F2, - 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, - 0x00FC, 0x00FD, 0x00FE, 0x00FF, + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, + 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, + 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, + 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, + 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, + 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, + 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, + 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, + 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000, + 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, + 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, }; int i; diff --git a/Onyx2D/O2Font+PDF.m b/Onyx2D/O2Font+PDF.m index 01728ab9..75b5bfa4 100644 --- a/Onyx2D/O2Font+PDF.m +++ b/Onyx2D/O2Font+PDF.m @@ -65,8 +65,8 @@ O2PDFArray *O2FontCreatePDFWidthsWithEncoding(O2FontRef self, - (const char *) pdfFontName { // possibly wrong encoding return [[[self->_name componentsSeparatedByString: @" "] - componentsJoinedByString: @","] - cStringUsingEncoding: NSISOLatin1StringEncoding]; + componentsJoinedByString: @","] + cStringUsingEncoding: NSISOLatin1StringEncoding]; } - (O2PDFDictionary *) _pdfFontDescriptorWithSize: (CGFloat) size { @@ -113,7 +113,7 @@ O2PDFArray *O2FontCreatePDFWidthsWithEncoding(O2FontRef self, if (reference == nil) { O2PDFDictionary *result = [O2PDFDictionary pdfDictionary]; O2Encoding *encoding = - [self createEncodingForTextEncoding: kO2EncodingMacRoman]; + [self createEncodingForTextEncoding: kO2EncodingMacRoman]; [result setNameForKey: "Type" value: "Font"]; [result setNameForKey: "Subtype" value: "TrueType"]; @@ -126,18 +126,18 @@ O2PDFArray *O2FontCreatePDFWidthsWithEncoding(O2FontRef self, value: [context encodeIndirectPDFObject: widths]]; [widths release]; - [result - setObjectForKey: "FontDescriptor" - value: [context - encodeIndirectPDFObject: - [self _pdfFontDescriptorWithSize: size]]]; + [result setObjectForKey: "FontDescriptor" + value: [context + encodeIndirectPDFObject: + [self _pdfFontDescriptorWithSize: + size]]]; [result setNameForKey: "Encoding" value: "MacRomanEncoding"]; reference = [context encodeIndirectPDFObject: result]; [context setReference: reference - forFontWithName: self->_name - size: size]; + forFontWithName: self->_name + size: size]; } return reference; diff --git a/Onyx2D/O2Font.m b/Onyx2D/O2Font.m index 4fc70adb..1f72ccef 100644 --- a/Onyx2D/O2Font.m +++ b/Onyx2D/O2Font.m @@ -27,15 +27,15 @@ static NSArray *_preferredFontNames = nil; if (self == [O2Font class]) { // Set some decent defaut substitution fonts // Override that by a better list in the O2Font concrete subclass - [O2Font - setPreferredFontNames: - [NSArray arrayWithObjects: @"Arial", // Latin/Greek/Cyrillic, - // Arabic, Hebrew - @"Meiryo", // Japanese - @"FangSong", // Simplified Chinese - @"MingLiU", // Traditional Chinese - @"Batang", // Korean - nil]]; + [O2Font setPreferredFontNames: + [NSArray arrayWithObjects: + @"Arial", // Latin/Greek/Cyrillic, + // Arabic, Hebrew + @"Meiryo", // Japanese + @"FangSong", // Simplified Chinese + @"MingLiU", // Traditional Chinese + @"Batang", // Korean + nil]]; } } @@ -118,262 +118,262 @@ static NSArray *_preferredFontNames = nil; } NSString *O2MacRomanGlyphNames[256] = { - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @".notdef", - @"space", - @"exclam", - @"quotedbl", - @"numbersign", - @"dollar", - @"percent", - @"ampersand", - @"quotesingle", - @"parenleft", - @"parenright", - @"asterisk", - @"plus", - @"comma", - @"hyphen", - @"period", - @"slash", - @"zero", - @"one", - @"two", - @"three", - @"four", - @"five", - @"six", - @"seven", - @"eight", - @"nine", - @"colon", - @"semicolon", - @"less", - @"equal", - @"greater", - @"question", - @"at", - @"A", - @"B", - @"C", - @"D", - @"E", - @"F", - @"G", - @"H", - @"I", - @"J", - @"K", - @"L", - @"M", - @"N", - @"O", - @"P", - @"Q", - @"R", - @"S", - @"T", - @"U", - @"V", - @"W", - @"X", - @"Y", - @"Z", - @"bracketleft", - @"backslash", - @"bracketright", - @"asciicircum", - @"underscore", - @"grave", - @"a", - @"b", - @"c", - @"d", - @"e", - @"f", - @"g", - @"h", - @"i", - @"j", - @"k", - @"l", - @"m", - @"n", - @"o", - @"p", - @"q", - @"r", - @"s", - @"t", - @"u", - @"v", - @"w", - @"x", - @"y", - @"z", - @"braceleft", - @"bar", - @"braceright", - @"asciitilde", - @".notdef", - @"Adieresis", - @"Aring", - @"Ccedilla", - @"Eacute", - @"Ntilde", - @"Odieresis", - @"Udieresis", - @"aacute", - @"agrave", - @"acircumflex", - @"adieresis", - @"atilde", - @"aring", - @"ccedilla", - @"eacute", - @"egrave", - @"ecircumflex", - @"edieresis", - @"iacute", - @"igrave", - @"icircumflex", - @"idieresis", - @"ntilde", - @"oacute", - @"ograve", - @"ocircumflex", - @"odieresis", - @"otilde", - @"uacute", - @"ugrave", - @"ucircumflex", - @"udieresis", - @"dagger", - @"degree", - @"cent", - @"sterling", - @"section", - @"bullet", - @"paragraph", - @"germandbls", - @"registered", - @"copyright", - @"trademark", - @"acute", - @"dieresis", - @"notequal", - @"AE", - @"Oslash", - @"infinity", - @"plusminus", - @"lessequal", - @"greaterequal", - @"yen", - @"mu", - @"partialdiff", - @"summation", - @"product", - @"pi", - @"integral", - @"ordfeminine", - @"ordmasculine", - @"Omegagreek", - @"ae", - @"oslash", - @"questiondown", - @"exclamdown", - @"logicalnot", - @"radical", - @"florin", - @"approxequal", - @"Delta", - @"guillemotleft", - @"guillemotright", - @"ellipsis", - @"nobreakspace", - @"Agrave", - @"Atilde", - @"Otilde", - @"OE", - @"oe", - @"endash", - @"emdash", - @"quotedblleft", - @"quotedblright", - @"commaturnedmod", - @"apostrophemod", - @"divide", - @"lozenge", - @"ydieresis", - @"Ydieresis", - @"fraction", - @"Euro", - @"guilsinglleft", - @"guilsinglright", - @"fi", - @"fl", - @"daggerdbl", - @"periodcentered", - @"quotesinglbase", - @"quotedblbase", - @"perthousand", - @"Acircumflex", - @"Ecircumflex", - @"Aacute", - @"Edieresis", - @"Egrave", - @"Iacute", - @"Icircumflex", - @"Idieresis", - @"Igrave", - @"Oacute", - @"Ocircumflex", - @"apple", - @"Ograve", - @"Uacute", - @"Ucircumflex", - @"Ugrave", - @"dotlessi", - @"circumflex", - @"tilde", - @"macron", - @"breve", - @"dotaccent", - @"ring", - @"cedilla", - @"hungarumlaut", - @"ogonek", - @"caron", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @".notdef", + @"space", + @"exclam", + @"quotedbl", + @"numbersign", + @"dollar", + @"percent", + @"ampersand", + @"quotesingle", + @"parenleft", + @"parenright", + @"asterisk", + @"plus", + @"comma", + @"hyphen", + @"period", + @"slash", + @"zero", + @"one", + @"two", + @"three", + @"four", + @"five", + @"six", + @"seven", + @"eight", + @"nine", + @"colon", + @"semicolon", + @"less", + @"equal", + @"greater", + @"question", + @"at", + @"A", + @"B", + @"C", + @"D", + @"E", + @"F", + @"G", + @"H", + @"I", + @"J", + @"K", + @"L", + @"M", + @"N", + @"O", + @"P", + @"Q", + @"R", + @"S", + @"T", + @"U", + @"V", + @"W", + @"X", + @"Y", + @"Z", + @"bracketleft", + @"backslash", + @"bracketright", + @"asciicircum", + @"underscore", + @"grave", + @"a", + @"b", + @"c", + @"d", + @"e", + @"f", + @"g", + @"h", + @"i", + @"j", + @"k", + @"l", + @"m", + @"n", + @"o", + @"p", + @"q", + @"r", + @"s", + @"t", + @"u", + @"v", + @"w", + @"x", + @"y", + @"z", + @"braceleft", + @"bar", + @"braceright", + @"asciitilde", + @".notdef", + @"Adieresis", + @"Aring", + @"Ccedilla", + @"Eacute", + @"Ntilde", + @"Odieresis", + @"Udieresis", + @"aacute", + @"agrave", + @"acircumflex", + @"adieresis", + @"atilde", + @"aring", + @"ccedilla", + @"eacute", + @"egrave", + @"ecircumflex", + @"edieresis", + @"iacute", + @"igrave", + @"icircumflex", + @"idieresis", + @"ntilde", + @"oacute", + @"ograve", + @"ocircumflex", + @"odieresis", + @"otilde", + @"uacute", + @"ugrave", + @"ucircumflex", + @"udieresis", + @"dagger", + @"degree", + @"cent", + @"sterling", + @"section", + @"bullet", + @"paragraph", + @"germandbls", + @"registered", + @"copyright", + @"trademark", + @"acute", + @"dieresis", + @"notequal", + @"AE", + @"Oslash", + @"infinity", + @"plusminus", + @"lessequal", + @"greaterequal", + @"yen", + @"mu", + @"partialdiff", + @"summation", + @"product", + @"pi", + @"integral", + @"ordfeminine", + @"ordmasculine", + @"Omegagreek", + @"ae", + @"oslash", + @"questiondown", + @"exclamdown", + @"logicalnot", + @"radical", + @"florin", + @"approxequal", + @"Delta", + @"guillemotleft", + @"guillemotright", + @"ellipsis", + @"nobreakspace", + @"Agrave", + @"Atilde", + @"Otilde", + @"OE", + @"oe", + @"endash", + @"emdash", + @"quotedblleft", + @"quotedblright", + @"commaturnedmod", + @"apostrophemod", + @"divide", + @"lozenge", + @"ydieresis", + @"Ydieresis", + @"fraction", + @"Euro", + @"guilsinglleft", + @"guilsinglright", + @"fi", + @"fl", + @"daggerdbl", + @"periodcentered", + @"quotesinglbase", + @"quotedblbase", + @"perthousand", + @"Acircumflex", + @"Ecircumflex", + @"Aacute", + @"Edieresis", + @"Egrave", + @"Iacute", + @"Icircumflex", + @"Idieresis", + @"Igrave", + @"Oacute", + @"Ocircumflex", + @"apple", + @"Ograve", + @"Uacute", + @"Ucircumflex", + @"Ugrave", + @"dotlessi", + @"circumflex", + @"tilde", + @"macron", + @"breve", + @"dotaccent", + @"ring", + @"cedilla", + @"hungarumlaut", + @"ogonek", + @"caron", }; - (O2Glyph *) MacRomanEncoding { @@ -384,7 +384,7 @@ NSString *O2MacRomanGlyphNames[256] = { for (i = 0; i < 256; i++) _MacRomanEncoding[i] = O2FontGetGlyphWithGlyphName( - self, (CFStringRef) O2MacRomanGlyphNames[i]); + self, (CFStringRef) O2MacRomanGlyphNames[i]); } return _MacRomanEncoding; } diff --git a/Onyx2D/O2Font_freetype.m b/Onyx2D/O2Font_freetype.m index 0d2c2cd3..dc9bb453 100644 --- a/Onyx2D/O2Font_freetype.m +++ b/Onyx2D/O2Font_freetype.m @@ -51,7 +51,7 @@ FcConfig *O2FontSharedFontConfig() { fontConfig = FcInitLoadConfigAndFonts(); id appFontsPath = [[NSBundle mainBundle] - objectForInfoDictionaryKey: @"ATSApplicationFontsPath"]; + objectForInfoDictionaryKey: @"ATSApplicationFontsPath"]; if ([appFontsPath isKindOfClass: [NSString class]]) { addAppFont(fontConfig, appFontsPath); } else if ([appFontsPath isKindOfClass: [NSArray class]]) { @@ -232,8 +232,8 @@ FT_Face O2FontFreeTypeFace(O2Font_freetype *self) { } - (void) getGlyphs: (O2Glyph *) glyphs - forCodePoints: (uint16_t *) codes - length: (NSInteger) length + forCodePoints: (uint16_t *) codes + length: (NSInteger) length { for (int i = 0; i < length; i++) { glyphs[i] = FT_Get_Char_Index(_face, codes[i]); @@ -241,7 +241,7 @@ FT_Face O2FontFreeTypeFace(O2Font_freetype *self) { } - (O2Encoding *) unicode_createEncodingForTextEncoding: - (O2TextEncoding) encoding + (O2TextEncoding) encoding { unichar unicode[256]; O2Glyph glyphs[256]; @@ -282,7 +282,7 @@ FT_Face O2FontFreeTypeFace(O2Font_freetype *self) { } - (O2Encoding *) MacRoman_createEncodingForTextEncoding: - (O2TextEncoding) encoding + (O2TextEncoding) encoding { uint16_t codes[256]; diff --git a/Onyx2D/O2Font_ttf.m b/Onyx2D/O2Font_ttf.m index 1407a569..9400dce9 100644 --- a/Onyx2D/O2Font_ttf.m +++ b/Onyx2D/O2Font_ttf.m @@ -7,7 +7,7 @@ O2TTFDecoderRef decoder = O2TTFDecoderCreate(provider); _nameToGlyph = - O2TTFDecoderGetPostScriptNameMapTable(decoder, &_numberOfGlyphs); + O2TTFDecoderGetPostScriptNameMapTable(decoder, &_numberOfGlyphs); _glyphLocations = O2TTFDecoderGetGlyphLocations(decoder, _numberOfGlyphs); return self; } diff --git a/Onyx2D/O2Function+PDF.m b/Onyx2D/O2Function+PDF.m index 9723d3a6..cd6d3618 100644 --- a/Onyx2D/O2Function+PDF.m +++ b/Onyx2D/O2Function+PDF.m @@ -30,21 +30,21 @@ [dictionary setIntegerForKey: "FunctionType" value: 0]; [dictionary - setObjectForKey: "Domain" - value: [O2PDFArray pdfArrayWithNumbers: _domain - count: _domainCount]]; + setObjectForKey: "Domain" + value: [O2PDFArray pdfArrayWithNumbers: _domain + count: _domainCount]]; [dictionary setObjectForKey: "Range" value: [O2PDFArray pdfArrayWithNumbers: _range count: _rangeCount]]; [dictionary - setObjectForKey: "Size" - value: [O2PDFArray pdfArrayWithIntegers: &numberOfSamples - count: 1]]; + setObjectForKey: "Size" + value: [O2PDFArray pdfArrayWithIntegers: &numberOfSamples + count: 1]]; [dictionary setIntegerForKey: "BitsPerSample" value: 8]; [dictionary setIntegerForKey: "Order" value: 1]; for (i = 0; i < numberOfSamples; i++) { O2Float x = _domain[0] + ((O2Float) i / (O2Float) numberOfSamples) * - (_domain[1] - _domain[0]); + (_domain[1] - _domain[0]); O2Float output[numberOfChannels]; int j; @@ -52,9 +52,9 @@ for (j = 0; j < numberOfChannels; j++) { samples[i * numberOfChannels + j] = - ((output[j] - _range[j * 2]) / - (_range[j * 2 + 1] - _range[j * 2])) * - 255; + ((output[j] - _range[j * 2]) / + (_range[j * 2 + 1] - _range[j * 2])) * + 255; } } [[result mutableData] appendBytes: samples @@ -131,7 +131,7 @@ } if ((subfn = [O2Function - createFunctionWithDictionary: subfnDictionary]) == nil) + createFunctionWithDictionary: subfnDictionary]) == nil) return nil; [functions addObject: subfn]; @@ -142,12 +142,12 @@ if (![dictionary getArrayForKey: "Encode" value: &encode]) return nil; - return - [[[O2PDFFunction_Type3 alloc] initWithDomain: domain - range: range - functions: functions - bounds: bounds - encode: encode] autorelease]; + return [[[O2PDFFunction_Type3 alloc] initWithDomain: domain + range: range + functions: functions + bounds: bounds + encode: encode] + autorelease]; } else if (type == 4) { NSLog(@"PostScript calculator functions unimplemented"); return nil; @@ -197,9 +197,9 @@ [dictionary getIntegerForKey: "Order" value: &order]; if (order == 3) - O2PDFFix( - __FILE__, __LINE__, - @"Cubic spline interpolation unimplemented in Type0 functions"); + O2PDFFix(__FILE__, __LINE__, + @"Cubic spline interpolation unimplemented in Type0 " + @"functions"); [dictionary getArrayForKey: "Encode" value: &encode]; [dictionary getArrayForKey: "Decode" value: &decode]; diff --git a/Onyx2D/O2GraphicsState.m b/Onyx2D/O2GraphicsState.m index 2f259d60..f5bb5c9a 100644 --- a/Onyx2D/O2GraphicsState.m +++ b/Onyx2D/O2GraphicsState.m @@ -66,8 +66,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ { O2AffineTransform flip = {1, 0, 0, -1, 0, height}; - return - [self initWithDeviceTransform: O2AffineTransformConcat(flip, concat)]; + return [self + initWithDeviceTransform: O2AffineTransformConcat(flip, concat)]; } - init { @@ -105,7 +105,7 @@ O2GState *O2GStateCopyWithZone(O2GState *self, NSZone *zone) { int i; copy->_dashLengths = - NSZoneMalloc(zone, sizeof(O2Float) * self->_dashLengthsCount); + NSZoneMalloc(zone, sizeof(O2Float) * self->_dashLengthsCount); for (i = 0; i < self->_dashLengthsCount; i++) copy->_dashLengths[i] = self->_dashLengths[i]; } @@ -142,7 +142,7 @@ O2AffineTransform O2GStateUserSpaceTransform(O2GState *self) { - (O2Point) convertPointToUserSpace: (O2Point) point { return O2PointApplyAffineTransform( - point, O2AffineTransformInvert(_deviceSpaceTransform)); + point, O2AffineTransformInvert(_deviceSpaceTransform)); } - (O2Size) convertSizeToDeviceSpace: (O2Size) size { @@ -151,7 +151,7 @@ O2AffineTransform O2GStateUserSpaceTransform(O2GState *self) { - (O2Size) convertSizeToUserSpace: (O2Size) size { return O2SizeApplyAffineTransform( - size, O2AffineTransformInvert(_deviceSpaceTransform)); + size, O2AffineTransformInvert(_deviceSpaceTransform)); } - (O2Rect) convertRectToDeviceSpace: (O2Rect) rect { @@ -176,9 +176,9 @@ void O2GStateSetUserSpaceCTM(O2GState *self, O2AffineTransform transform) { void O2GStateConcatCTM(O2GState *self, O2AffineTransform transform) { self->_deviceSpaceTransform = - O2AffineTransformConcat(transform, self->_deviceSpaceTransform); + O2AffineTransformConcat(transform, self->_deviceSpaceTransform); self->_userSpaceTransform = - O2AffineTransformConcat(transform, self->_userSpaceTransform); + O2AffineTransformConcat(transform, self->_userSpaceTransform); self->_fontIsDirty = YES; } @@ -298,7 +298,7 @@ void O2GStateSetFont(O2GState *self, O2Font *font) { self->_font = font; O2Encoding *encoding = [self->_font - createEncodingForTextEncoding: kO2EncodingFontSpecific]; + createEncodingForTextEncoding: kO2EncodingFontSpecific]; O2GStateSetFontEncoding(self, encoding); [encoding release]; @@ -324,7 +324,7 @@ void O2GStateSetFontEncoding(O2GState *self, O2Encoding *encoding) { encoding: (O2TextEncoding) textEncoding { O2Font *font = O2FontCreateWithFontName( - [NSString stringWithCString: name encoding: NSUTF8StringEncoding]); + [NSString stringWithCString: name encoding: NSUTF8StringEncoding]); O2GStateSetFont(self, font); O2GStateSetFontSize(self, size); @@ -453,8 +453,8 @@ void O2GStateSetAlpha(O2GState *self, O2Float alpha) { _shadowColor = color; O2GaussianKernelRelease(_shadowKernel); _shadowKernel = (_shadowColor == nil) - ? NULL - : O2CreateGaussianKernelWithDeviation(blur); + ? NULL + : O2CreateGaussianKernelWithDeviation(blur); } - (void) setShadowOffset: (O2Size) offset blur: (O2Float) blur { diff --git a/Onyx2D/O2Image+PDF.m b/Onyx2D/O2Image+PDF.m index b3b1c2d3..59e55751 100644 --- a/Onyx2D/O2Image+PDF.m +++ b/Onyx2D/O2Image+PDF.m @@ -62,33 +62,32 @@ const char *O2ImageNameWithIntent(O2ColorRenderingIntent intent) { [dictionary setIntegerForKey: "Height" value: _height]; if (_colorSpace != nil) [dictionary - setObjectForKey: "ColorSpace" - value: [_colorSpace encodeReferenceWithContext: context]]; + setObjectForKey: "ColorSpace" + value: [_colorSpace + encodeReferenceWithContext: context]]; [dictionary setIntegerForKey: "BitsPerComponent" value: _bitsPerComponent]; [dictionary setNameForKey: "Intent" value: O2ImageNameWithIntent(_renderingIntent)]; [dictionary setBooleanForKey: "ImageMask" value: _isMask]; if (_mask != nil) [dictionary - setObjectForKey: "Mask" - value: [_mask encodeReferenceWithContext: context]]; + setObjectForKey: "Mask" + value: [_mask encodeReferenceWithContext: context]]; if (_decode != NULL) [dictionary - setObjectForKey: "Decode" - value: - [O2PDFArray - pdfArrayWithNumbers: _decode - count: - O2ColorSpaceGetNumberOfComponents( - _colorSpace) * - 2]]; + setObjectForKey: "Decode" + value: [O2PDFArray + pdfArrayWithNumbers: _decode + count: O2ColorSpaceGetNumberOfComponents( + _colorSpace) * + 2]]; [dictionary setBooleanForKey: "Interpolate" value: _interpolate]; if (O2ImageDecoderGetCompressionType(_decoder) == O2ImageCompressionJPEG) { // If the image is JPEG compressed, we can put the JPEG data in the PDF, // using a DCTDecode filter O2DataProviderRef dataProvider = - O2ImageDecoderGetDataProvider(_decoder); + O2ImageDecoderGetDataProvider(_decoder); CFDataRef dctData = O2DataProviderCopyData(dataProvider); [dictionary setNameForKey: "Filter" value: "DCTDecode"]; @@ -178,13 +177,13 @@ const char *O2ImageNameWithIntent(O2ColorRenderingIntent intent) { in[idx++] = g; in[idx++] = b; BOOL flush = - (i == _height - 1 && j == _width - 1) || (idx > CHUNK); + (i == _height - 1 && j == _width - 1) || (idx > CHUNK); if (flush) { #if ZLIB_PRESENT strm.avail_in = idx; flush = ((i == _height - 1 && j == _width - 1)) - ? Z_FINISH - : Z_NO_FLUSH; + ? Z_FINISH + : Z_NO_FLUSH; strm.next_in = in; // run deflate() on input until the output buffer is not @@ -257,7 +256,8 @@ const char *O2ImageNameWithIntent(O2ColorRenderingIntent intent) { if ([dictionary getObjectForKey: "ColorSpace" value: &colorSpaceObject]) { if ((colorSpace = [O2ColorSpace - createColorSpaceFromPDFObject: colorSpaceObject]) == NULL) { + createColorSpaceFromPDFObject: colorSpaceObject]) == + NULL) { O2PDFError(__FILE__, __LINE__, @"Unable to create ColorSpace %@", colorSpaceObject); return NULL; @@ -304,8 +304,8 @@ const char *O2ImageNameWithIntent(O2ColorRenderingIntent intent) { NSData *data = [stream data]; int bitsPerPixel = componentsPerPixel * bitsPerComponent; int bytesPerRow = ([stream bytesPerRow] != 0) - ? [stream bytesPerRow] - : ((width * bitsPerPixel) + 7) / 8; + ? [stream bytesPerRow] + : ((width * bitsPerPixel) + 7) / 8; O2DataProvider *provider; O2Image *image = NULL; @@ -320,7 +320,7 @@ const char *O2ImageNameWithIntent(O2ColorRenderingIntent intent) { if (height * bytesPerRow > [data length]) { // provide some gray data NSMutableData *mutable = - [NSMutableData dataWithLength: height * bytesPerRow]; + [NSMutableData dataWithLength: height * bytesPerRow]; char *mbytes = [mutable mutableBytes]; int i; for (i = 0; i < height * bytesPerRow; i++) @@ -341,18 +341,18 @@ const char *O2ImageNameWithIntent(O2ColorRenderingIntent intent) { interpolate: interpolate]; } else { image = [[O2Image alloc] - initWithWidth: width - height: height - bitsPerComponent: bitsPerComponent - bitsPerPixel: bitsPerPixel - bytesPerRow: bytesPerRow - colorSpace: colorSpace - bitmapInfo: 0 - decoder: NULL - provider: provider - decode: decode - interpolate: interpolate - renderingIntent: O2ImageRenderingIntentWithName(intent)]; + initWithWidth: width + height: height + bitsPerComponent: bitsPerComponent + bitsPerPixel: bitsPerPixel + bytesPerRow: bytesPerRow + colorSpace: colorSpace + bitmapInfo: 0 + decoder: NULL + provider: provider + decode: decode + interpolate: interpolate + renderingIntent: O2ImageRenderingIntentWithName(intent)]; if (softMask != NULL) [image setMask: softMask]; diff --git a/Onyx2D/O2Image.m b/Onyx2D/O2Image.m index 8bc86227..5db2cadb 100644 --- a/Onyx2D/O2Image.m +++ b/Onyx2D/O2Image.m @@ -312,24 +312,24 @@ ONYX2D_STATIC BOOL initFunctionsForParameters(O2Image *self, bitsPerPixel, bitmapInfo); case kO2ColorSpaceModelIndexed: return initFunctionsForIndexedColorSpace( - self, bitsPerComponent, bitsPerPixel, colorSpace, bitmapInfo); + self, bitsPerComponent, bitsPerPixel, colorSpace, bitmapInfo); default: return NO; } } - initWithWidth: (size_t) width - height: (size_t) height - bitsPerComponent: (size_t) bitsPerComponent - bitsPerPixel: (size_t) bitsPerPixel - bytesPerRow: (size_t) bytesPerRow - colorSpace: (O2ColorSpaceRef) colorSpace - bitmapInfo: (O2BitmapInfo) bitmapInfo - decoder: (O2ImageDecoder *) decoder - provider: (O2DataProvider *) provider - decode: (const O2Float *) decode - interpolate: (BOOL) interpolate - renderingIntent: (O2ColorRenderingIntent) renderingIntent + height: (size_t) height + bitsPerComponent: (size_t) bitsPerComponent + bitsPerPixel: (size_t) bitsPerPixel + bytesPerRow: (size_t) bytesPerRow + colorSpace: (O2ColorSpaceRef) colorSpace + bitmapInfo: (O2BitmapInfo) bitmapInfo + decoder: (O2ImageDecoder *) decoder + provider: (O2DataProvider *) provider + decode: (const O2Float *) decode + interpolate: (BOOL) interpolate + renderingIntent: (O2ColorRenderingIntent) renderingIntent { _width = width; _height = height; @@ -381,13 +381,13 @@ ONYX2D_STATIC BOOL initFunctionsForParameters(O2Image *self, } - initMaskWithWidth: (size_t) width - height: (size_t) height - bitsPerComponent: (size_t) bitsPerComponent - bitsPerPixel: (size_t) bitsPerPixel - bytesPerRow: (size_t) bytesPerRow - provider: (O2DataProvider *) provider - decode: (const O2Float *) decode - interpolate: (BOOL) interpolate + height: (size_t) height + bitsPerComponent: (size_t) bitsPerComponent + bitsPerPixel: (size_t) bitsPerPixel + bytesPerRow: (size_t) bytesPerRow + provider: (O2DataProvider *) provider + decode: (const O2Float *) decode + interpolate: (BOOL) interpolate { O2ColorSpaceRef gray = O2ColorSpaceCreateDeviceGray(); @@ -456,7 +456,7 @@ ONYX2D_STATIC_INLINE const void *directBytes(O2Image *self) { self->_directLength = [self->_provider length]; } else { self->_directData = - (NSData *) O2DataProviderCopyData(self->_provider); + (NSData *) O2DataProviderCopyData(self->_provider); self->_directBytes = [self->_directData bytes]; self->_directLength = [self->_directData length]; } @@ -588,12 +588,12 @@ O2ImageRef O2ImageCreateWithImageInRect(O2ImageRef self, O2Rect rect) { NSData *data = [NSData dataWithBytesNoCopy: childPixelBytes length: childIndex]; O2DataProviderRef provider = - O2DataProviderCreateWithCFData((CFDataRef) data); + O2DataProviderCreateWithCFData((CFDataRef) data); O2ImageRef result = O2ImageCreate( - width, height, self->_bitsPerComponent, self->_bitsPerPixel, - childBytesPerRow, self->_colorSpace, self->_bitmapInfo, provider, - self->_decode, self->_interpolate, self->_renderingIntent); + width, height, self->_bitsPerComponent, self->_bitsPerPixel, + childBytesPerRow, self->_colorSpace, self->_bitmapInfo, provider, + self->_decode, self->_interpolate, self->_renderingIntent); O2DataProviderRelease(provider); @@ -1339,9 +1339,9 @@ ONYX2D_STATIC_INLINE int cubic_8(int v0, int v1, int v2, int v3, int fraction) { int q = (v0 - v1) - p; return RI_INT_CLAMP((p * (fraction * fraction * fraction)) / - (256 * 256 * 256) + - (q * fraction * fraction) / (256 * 256) + - ((v2 - v0) * fraction) / 256 + v1, + (256 * 256 * 256) + + (q * fraction * fraction) / (256 * 256) + + ((v2 - v0) * fraction) / 256 + v1, 0, 255); } @@ -1408,7 +1408,8 @@ ONYX2D_STATIC_INLINE O2Float cubic_f(O2Float v0, O2Float v1, O2Float v2, O2Float q = (v0 - v1) - p; return RI_CLAMP((p * (fraction * fraction * fraction)) + - (q * fraction * fraction) + ((v2 - v0) * fraction) + v1, + (q * fraction * fraction) + ((v2 - v0) * fraction) + + v1, 0, 1); } @@ -1446,22 +1447,22 @@ void O2ImageBicubic_largb32f_PRE(O2Image *self, int x, int y, O2argb32f *span, O2ImageReadTileSpanExtendEdge__largb32f_PRE(self, u - 1, v - 1, cspan, 4); - t0 = - bicubic_largb32f_PRE(cspan[0], cspan[1], cspan[2], cspan[3], ufrac); + t0 = bicubic_largb32f_PRE(cspan[0], cspan[1], cspan[2], cspan[3], + ufrac); O2ImageReadTileSpanExtendEdge__largb32f_PRE(self, u - 1, v, cspan, 4); - t1 = - bicubic_largb32f_PRE(cspan[0], cspan[1], cspan[2], cspan[3], ufrac); + t1 = bicubic_largb32f_PRE(cspan[0], cspan[1], cspan[2], cspan[3], + ufrac); O2ImageReadTileSpanExtendEdge__largb32f_PRE(self, u - 1, v + 1, cspan, 4); - t2 = - bicubic_largb32f_PRE(cspan[0], cspan[1], cspan[2], cspan[3], ufrac); + t2 = bicubic_largb32f_PRE(cspan[0], cspan[1], cspan[2], cspan[3], + ufrac); O2ImageReadTileSpanExtendEdge__largb32f_PRE(self, u - 1, v + 2, cspan, 4); - t3 = - bicubic_largb32f_PRE(cspan[0], cspan[1], cspan[2], cspan[3], ufrac); + t3 = bicubic_largb32f_PRE(cspan[0], cspan[1], cspan[2], cspan[3], + ufrac); span[i] = bicubic_largb32f_PRE(t0, t1, t2, t3, vfrac); @@ -1505,10 +1506,10 @@ void O2ImageBilinear_largb8u_PRE(O2Image *self, int x, int y, O2argb8u *span, O2ImageReadTileSpanExtendEdge_largb8u_PRE(self, u, v, line0, 2); O2ImageReadTileSpanExtendEdge_largb8u_PRE(self, u, v + 1, line1, 2); - O2argb8u c0 = - O2argb8uMultiplyByCoverageAdd(line0[0], oneMinusFu, line0[1], fu); - O2argb8u c1 = - O2argb8uMultiplyByCoverageAdd(line1[0], oneMinusFu, line1[1], fu); + O2argb8u c0 = O2argb8uMultiplyByCoverageAdd(line0[0], oneMinusFu, + line0[1], fu); + O2argb8u c1 = O2argb8uMultiplyByCoverageAdd(line1[0], oneMinusFu, + line1[1], fu); uint32_t fv = uvy & 0xFF; uint32_t oneMinusFv = inverseCoverage(fv); @@ -1545,11 +1546,11 @@ void O2ImageBilinear_largb32f_PRE(O2Image *self, int x, int y, O2argb32f *span, O2Float fu = uv.x - (O2Float) u; O2Float fv = uv.y - (O2Float) v; O2argb32f c0 = - O2argb32fAdd(O2argb32fMultiplyByFloat(c00c01[0], (1.0f - fu)), - O2argb32fMultiplyByFloat(c00c01[1], fu)); + O2argb32fAdd(O2argb32fMultiplyByFloat(c00c01[0], (1.0f - fu)), + O2argb32fMultiplyByFloat(c00c01[1], fu)); O2argb32f c1 = - O2argb32fAdd(O2argb32fMultiplyByFloat(c01c11[0], (1.0f - fu)), - O2argb32fMultiplyByFloat(c01c11[1], fu)); + O2argb32fAdd(O2argb32fMultiplyByFloat(c01c11[0], (1.0f - fu)), + O2argb32fMultiplyByFloat(c01c11[1], fu)); span[i] = O2argb32fAdd(O2argb32fMultiplyByFloat(c0, (1.0f - fv)), O2argb32fMultiplyByFloat(c1, fv)); @@ -1571,8 +1572,9 @@ void O2ImagePointSampling_largb8u_PRE(O2Image *self, int x, int y, for (i = 0; i < length; i++, x++) { O2Point uv = O2PointMake(du, dv); - O2ImageReadTileSpanExtendEdge_largb8u_PRE( - self, RI_FLOOR_TO_INT(uv.x), RI_FLOOR_TO_INT(uv.y), span + i, 1); + O2ImageReadTileSpanExtendEdge_largb8u_PRE(self, RI_FLOOR_TO_INT(uv.x), + RI_FLOOR_TO_INT(uv.y), + span + i, 1); du += surfaceToImage.a; dv += surfaceToImage.b; @@ -1592,8 +1594,9 @@ void O2ImagePointSampling_largb32f_PRE(O2Image *self, int x, int y, for (i = 0; i < length; i++, x++) { O2Point uv = O2PointMake(du, dv); - O2ImageReadTileSpanExtendEdge__largb32f_PRE( - self, RI_FLOOR_TO_INT(uv.x), RI_FLOOR_TO_INT(uv.y), span + i, 1); + O2ImageReadTileSpanExtendEdge__largb32f_PRE(self, RI_FLOOR_TO_INT(uv.x), + RI_FLOOR_TO_INT(uv.y), + span + i, 1); du += surfaceToImage.a; dv += surfaceToImage.b; @@ -1767,11 +1770,11 @@ void O2ImagePattern_Bilinear(O2Image *self, O2Float x, O2Float y, O2Float fu = uv.x - (O2Float) u; O2Float fv = uv.y - (O2Float) v; O2argb32f c0 = - O2argb32fAdd(O2argb32fMultiplyByFloat(c00c01[0], (1.0f - fu)), - O2argb32fMultiplyByFloat(c00c01[1], fu)); + O2argb32fAdd(O2argb32fMultiplyByFloat(c00c01[0], (1.0f - fu)), + O2argb32fMultiplyByFloat(c00c01[1], fu)); O2argb32f c1 = - O2argb32fAdd(O2argb32fMultiplyByFloat(c01c11[0], (1.0f - fu)), - O2argb32fMultiplyByFloat(c01c11[1], fu)); + O2argb32fAdd(O2argb32fMultiplyByFloat(c01c11[0], (1.0f - fu)), + O2argb32fMultiplyByFloat(c01c11[1], fu)); span[i] = O2argb32fAdd(O2argb32fMultiplyByFloat(c0, (1.0f - fv)), O2argb32fMultiplyByFloat(c1, fv)); @@ -1794,8 +1797,9 @@ void O2ImagePattern_PointSampling_largb8u_PRE(O2Image *self, O2Float x, for (i = 0; i < length; i++, x++) { O2Point uv = O2PointMake(du, dv); - O2ImageReadTexelTileRepeat_largb8u_PRE( - self, RI_FLOOR_TO_INT(uv.x), RI_FLOOR_TO_INT(uv.y), span + i, 1); + O2ImageReadTexelTileRepeat_largb8u_PRE(self, RI_FLOOR_TO_INT(uv.x), + RI_FLOOR_TO_INT(uv.y), span + i, + 1); du += surfaceToImage.a; dv += surfaceToImage.b; @@ -1816,8 +1820,9 @@ void O2ImagePattern_PointSampling_largb32f_PRE(O2Image *self, O2Float x, for (i = 0; i < length; i++, x++) { O2Point uv = O2PointMake(du, dv); - O2ImageReadTexelTileRepeat_largb32f_PRE( - self, RI_FLOOR_TO_INT(uv.x), RI_FLOOR_TO_INT(uv.y), span + i, 1); + O2ImageReadTexelTileRepeat_largb32f_PRE(self, RI_FLOOR_TO_INT(uv.x), + RI_FLOOR_TO_INT(uv.y), span + i, + 1); du += surfaceToImage.a; dv += surfaceToImage.b; @@ -1862,11 +1867,13 @@ void O2ImageReadPatternSpan_largb32f_PRE(O2Image *self, O2Float x, O2Float y, - (NSString *) description { return [NSString - stringWithFormat: - @"<%@:%p> width=%d,height=%d,bpc=%d,bpp=%d,bpr=%d,bminfo=%x data " - @"length=%d", - [self class], self, _width, _height, _bitsPerComponent, - _bitsPerPixel, _bytesPerRow, _bitmapInfo, [_provider length]]; + stringWithFormat: + @"<%@:%p> " + @"width=%d,height=%d,bpc=%d,bpp=%d,bpr=%d,bminfo=%x data " + @"length=%d", + [self class], self, _width, _height, _bitsPerComponent, + _bitsPerPixel, _bytesPerRow, _bitmapInfo, + [_provider length]]; } @end diff --git a/Onyx2D/O2ImageDecoder_JPEG_libjpeg.m b/Onyx2D/O2ImageDecoder_JPEG_libjpeg.m index d8639c69..7ea8ead0 100644 --- a/Onyx2D/O2ImageDecoder_JPEG_libjpeg.m +++ b/Onyx2D/O2ImageDecoder_JPEG_libjpeg.m @@ -65,7 +65,7 @@ static unsigned char *stbi_jpeg_load_from_memory(const uint8_t const *buffer, #endif } int wantedPixelSize = cinfo.output_components = cinfo.out_color_components = - 4; + 4; jpeg_start_decompress(&cinfo); *x = cinfo.output_width; @@ -76,7 +76,7 @@ static unsigned char *stbi_jpeg_load_from_memory(const uint8_t const *buffer, // Buffer for the final decompressed data unsigned char *outputImage = - (unsigned char *) malloc(bytesPerRow * cinfo.output_height); + (unsigned char *) malloc(bytesPerRow * cinfo.output_height); if (outputImage) { #ifdef JCS_ALPHA_EXTENSIONS // Scanline buffers pointers - they'll point directly to the final image @@ -84,9 +84,9 @@ static unsigned char *stbi_jpeg_load_from_memory(const uint8_t const *buffer, JSAMPROW scanlineBuffer[cinfo.rec_outbuf_height]; #else // Scanline buffers - JSAMPARRAY scanlineBuffer = - (*cinfo.mem->alloc_sarray)((j_common_ptr) &cinfo, JPOOL_IMAGE, - bytesPerRow, cinfo.rec_outbuf_height); + JSAMPARRAY scanlineBuffer = (*cinfo.mem->alloc_sarray)( + (j_common_ptr) &cinfo, JPOOL_IMAGE, bytesPerRow, + cinfo.rec_outbuf_height); #endif while (cinfo.output_scanline < cinfo.image_height) { @@ -95,7 +95,7 @@ static unsigned char *stbi_jpeg_load_from_memory(const uint8_t const *buffer, // We'll decode directly into the final buffer for (int i = 0; i < cinfo.rec_outbuf_height; ++i) { scanlineBuffer[i] = - outputImage + (currentLine + i) * bytesPerRow; + outputImage + (currentLine + i) * bytesPerRow; } jpeg_read_scanlines(&cinfo, scanlineBuffer, cinfo.rec_outbuf_height); @@ -103,7 +103,7 @@ static unsigned char *stbi_jpeg_load_from_memory(const uint8_t const *buffer, // Convert from CMYK to RGBA for (int i = 0; i < cinfo.rec_outbuf_height; ++i) { unsigned char *out = - outputImage + (currentLine++) * bytesPerRow; + outputImage + (currentLine++) * bytesPerRow; for (int j = 0; j < cinfo.output_width; ++j) { unsigned char c = out[0]; unsigned char m = out[1]; @@ -192,10 +192,10 @@ static unsigned char *stbi_jpeg_load_from_memory(const uint8_t const *buffer, _colorSpace = O2ColorSpaceCreateDeviceRGB(); _bitmapInfo = kO2BitmapByteOrder32Big | kO2ImageAlphaPremultipliedLast; - _pixelData = - (CFDataRef) [[NSData alloc] initWithBytesNoCopy: bitmap - length: _bytesPerRow * _height - freeWhenDone: YES]; + _pixelData = (CFDataRef) + [[NSData alloc] initWithBytesNoCopy: bitmap + length: _bytesPerRow * _height + freeWhenDone: YES]; return self; } diff --git a/Onyx2D/O2ImageDecoder_JPEG_stb.m b/Onyx2D/O2ImageDecoder_JPEG_stb.m index ff856884..72bfcc71 100644 --- a/Onyx2D/O2ImageDecoder_JPEG_stb.m +++ b/Onyx2D/O2ImageDecoder_JPEG_stb.m @@ -1124,9 +1124,9 @@ static unsigned char *stbi_jpeg_load_from_memory(jpeg *j,stbi_uc const *buffer, jpeg jpeg_decoder; int width, height; - bitmap = - stbi_jpeg_load_from_memory(&jpeg_decoder, encodedBytes, encodedLength, - &width, &height, &comp, STBI_rgb_alpha); + bitmap = stbi_jpeg_load_from_memory(&jpeg_decoder, encodedBytes, + encodedLength, &width, &height, &comp, + STBI_rgb_alpha); CFRelease(encodedData); @@ -1143,12 +1143,12 @@ static unsigned char *stbi_jpeg_load_from_memory(jpeg *j,stbi_uc const *buffer, _colorSpace = O2ColorSpaceCreateDeviceRGB(); _bitmapInfo = kO2BitmapByteOrder32Big | kO2ImageAlphaPremultipliedLast; - _pixelData = - CFDataCreateWithBytesNoCopy(NULL, bitmap, _bytesPerRow * _height, NULL); - _pixelData = - (CFDataRef) [[NSData alloc] initWithBytesNoCopy: bitmap - length: _bytesPerRow * _height - freeWhenDone: YES]; + _pixelData = CFDataCreateWithBytesNoCopy(NULL, bitmap, + _bytesPerRow * _height, NULL); + _pixelData = (CFDataRef) + [[NSData alloc] initWithBytesNoCopy: bitmap + length: _bytesPerRow * _height + freeWhenDone: YES]; return self; } diff --git a/Onyx2D/O2ImageDestination.m b/Onyx2D/O2ImageDestination.m index e9370187..cb3eb62f 100644 --- a/Onyx2D/O2ImageDestination.m +++ b/Onyx2D/O2ImageDestination.m @@ -8,11 +8,11 @@ // Using the same value as CoreGraphics - that's removing the needs for // conversion const CFStringRef kO2ImageDestinationLossyCompressionQuality = - (const CFStringRef) @"kCGImageDestinationLossyCompressionQuality"; + (const CFStringRef) @"kCGImageDestinationLossyCompressionQuality"; const CFStringRef kO2ImageDestinationBackgroundColor = - (const CFStringRef) @"kCGImageDestinationBackgroundColor"; + (const CFStringRef) @"kCGImageDestinationBackgroundColor"; const CFStringRef kO2ImageDestinationDPI = - (const CFStringRef) @"kCGImageDestinationDPI"; + (const CFStringRef) @"kCGImageDestinationDPI"; @interface _O2ImageDestination : O2ImageDestination @end @@ -68,7 +68,7 @@ O2ImageDestinationRef O2ImageDestinationCreateWithData(CFMutableDataRef data, { O2DataConsumerRef consumer = O2DataConsumerCreateWithCFData(data); O2ImageDestinationRef self = O2ImageDestinationCreateWithDataConsumer( - consumer, type, imageCount, options); + consumer, type, imageCount, options); O2DataConsumerRelease(consumer); return self; } @@ -79,7 +79,7 @@ O2ImageDestinationCreateWithDataConsumer(O2DataConsumerRef dataConsumer, CFDictionaryRef options) { O2ImageDestinationRef self = - NSAllocateObject([O2ImageDestination class], 0, NULL); + NSAllocateObject([O2ImageDestination class], 0, NULL); if (self) { @@ -129,7 +129,7 @@ O2ImageDestinationRef O2ImageDestinationCreateWithURL(CFURLRef url, { O2DataConsumerRef consumer = O2DataConsumerCreateWithURL(url); O2ImageDestinationRef self = O2ImageDestinationCreateWithDataConsumer( - consumer, type, imageCount, options); + consumer, type, imageCount, options); O2DataConsumerRelease(consumer); return self; } @@ -181,7 +181,7 @@ void O2ImageDestinationAddImageFromSource(O2ImageDestinationRef self, CFDictionaryRef properties) { O2ImageRef image = - O2ImageSourceCreateImageAtIndex(imageSource, index, NULL); + O2ImageSourceCreateImageAtIndex(imageSource, index, NULL); O2ImageDestinationAddImage(self, image, properties); O2ImageRelease(image); } diff --git a/Onyx2D/O2ImageSource_BMP.m b/Onyx2D/O2ImageSource_BMP.m index 8638c56a..634ee012 100644 --- a/Onyx2D/O2ImageSource_BMP.m +++ b/Onyx2D/O2ImageSource_BMP.m @@ -505,8 +505,9 @@ stbi_uc *stbi_bmp_load_from_memory(const stbi_uc *buffer, int len, int *x, { int width, height; int comp; - unsigned char *pixels = stbi_bmp_load_from_memory( - [_bmp bytes], [_bmp length], &width, &height, &comp, STBI_rgb_alpha); + unsigned char *pixels = + stbi_bmp_load_from_memory([_bmp bytes], [_bmp length], &width, + &height, &comp, STBI_rgb_alpha); int bitsPerPixel = 32; int bytesPerRow = (bitsPerPixel / (sizeof(char) * 8)) * width; NSData *bitmap; @@ -518,22 +519,22 @@ stbi_uc *stbi_bmp_load_from_memory(const stbi_uc *buffer, int len, int *x, length: bytesPerRow * height]; O2DataProvider *provider = - O2DataProviderCreateWithCFData((CFDataRef) bitmap); + O2DataProviderCreateWithCFData((CFDataRef) bitmap); O2ColorSpace *colorSpace = O2ColorSpaceCreateDeviceRGB(); O2Image *image = - [[O2Image alloc] initWithWidth: width - height: height - bitsPerComponent: 8 - bitsPerPixel: bitsPerPixel - bytesPerRow: bytesPerRow - colorSpace: colorSpace - bitmapInfo: kO2BitmapByteOrder32Big | - kO2ImageAlphaPremultipliedLast - decoder: NULL - provider: provider - decode: NULL - interpolate: NO - renderingIntent: kO2RenderingIntentDefault]; + [[O2Image alloc] initWithWidth: width + height: height + bitsPerComponent: 8 + bitsPerPixel: bitsPerPixel + bytesPerRow: bytesPerRow + colorSpace: colorSpace + bitmapInfo: kO2BitmapByteOrder32Big | + kO2ImageAlphaPremultipliedLast + decoder: NULL + provider: provider + decode: NULL + interpolate: NO + renderingIntent: kO2RenderingIntentDefault]; [colorSpace release]; [provider release]; diff --git a/Onyx2D/O2ImageSource_GIF.m b/Onyx2D/O2ImageSource_GIF.m index a0f7bff3..fce2ec6b 100644 --- a/Onyx2D/O2ImageSource_GIF.m +++ b/Onyx2D/O2ImageSource_GIF.m @@ -175,23 +175,23 @@ static int readCallback(GifFileType *ft, GifByteType *buf, int count) { } O2DataProvider *provider = - O2DataProviderCreateWithCFData((CFDataRef) bitmap); + O2DataProviderCreateWithCFData((CFDataRef) bitmap); O2BitmapInfo info = - kO2BitmapByteOrder32Big | kO2ImageAlphaPremultipliedLast; + kO2BitmapByteOrder32Big | kO2ImageAlphaPremultipliedLast; O2Image *result = - [[O2Image alloc] initWithWidth: width - height: height - bitsPerComponent: bitsPerComponent - bitsPerPixel: bitsPerPixel - bytesPerRow: bytesPerRow - colorSpace: colorSpace - bitmapInfo: info - decoder: NULL - provider: provider - decode: NULL - interpolate: NO - renderingIntent: kO2RenderingIntentDefault]; + [[O2Image alloc] initWithWidth: width + height: height + bitsPerComponent: bitsPerComponent + bitsPerPixel: bitsPerPixel + bytesPerRow: bytesPerRow + colorSpace: colorSpace + bitmapInfo: info + decoder: NULL + provider: provider + decode: NULL + interpolate: NO + renderingIntent: kO2RenderingIntentDefault]; [colorSpace release]; [provider release]; diff --git a/Onyx2D/O2ImageSource_ICNS.m b/Onyx2D/O2ImageSource_ICNS.m index 1b6264ca..d2ecdf34 100644 --- a/Onyx2D/O2ImageSource_ICNS.m +++ b/Onyx2D/O2ImageSource_ICNS.m @@ -32,101 +32,101 @@ typedef struct O2ICNSNode { } O2ICNSNode; static uint8_t fourBitCLUT[16][3] = { - {0xFF, 0xFF, 0xFF}, {0xFC, 0xF3, 0x05}, {0xFF, 0x64, 0x02}, - {0xDD, 0x08, 0x06}, {0xF2, 0x08, 0x84}, {0x46, 0x00, 0xA5}, - {0x00, 0x00, 0xD4}, {0x02, 0xAB, 0xEA}, {0x1F, 0xB7, 0x14}, - {0x00, 0x64, 0x11}, {0x56, 0x2C, 0x05}, {0x90, 0x71, 0x3A}, - {0xC0, 0xC0, 0xC0}, {0x80, 0x80, 0x80}, {0x40, 0x40, 0x40}, - {0x00, 0x00, 0x00}, + {0xFF, 0xFF, 0xFF}, {0xFC, 0xF3, 0x05}, {0xFF, 0x64, 0x02}, + {0xDD, 0x08, 0x06}, {0xF2, 0x08, 0x84}, {0x46, 0x00, 0xA5}, + {0x00, 0x00, 0xD4}, {0x02, 0xAB, 0xEA}, {0x1F, 0xB7, 0x14}, + {0x00, 0x64, 0x11}, {0x56, 0x2C, 0x05}, {0x90, 0x71, 0x3A}, + {0xC0, 0xC0, 0xC0}, {0x80, 0x80, 0x80}, {0x40, 0x40, 0x40}, + {0x00, 0x00, 0x00}, }; static uint8_t eightBitCLUT[256][3] = { - {0xFF, 0xFF, 0xFF}, {0xFF, 0xFF, 0xCC}, {0xFF, 0xFF, 0x99}, - {0xFF, 0xFF, 0x66}, {0xFF, 0xFF, 0x33}, {0xFF, 0xFF, 0x00}, - {0xFF, 0xCC, 0xFF}, {0xFF, 0xCC, 0xCC}, {0xFF, 0xCC, 0x99}, - {0xFF, 0xCC, 0x66}, {0xFF, 0xCC, 0x33}, {0xFF, 0xCC, 0x00}, - {0xFF, 0x99, 0xFF}, {0xFF, 0x99, 0xCC}, {0xFF, 0x99, 0x99}, - {0xFF, 0x99, 0x66}, {0xFF, 0x99, 0x33}, {0xFF, 0x99, 0x00}, - {0xFF, 0x66, 0xFF}, {0xFF, 0x66, 0xCC}, {0xFF, 0x66, 0x99}, - {0xFF, 0x66, 0x66}, {0xFF, 0x66, 0x33}, {0xFF, 0x66, 0x00}, - {0xFF, 0x33, 0xFF}, {0xFF, 0x33, 0xCC}, {0xFF, 0x33, 0x99}, - {0xFF, 0x33, 0x66}, {0xFF, 0x33, 0x33}, {0xFF, 0x33, 0x00}, - {0xFF, 0x00, 0xFF}, {0xFF, 0x00, 0xCC}, {0xFF, 0x00, 0x99}, - {0xFF, 0x00, 0x66}, {0xFF, 0x00, 0x33}, {0xFF, 0x00, 0x00}, - {0xCC, 0xFF, 0xFF}, {0xCC, 0xFF, 0xCC}, {0xCC, 0xFF, 0x99}, - {0xCC, 0xFF, 0x66}, {0xCC, 0xFF, 0x33}, {0xCC, 0xFF, 0x00}, - {0xCC, 0xCC, 0xFF}, {0xCC, 0xCC, 0xCC}, {0xCC, 0xCC, 0x99}, - {0xCC, 0xCC, 0x66}, {0xCC, 0xCC, 0x33}, {0xCC, 0xCC, 0x00}, - {0xCC, 0x99, 0xFF}, {0xCC, 0x99, 0xCC}, {0xCC, 0x99, 0x99}, - {0xCC, 0x99, 0x66}, {0xCC, 0x99, 0x33}, {0xCC, 0x99, 0x00}, - {0xCC, 0x66, 0xFF}, {0xCC, 0x66, 0xCC}, {0xCC, 0x66, 0x99}, - {0xCC, 0x66, 0x66}, {0xCC, 0x66, 0x33}, {0xCC, 0x66, 0x00}, - {0xCC, 0x33, 0xFF}, {0xCC, 0x33, 0xCC}, {0xCC, 0x33, 0x99}, - {0xCC, 0x33, 0x66}, {0xCC, 0x33, 0x33}, {0xCC, 0x33, 0x00}, - {0xCC, 0x00, 0xFF}, {0xCC, 0x00, 0xCC}, {0xCC, 0x00, 0x99}, - {0xCC, 0x00, 0x66}, {0xCC, 0x00, 0x33}, {0xCC, 0x00, 0x00}, - {0x99, 0xFF, 0xFF}, {0x99, 0xFF, 0xCC}, {0x99, 0xFF, 0x99}, - {0x99, 0xFF, 0x66}, {0x99, 0xFF, 0x33}, {0x99, 0xFF, 0x00}, - {0x99, 0xCC, 0xFF}, {0x99, 0xCC, 0xCC}, {0x99, 0xCC, 0x99}, - {0x99, 0xCC, 0x66}, {0x99, 0xCC, 0x33}, {0x99, 0xCC, 0x00}, - {0x99, 0x99, 0xFF}, {0x99, 0x99, 0xCC}, {0x99, 0x99, 0x99}, - {0x99, 0x99, 0x66}, {0x99, 0x99, 0x33}, {0x99, 0x99, 0x00}, - {0x99, 0x66, 0xFF}, {0x99, 0x66, 0xCC}, {0x99, 0x66, 0x99}, - {0x99, 0x66, 0x66}, {0x99, 0x66, 0x33}, {0x99, 0x66, 0x00}, - {0x99, 0x33, 0xFF}, {0x99, 0x33, 0xCC}, {0x99, 0x33, 0x99}, - {0x99, 0x33, 0x66}, {0x99, 0x33, 0x33}, {0x99, 0x33, 0x00}, - {0x99, 0x00, 0xFF}, {0x99, 0x00, 0xCC}, {0x99, 0x00, 0x99}, - {0x99, 0x00, 0x66}, {0x99, 0x00, 0x33}, {0x99, 0x00, 0x00}, - {0x66, 0xFF, 0xFF}, {0x66, 0xFF, 0xCC}, {0x66, 0xFF, 0x99}, - {0x66, 0xFF, 0x66}, {0x66, 0xFF, 0x33}, {0x66, 0xFF, 0x00}, - {0x66, 0xCC, 0xFF}, {0x66, 0xCC, 0xCC}, {0x66, 0xCC, 0x99}, - {0x66, 0xCC, 0x66}, {0x66, 0xCC, 0x33}, {0x66, 0xCC, 0x00}, - {0x66, 0x99, 0xFF}, {0x66, 0x99, 0xCC}, {0x66, 0x99, 0x99}, - {0x66, 0x99, 0x66}, {0x66, 0x99, 0x33}, {0x66, 0x99, 0x00}, - {0x66, 0x66, 0xFF}, {0x66, 0x66, 0xCC}, {0x66, 0x66, 0x99}, - {0x66, 0x66, 0x66}, {0x66, 0x66, 0x33}, {0x66, 0x66, 0x00}, - {0x66, 0x33, 0xFF}, {0x66, 0x33, 0xCC}, {0x66, 0x33, 0x99}, - {0x66, 0x33, 0x66}, {0x66, 0x33, 0x33}, {0x66, 0x33, 0x00}, - {0x66, 0x00, 0xFF}, {0x66, 0x00, 0xCC}, {0x66, 0x00, 0x99}, - {0x66, 0x00, 0x66}, {0x66, 0x00, 0x33}, {0x66, 0x00, 0x00}, - {0x33, 0xFF, 0xFF}, {0x33, 0xFF, 0xCC}, {0x33, 0xFF, 0x99}, - {0x33, 0xFF, 0x66}, {0x33, 0xFF, 0x33}, {0x33, 0xFF, 0x00}, - {0x33, 0xCC, 0xFF}, {0x33, 0xCC, 0xCC}, {0x33, 0xCC, 0x99}, - {0x33, 0xCC, 0x66}, {0x33, 0xCC, 0x33}, {0x33, 0xCC, 0x00}, - {0x33, 0x99, 0xFF}, {0x33, 0x99, 0xCC}, {0x33, 0x99, 0x99}, - {0x33, 0x99, 0x66}, {0x33, 0x99, 0x33}, {0x33, 0x99, 0x00}, - {0x33, 0x66, 0xFF}, {0x33, 0x66, 0xCC}, {0x33, 0x66, 0x99}, - {0x33, 0x66, 0x66}, {0x33, 0x66, 0x33}, {0x33, 0x66, 0x00}, - {0x33, 0x33, 0xFF}, {0x33, 0x33, 0xCC}, {0x33, 0x33, 0x99}, - {0x33, 0x33, 0x66}, {0x33, 0x33, 0x33}, {0x33, 0x33, 0x00}, - {0x33, 0x00, 0xFF}, {0x33, 0x00, 0xCC}, {0x33, 0x00, 0x99}, - {0x33, 0x00, 0x66}, {0x33, 0x00, 0x33}, {0x33, 0x00, 0x00}, - {0x00, 0xFF, 0xFF}, {0x00, 0xFF, 0xCC}, {0x00, 0xFF, 0x99}, - {0x00, 0xFF, 0x66}, {0x00, 0xFF, 0x33}, {0x00, 0xFF, 0x00}, - {0x00, 0xCC, 0xFF}, {0x00, 0xCC, 0xCC}, {0x00, 0xCC, 0x99}, - {0x00, 0xCC, 0x66}, {0x00, 0xCC, 0x33}, {0x00, 0xCC, 0x00}, - {0x00, 0x99, 0xFF}, {0x00, 0x99, 0xCC}, {0x00, 0x99, 0x99}, - {0x00, 0x99, 0x66}, {0x00, 0x99, 0x33}, {0x00, 0x99, 0x00}, - {0x00, 0x66, 0xFF}, {0x00, 0x66, 0xCC}, {0x00, 0x66, 0x99}, - {0x00, 0x66, 0x66}, {0x00, 0x66, 0x33}, {0x00, 0x66, 0x00}, - {0x00, 0x33, 0xFF}, {0x00, 0x33, 0xCC}, {0x00, 0x33, 0x99}, - {0x00, 0x33, 0x66}, {0x00, 0x33, 0x33}, {0x00, 0x33, 0x00}, - {0x00, 0x00, 0xFF}, {0x00, 0x00, 0xCC}, {0x00, 0x00, 0x99}, - {0x00, 0x00, 0x66}, {0x00, 0x00, 0x33}, {0xEE, 0x00, 0x00}, - {0xDD, 0x00, 0x00}, {0xBB, 0x00, 0x00}, {0xAA, 0x00, 0x00}, - {0x88, 0x00, 0x00}, {0x77, 0x00, 0x00}, {0x55, 0x00, 0x00}, - {0x44, 0x00, 0x00}, {0x22, 0x00, 0x00}, {0x11, 0x00, 0x00}, - {0x00, 0xEE, 0x00}, {0x00, 0xDD, 0x00}, {0x00, 0xBB, 0x00}, - {0x00, 0xAA, 0x00}, {0x00, 0x88, 0x00}, {0x00, 0x77, 0x00}, - {0x00, 0x55, 0x00}, {0x00, 0x44, 0x00}, {0x00, 0x22, 0x00}, - {0x00, 0x11, 0x00}, {0x00, 0x00, 0xEE}, {0x00, 0x00, 0xDD}, - {0x00, 0x00, 0xBB}, {0x00, 0x00, 0xAA}, {0x00, 0x00, 0x88}, - {0x00, 0x00, 0x77}, {0x00, 0x00, 0x55}, {0x00, 0x00, 0x44}, - {0x00, 0x00, 0x22}, {0x00, 0x00, 0x11}, {0xEE, 0xEE, 0xEE}, - {0xDD, 0xDD, 0xDD}, {0xBB, 0xBB, 0xBB}, {0xAA, 0xAA, 0xAA}, - {0x88, 0x88, 0x88}, {0x77, 0x77, 0x77}, {0x55, 0x55, 0x55}, - {0x44, 0x44, 0x44}, {0x22, 0x22, 0x22}, {0x11, 0x11, 0x11}, - {0x00, 0x00, 0x00}, + {0xFF, 0xFF, 0xFF}, {0xFF, 0xFF, 0xCC}, {0xFF, 0xFF, 0x99}, + {0xFF, 0xFF, 0x66}, {0xFF, 0xFF, 0x33}, {0xFF, 0xFF, 0x00}, + {0xFF, 0xCC, 0xFF}, {0xFF, 0xCC, 0xCC}, {0xFF, 0xCC, 0x99}, + {0xFF, 0xCC, 0x66}, {0xFF, 0xCC, 0x33}, {0xFF, 0xCC, 0x00}, + {0xFF, 0x99, 0xFF}, {0xFF, 0x99, 0xCC}, {0xFF, 0x99, 0x99}, + {0xFF, 0x99, 0x66}, {0xFF, 0x99, 0x33}, {0xFF, 0x99, 0x00}, + {0xFF, 0x66, 0xFF}, {0xFF, 0x66, 0xCC}, {0xFF, 0x66, 0x99}, + {0xFF, 0x66, 0x66}, {0xFF, 0x66, 0x33}, {0xFF, 0x66, 0x00}, + {0xFF, 0x33, 0xFF}, {0xFF, 0x33, 0xCC}, {0xFF, 0x33, 0x99}, + {0xFF, 0x33, 0x66}, {0xFF, 0x33, 0x33}, {0xFF, 0x33, 0x00}, + {0xFF, 0x00, 0xFF}, {0xFF, 0x00, 0xCC}, {0xFF, 0x00, 0x99}, + {0xFF, 0x00, 0x66}, {0xFF, 0x00, 0x33}, {0xFF, 0x00, 0x00}, + {0xCC, 0xFF, 0xFF}, {0xCC, 0xFF, 0xCC}, {0xCC, 0xFF, 0x99}, + {0xCC, 0xFF, 0x66}, {0xCC, 0xFF, 0x33}, {0xCC, 0xFF, 0x00}, + {0xCC, 0xCC, 0xFF}, {0xCC, 0xCC, 0xCC}, {0xCC, 0xCC, 0x99}, + {0xCC, 0xCC, 0x66}, {0xCC, 0xCC, 0x33}, {0xCC, 0xCC, 0x00}, + {0xCC, 0x99, 0xFF}, {0xCC, 0x99, 0xCC}, {0xCC, 0x99, 0x99}, + {0xCC, 0x99, 0x66}, {0xCC, 0x99, 0x33}, {0xCC, 0x99, 0x00}, + {0xCC, 0x66, 0xFF}, {0xCC, 0x66, 0xCC}, {0xCC, 0x66, 0x99}, + {0xCC, 0x66, 0x66}, {0xCC, 0x66, 0x33}, {0xCC, 0x66, 0x00}, + {0xCC, 0x33, 0xFF}, {0xCC, 0x33, 0xCC}, {0xCC, 0x33, 0x99}, + {0xCC, 0x33, 0x66}, {0xCC, 0x33, 0x33}, {0xCC, 0x33, 0x00}, + {0xCC, 0x00, 0xFF}, {0xCC, 0x00, 0xCC}, {0xCC, 0x00, 0x99}, + {0xCC, 0x00, 0x66}, {0xCC, 0x00, 0x33}, {0xCC, 0x00, 0x00}, + {0x99, 0xFF, 0xFF}, {0x99, 0xFF, 0xCC}, {0x99, 0xFF, 0x99}, + {0x99, 0xFF, 0x66}, {0x99, 0xFF, 0x33}, {0x99, 0xFF, 0x00}, + {0x99, 0xCC, 0xFF}, {0x99, 0xCC, 0xCC}, {0x99, 0xCC, 0x99}, + {0x99, 0xCC, 0x66}, {0x99, 0xCC, 0x33}, {0x99, 0xCC, 0x00}, + {0x99, 0x99, 0xFF}, {0x99, 0x99, 0xCC}, {0x99, 0x99, 0x99}, + {0x99, 0x99, 0x66}, {0x99, 0x99, 0x33}, {0x99, 0x99, 0x00}, + {0x99, 0x66, 0xFF}, {0x99, 0x66, 0xCC}, {0x99, 0x66, 0x99}, + {0x99, 0x66, 0x66}, {0x99, 0x66, 0x33}, {0x99, 0x66, 0x00}, + {0x99, 0x33, 0xFF}, {0x99, 0x33, 0xCC}, {0x99, 0x33, 0x99}, + {0x99, 0x33, 0x66}, {0x99, 0x33, 0x33}, {0x99, 0x33, 0x00}, + {0x99, 0x00, 0xFF}, {0x99, 0x00, 0xCC}, {0x99, 0x00, 0x99}, + {0x99, 0x00, 0x66}, {0x99, 0x00, 0x33}, {0x99, 0x00, 0x00}, + {0x66, 0xFF, 0xFF}, {0x66, 0xFF, 0xCC}, {0x66, 0xFF, 0x99}, + {0x66, 0xFF, 0x66}, {0x66, 0xFF, 0x33}, {0x66, 0xFF, 0x00}, + {0x66, 0xCC, 0xFF}, {0x66, 0xCC, 0xCC}, {0x66, 0xCC, 0x99}, + {0x66, 0xCC, 0x66}, {0x66, 0xCC, 0x33}, {0x66, 0xCC, 0x00}, + {0x66, 0x99, 0xFF}, {0x66, 0x99, 0xCC}, {0x66, 0x99, 0x99}, + {0x66, 0x99, 0x66}, {0x66, 0x99, 0x33}, {0x66, 0x99, 0x00}, + {0x66, 0x66, 0xFF}, {0x66, 0x66, 0xCC}, {0x66, 0x66, 0x99}, + {0x66, 0x66, 0x66}, {0x66, 0x66, 0x33}, {0x66, 0x66, 0x00}, + {0x66, 0x33, 0xFF}, {0x66, 0x33, 0xCC}, {0x66, 0x33, 0x99}, + {0x66, 0x33, 0x66}, {0x66, 0x33, 0x33}, {0x66, 0x33, 0x00}, + {0x66, 0x00, 0xFF}, {0x66, 0x00, 0xCC}, {0x66, 0x00, 0x99}, + {0x66, 0x00, 0x66}, {0x66, 0x00, 0x33}, {0x66, 0x00, 0x00}, + {0x33, 0xFF, 0xFF}, {0x33, 0xFF, 0xCC}, {0x33, 0xFF, 0x99}, + {0x33, 0xFF, 0x66}, {0x33, 0xFF, 0x33}, {0x33, 0xFF, 0x00}, + {0x33, 0xCC, 0xFF}, {0x33, 0xCC, 0xCC}, {0x33, 0xCC, 0x99}, + {0x33, 0xCC, 0x66}, {0x33, 0xCC, 0x33}, {0x33, 0xCC, 0x00}, + {0x33, 0x99, 0xFF}, {0x33, 0x99, 0xCC}, {0x33, 0x99, 0x99}, + {0x33, 0x99, 0x66}, {0x33, 0x99, 0x33}, {0x33, 0x99, 0x00}, + {0x33, 0x66, 0xFF}, {0x33, 0x66, 0xCC}, {0x33, 0x66, 0x99}, + {0x33, 0x66, 0x66}, {0x33, 0x66, 0x33}, {0x33, 0x66, 0x00}, + {0x33, 0x33, 0xFF}, {0x33, 0x33, 0xCC}, {0x33, 0x33, 0x99}, + {0x33, 0x33, 0x66}, {0x33, 0x33, 0x33}, {0x33, 0x33, 0x00}, + {0x33, 0x00, 0xFF}, {0x33, 0x00, 0xCC}, {0x33, 0x00, 0x99}, + {0x33, 0x00, 0x66}, {0x33, 0x00, 0x33}, {0x33, 0x00, 0x00}, + {0x00, 0xFF, 0xFF}, {0x00, 0xFF, 0xCC}, {0x00, 0xFF, 0x99}, + {0x00, 0xFF, 0x66}, {0x00, 0xFF, 0x33}, {0x00, 0xFF, 0x00}, + {0x00, 0xCC, 0xFF}, {0x00, 0xCC, 0xCC}, {0x00, 0xCC, 0x99}, + {0x00, 0xCC, 0x66}, {0x00, 0xCC, 0x33}, {0x00, 0xCC, 0x00}, + {0x00, 0x99, 0xFF}, {0x00, 0x99, 0xCC}, {0x00, 0x99, 0x99}, + {0x00, 0x99, 0x66}, {0x00, 0x99, 0x33}, {0x00, 0x99, 0x00}, + {0x00, 0x66, 0xFF}, {0x00, 0x66, 0xCC}, {0x00, 0x66, 0x99}, + {0x00, 0x66, 0x66}, {0x00, 0x66, 0x33}, {0x00, 0x66, 0x00}, + {0x00, 0x33, 0xFF}, {0x00, 0x33, 0xCC}, {0x00, 0x33, 0x99}, + {0x00, 0x33, 0x66}, {0x00, 0x33, 0x33}, {0x00, 0x33, 0x00}, + {0x00, 0x00, 0xFF}, {0x00, 0x00, 0xCC}, {0x00, 0x00, 0x99}, + {0x00, 0x00, 0x66}, {0x00, 0x00, 0x33}, {0xEE, 0x00, 0x00}, + {0xDD, 0x00, 0x00}, {0xBB, 0x00, 0x00}, {0xAA, 0x00, 0x00}, + {0x88, 0x00, 0x00}, {0x77, 0x00, 0x00}, {0x55, 0x00, 0x00}, + {0x44, 0x00, 0x00}, {0x22, 0x00, 0x00}, {0x11, 0x00, 0x00}, + {0x00, 0xEE, 0x00}, {0x00, 0xDD, 0x00}, {0x00, 0xBB, 0x00}, + {0x00, 0xAA, 0x00}, {0x00, 0x88, 0x00}, {0x00, 0x77, 0x00}, + {0x00, 0x55, 0x00}, {0x00, 0x44, 0x00}, {0x00, 0x22, 0x00}, + {0x00, 0x11, 0x00}, {0x00, 0x00, 0xEE}, {0x00, 0x00, 0xDD}, + {0x00, 0x00, 0xBB}, {0x00, 0x00, 0xAA}, {0x00, 0x00, 0x88}, + {0x00, 0x00, 0x77}, {0x00, 0x00, 0x55}, {0x00, 0x00, 0x44}, + {0x00, 0x00, 0x22}, {0x00, 0x00, 0x11}, {0xEE, 0xEE, 0xEE}, + {0xDD, 0xDD, 0xDD}, {0xBB, 0xBB, 0xBB}, {0xAA, 0xAA, 0xAA}, + {0x88, 0x88, 0x88}, {0x77, 0x77, 0x77}, {0x55, 0x55, 0x55}, + {0x44, 0x44, 0x44}, {0x22, 0x22, 0x22}, {0x11, 0x11, 0x11}, + {0x00, 0x00, 0x00}, }; @implementation O2ImageSource_ICNS @@ -174,9 +174,9 @@ static uint8_t nextUnsigned8(O2ImageSource_ICNS *self) { if (self->_position < self->_length) return self->_bytes[self->_position++]; - [NSException - raise: NSInvalidArgumentException - format: @"Attempt to read past end of ICNS, length=%d", self->_length]; + [NSException raise: NSInvalidArgumentException + format: @"Attempt to read past end of ICNS, length=%d", + self->_length]; return 0; } @@ -212,7 +212,7 @@ static uint32_t nextUnsigned32(O2ImageSource_ICNS *self) { result->samples = NSZoneCalloc(NULL, width * height, sizeof(uint8_t)); else { result->samples = - NSZoneCalloc(NULL, width * height, sizeof(O2rgba8u_BE)); + NSZoneCalloc(NULL, width * height, sizeof(O2rgba8u_BE)); O2rgba8u_BE *pixels = result->samples; int i; @@ -615,26 +615,26 @@ static uint32_t nextUnsigned32(O2ImageSource_ICNS *self) { O2ColorSpaceRef colorSpace = O2ColorSpaceCreateDeviceRGB(); NSData *bitmap = [[NSData alloc] - initWithBytesNoCopy: pixels - length: pixelCount * sizeof(O2rgba8u_BE)]; + initWithBytesNoCopy: pixels + length: pixelCount * sizeof(O2rgba8u_BE)]; O2DataProvider *provider = - O2DataProviderCreateWithCFData((CFDataRef) bitmap); + O2DataProviderCreateWithCFData((CFDataRef) bitmap); O2BitmapInfo info = - kO2BitmapByteOrder32Big | kO2ImageAlphaPremultipliedLast; + kO2BitmapByteOrder32Big | kO2ImageAlphaPremultipliedLast; O2Image *result = [[O2Image alloc] - initWithWidth: iconNode->width - height: iconNode->height - bitsPerComponent: 8 - bitsPerPixel: 32 - bytesPerRow: iconNode->width * sizeof(O2rgba8u_BE) - colorSpace: colorSpace - bitmapInfo: info - decoder: NULL - provider: provider - decode: NULL - interpolate: NO - renderingIntent: kO2RenderingIntentDefault]; + initWithWidth: iconNode->width + height: iconNode->height + bitsPerComponent: 8 + bitsPerPixel: 32 + bytesPerRow: iconNode->width * sizeof(O2rgba8u_BE) + colorSpace: colorSpace + bitmapInfo: info + decoder: NULL + provider: provider + decode: NULL + interpolate: NO + renderingIntent: kO2RenderingIntentDefault]; O2ColorSpaceRelease(colorSpace); O2DataProviderRelease(provider); diff --git a/Onyx2D/O2ImageSource_JPEG.m b/Onyx2D/O2ImageSource_JPEG.m index db935bb9..2586baaa 100644 --- a/Onyx2D/O2ImageSource_JPEG.m +++ b/Onyx2D/O2ImageSource_JPEG.m @@ -45,7 +45,7 @@ createImageDecoderWithDataProvider(O2DataProviderRef dataProvider) { #ifdef LIBJPEG_PRESENT return [[O2ImageDecoder_JPEG_libjpeg alloc] - initWithDataProvider: dataProvider]; + initWithDataProvider: dataProvider]; #else return [[O2ImageDecoder_JPEG_stb alloc] initWithDataProvider: dataProvider]; #endif @@ -53,9 +53,9 @@ createImageDecoderWithDataProvider(O2DataProviderRef dataProvider) NSData *O2DCTDecode(NSData *data, size_t *pBytesPerRow) { O2DataProviderRef dataProvider = - O2DataProviderCreateWithCFData((CFDataRef) data); + O2DataProviderCreateWithCFData((CFDataRef) data); O2ImageDecoderRef decoder = - createImageDecoderWithDataProvider(dataProvider); + createImageDecoderWithDataProvider(dataProvider); CFDataRef result = O2ImageDecoderCreatePixelData(decoder); if (pBytesPerRow != NULL) { @@ -115,8 +115,8 @@ NSData *O2DCTDecode(NSData *data, size_t *pBytesPerRow) { const unsigned char *data = CFDataGetBytePtr(_jpg); unsigned long length = CFDataGetLength(_jpg); O2EXIFDecoder *exif = - [[[O2EXIFDecoder alloc] initWithBytes: data - length: length] autorelease]; + [[[O2EXIFDecoder alloc] initWithBytes: data + length: length] autorelease]; return (CFDictionaryRef)[[exif tags] copy]; } @@ -127,18 +127,18 @@ NSData *O2DCTDecode(NSData *data, size_t *pBytesPerRow) { O2DataProviderRef provider = O2ImageDecoderCreatePixelDataProvider(decoder); O2Image *image = [[O2Image alloc] - initWithWidth: O2ImageDecoderGetWidth(decoder) - height: O2ImageDecoderGetHeight(decoder) - bitsPerComponent: O2ImageDecoderGetBitsPerComponent(decoder) - bitsPerPixel: O2ImageDecoderGetBitsPerPixel(decoder) - bytesPerRow: O2ImageDecoderGetBytesPerRow(decoder) - colorSpace: O2ImageDecoderGetColorSpace(decoder) - bitmapInfo: O2ImageDecoderGetBitmapInfo(decoder) - decoder: decoder - provider: provider - decode: NULL - interpolate: NO - renderingIntent: kO2RenderingIntentDefault]; + initWithWidth: O2ImageDecoderGetWidth(decoder) + height: O2ImageDecoderGetHeight(decoder) + bitsPerComponent: O2ImageDecoderGetBitsPerComponent(decoder) + bitsPerPixel: O2ImageDecoderGetBitsPerPixel(decoder) + bytesPerRow: O2ImageDecoderGetBytesPerRow(decoder) + colorSpace: O2ImageDecoderGetColorSpace(decoder) + bitmapInfo: O2ImageDecoderGetBitmapInfo(decoder) + decoder: decoder + provider: provider + decode: NULL + interpolate: NO + renderingIntent: kO2RenderingIntentDefault]; O2DataProviderRelease(provider); [decoder release]; diff --git a/Onyx2D/O2ImageSource_PNG.m b/Onyx2D/O2ImageSource_PNG.m index 9c2c2d02..3f031613 100644 --- a/Onyx2D/O2ImageSource_PNG.m +++ b/Onyx2D/O2ImageSource_PNG.m @@ -697,8 +697,9 @@ unsigned char *stbi_png_load_from_memory(const unsigned char *buffer, int len, i { int width, height; int comp; - unsigned char *pixels = stbi_png_load_from_memory( - [_png bytes], [_png length], &width, &height, &comp, STBI_rgb_alpha); + unsigned char *pixels = + stbi_png_load_from_memory([_png bytes], [_png length], &width, + &height, &comp, STBI_rgb_alpha); int bitsPerPixel = 32; int bytesPerRow = (bitsPerPixel / (sizeof(char) * 8)) * width; NSData *bitmap; @@ -726,22 +727,22 @@ unsigned char *stbi_png_load_from_memory(const unsigned char *buffer, int len, i length: bytesPerRow * height]; O2DataProvider *provider = - O2DataProviderCreateWithCFData((CFDataRef) bitmap); + O2DataProviderCreateWithCFData((CFDataRef) bitmap); O2ColorSpaceRef colorSpace = O2ColorSpaceCreateDeviceRGB(); O2Image *image = - [[O2Image alloc] initWithWidth: width - height: height - bitsPerComponent: 8 - bitsPerPixel: bitsPerPixel - bytesPerRow: bytesPerRow - colorSpace: colorSpace - bitmapInfo: kO2ImageAlphaPremultipliedLast | - kO2BitmapByteOrder32Big - decoder: NULL - provider: provider - decode: NULL - interpolate: NO - renderingIntent: kO2RenderingIntentDefault]; + [[O2Image alloc] initWithWidth: width + height: height + bitsPerComponent: 8 + bitsPerPixel: bitsPerPixel + bytesPerRow: bytesPerRow + colorSpace: colorSpace + bitmapInfo: kO2ImageAlphaPremultipliedLast | + kO2BitmapByteOrder32Big + decoder: NULL + provider: provider + decode: NULL + interpolate: NO + renderingIntent: kO2RenderingIntentDefault]; [colorSpace release]; [provider release]; diff --git a/Onyx2D/O2ImageSource_TIFF.m b/Onyx2D/O2ImageSource_TIFF.m index fdb4c81d..c6c6baf6 100644 --- a/Onyx2D/O2ImageSource_TIFF.m +++ b/Onyx2D/O2ImageSource_TIFF.m @@ -134,22 +134,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ length: bytesPerRow * height]; O2DataProvider *provider = - O2DataProviderCreateWithCFData((CFDataRef) bitmap); + O2DataProviderCreateWithCFData((CFDataRef) bitmap); O2ColorSpaceRef colorSpace = O2ColorSpaceCreateDeviceRGB(); O2Image *image = - [[O2Image alloc] initWithWidth: width - height: height - bitsPerComponent: 8 - bitsPerPixel: bitsPerPixel - bytesPerRow: bytesPerRow - colorSpace: colorSpace - bitmapInfo: kO2BitmapByteOrder32Big | - kO2ImageAlphaPremultipliedLast - decoder: NULL - provider: provider - decode: NULL - interpolate: NO - renderingIntent: kO2RenderingIntentDefault]; + [[O2Image alloc] initWithWidth: width + height: height + bitsPerComponent: 8 + bitsPerPixel: bitsPerPixel + bytesPerRow: bytesPerRow + colorSpace: colorSpace + bitmapInfo: kO2BitmapByteOrder32Big | + kO2ImageAlphaPremultipliedLast + decoder: NULL + provider: provider + decode: NULL + interpolate: NO + renderingIntent: kO2RenderingIntentDefault]; [colorSpace release]; [provider release]; diff --git a/Onyx2D/O2LZW.m b/Onyx2D/O2LZW.m index bb99c598..c9325931 100644 --- a/Onyx2D/O2LZW.m +++ b/Onyx2D/O2LZW.m @@ -216,8 +216,8 @@ int DLZWDecompressLine(LZWFileType *LZWFile, O2DataConsumerRef consumer, if (CrntCode == LZWFile->RunningCode - RUNNING_CODE_MINUS) { CrntPrefix = LastCode; Suffix[LZWFile->RunningCode - RUNNING_CODE_MINUS] = - Stack[StackPtr++] = - DLZWGetPrefixChar(Prefix, LastCode, ClearCode); + Stack[StackPtr++] = DLZWGetPrefixChar( + Prefix, LastCode, ClearCode); } else { LZWFile->LZWError = D_GIF_ERR_IMAGE_DEFECT; NSLog(@"error at %s %d", __FILE__, __LINE__); @@ -264,10 +264,10 @@ int DLZWDecompressLine(LZWFileType *LZWFile, O2DataConsumerRef consumer, * prefix code is last code and the suffix char is * exactly the prefix of last code! */ Suffix[LZWFile->RunningCode - RUNNING_CODE_MINUS] = - DLZWGetPrefixChar(Prefix, LastCode, ClearCode); + DLZWGetPrefixChar(Prefix, LastCode, ClearCode); } else { Suffix[LZWFile->RunningCode - RUNNING_CODE_MINUS] = - DLZWGetPrefixChar(Prefix, CrntCode, ClearCode); + DLZWGetPrefixChar(Prefix, CrntCode, ClearCode); } } LastCode = CrntCode; @@ -283,7 +283,7 @@ int DLZWDecompressLine(LZWFileType *LZWFile, O2DataConsumerRef consumer, NSData *LZWDecodeWithExpectedResultLength(NSData *data, unsigned stripLength) { NSMutableData *outputData = [NSMutableData data]; O2DataConsumerRef consumer = - O2DataConsumerCreateWithCFData((CFMutableDataRef) outputData); + O2DataConsumerCreateWithCFData((CFMutableDataRef) outputData); LZWFileType lzwStream; lzwStream.inputStream = [NSInputStream inputStreamWithData: data]; diff --git a/Onyx2D/O2MutablePath.m b/Onyx2D/O2MutablePath.m index 8bbb192e..cb87b609 100644 --- a/Onyx2D/O2MutablePath.m +++ b/Onyx2D/O2MutablePath.m @@ -102,9 +102,9 @@ O2MutablePathRef O2PathCreateMutable(void) { } - initWithOperators: (unsigned char *) elements - numberOfElements: (size_t) numberOfElements - points: (O2Point *) points - numberOfPoints: (size_t) numberOfPoints + numberOfElements: (size_t) numberOfElements + points: (O2Point *) points + numberOfPoints: (size_t) numberOfPoints { O2PathInitWithOperators(self, elements, numberOfElements, points, numberOfPoints); @@ -131,7 +131,7 @@ static inline void expandOperatorCapacity(O2MutablePath *self, size_t delta) { self->_capacityOfElements *= 2; self->_elements = - NSZoneRealloc(NULL, self->_elements, self->_capacityOfElements); + NSZoneRealloc(NULL, self->_elements, self->_capacityOfElements); } } @@ -143,7 +143,7 @@ static inline void expandPointCapacity(O2MutablePath *self, size_t delta) { self->_capacityOfPoints *= 2; self->_points = NSZoneRealloc( - NULL, self->_points, self->_capacityOfPoints * sizeof(O2Point)); + NULL, self->_points, self->_capacityOfPoints * sizeof(O2Point)); } } @@ -213,7 +213,7 @@ void O2PathAddQuadCurveToPoint(O2MutablePathRef self, expandOperatorCapacity(self, 1); expandPointCapacity(self, 2); self->_elements[self->_numberOfElements++] = - kO2PathElementAddQuadCurveToPoint; + kO2PathElementAddQuadCurveToPoint; self->_points[self->_numberOfPoints++] = cp1; self->_points[self->_numberOfPoints++] = endPoint; } @@ -305,9 +305,9 @@ void O2PathAddArc(O2MutablePathRef self, const O2AffineTransform *matrix, for (i = 0; i < 4; i++) { points[pointsIndex].x = - x + (XY[i * 2] * c - XY[i * 2 + 1] * s) * radiusx; + x + (XY[i * 2] * c - XY[i * 2 + 1] * s) * radiusx; points[pointsIndex].y = - y + (XY[i * 2] * s + XY[i * 2 + 1] * c) * radiusy; + y + (XY[i * 2] * s + XY[i * 2 + 1] * c) * radiusy; pointsIndex++; } } @@ -477,7 +477,7 @@ void O2PathAddPath(O2MutablePathRef self, const O2AffineTransform *matrix, } else { for (i = 0; i < pointCount; i++) self->_points[self->_numberOfPoints++] = - O2PointApplyAffineTransform(points[i], *matrix); + O2PointApplyAffineTransform(points[i], *matrix); } } @@ -487,7 +487,7 @@ void O2PathApplyTransform(O2MutablePathRef self, const O2AffineTransform matrix) for (i = 0; i < self->_numberOfPoints; i++) self->_points[i] = - O2PointApplyAffineTransform(self->_points[i], matrix); + O2PointApplyAffineTransform(self->_points[i], matrix); } @end diff --git a/Onyx2D/O2PDFBlock.m b/Onyx2D/O2PDFBlock.m index 6771b915..e6c4281c 100644 --- a/Onyx2D/O2PDFBlock.m +++ b/Onyx2D/O2PDFBlock.m @@ -31,7 +31,7 @@ - (NSString *) description { return [NSString - stringWithFormat: @"<%@ %x> { %@ }", [self class], self, _objects]; + stringWithFormat: @"<%@ %x> { %@ }", [self class], self, _objects]; } @end diff --git a/Onyx2D/O2PDFCharWidths.m b/Onyx2D/O2PDFCharWidths.m index 170ffc9d..7d081bee 100644 --- a/Onyx2D/O2PDFCharWidths.m +++ b/Onyx2D/O2PDFCharWidths.m @@ -4,9 +4,9 @@ @implementation O2PDFCharWidths - initWithArray: (O2PDFArray *) array - firstChar: (int) firstChar - lastChar: (int) lastChar - missingWidth: (CGFloat) missingWidth + firstChar: (int) firstChar + lastChar: (int) lastChar + missingWidth: (CGFloat) missingWidth { int i, arrayIndex; diff --git a/Onyx2D/O2PDFContentStream.m b/Onyx2D/O2PDFContentStream.m index dfa66519..39c1c587 100644 --- a/Onyx2D/O2PDFContentStream.m +++ b/Onyx2D/O2PDFContentStream.m @@ -62,8 +62,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithStream: (O2PDFStream *) stream - resources: (O2PDFDictionary *) resources - parent: (O2PDFContentStream *) parent + resources: (O2PDFDictionary *) resources + parent: (O2PDFContentStream *) parent { NSArray *array = [NSArray arrayWithObject: stream]; diff --git a/Onyx2D/O2PDFContext.m b/Onyx2D/O2PDFContext.m index e83f6f8a..31ab90da 100644 --- a/Onyx2D/O2PDFContext.m +++ b/Onyx2D/O2PDFContext.m @@ -52,15 +52,15 @@ const NSString *kO2PDFContextTitle = @"kO2PDFContextTitle"; } - initWithConsumer: (O2DataConsumer *) consumer - mediaBox: (const O2Rect *) mediaBox - auxiliaryInfo: (NSDictionary *) auxiliaryInfo + mediaBox: (const O2Rect *) mediaBox + auxiliaryInfo: (NSDictionary *) auxiliaryInfo { [super init]; _dataConsumer = [consumer retain]; _fontCache = [NSMutableDictionary new]; - _objectToRef = - NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 0); + _objectToRef = NSCreateMapTable(NSObjectMapKeyCallBacks, + NSObjectMapValueCallBacks, 0); _indirectObjects = [NSMutableArray new]; _indirectEntries = [NSMutableArray new]; _nextNumber = 1; @@ -70,19 +70,19 @@ const NSString *kO2PDFContextTitle = @"kO2PDFContextTitle"; [self appendCString: "%PDF-1.3\n"]; _info = [[O2PDFDictionary pdfDictionary] retain]; - [_info - setObjectForKey: "Author" - value: [O2PDFString pdfObjectWithString: NSFullUserName()]]; - [_info - setObjectForKey: "Creator" - value: [O2PDFString - pdfObjectWithString: [[NSProcessInfo processInfo] - processName]]]; - [_info setObjectForKey: "Producer" + [_info setObjectForKey: "Author" value: [O2PDFString - pdfObjectWithCString: - "THE COCOTRON http://www.cocotron.org " - "O2PDFContext"]]; + pdfObjectWithString: NSFullUserName()]]; + [_info setObjectForKey: "Creator" + value: [O2PDFString + pdfObjectWithString: [[NSProcessInfo + processInfo] + processName]]]; + [_info setObjectForKey: "Producer" + value: [O2PDFString pdfObjectWithCString: + "THE COCOTRON " + "http://www.cocotron.org " + "O2PDFContext"]]; [[_xref trailer] setObjectForKey: "Info" value: _info]; _catalog = [[O2PDFDictionary pdfDictionary] retain]; @@ -229,9 +229,9 @@ const NSString *kO2PDFContextTitle = @"kO2PDFContextTitle"; if (result == nil) { O2PDFxrefEntry *entry = - [O2PDFxrefEntry xrefEntryWithPosition: 0 - number: _nextNumber - generation: 0]; + [O2PDFxrefEntry xrefEntryWithPosition: 0 + number: _nextNumber + generation: 0]; result = [O2PDFObject_R pdfObjectWithNumber: _nextNumber generation: 0 @@ -289,19 +289,19 @@ const NSString *kO2PDFContextTitle = @"kO2PDFContextTitle"; [self appendPDFStringWithBytes: bytes length: length toObject: [[_contentStreamStack lastObject] - mutableData]]; + mutableData]]; } - (O2PDFObject *) referenceForFontWithName: (NSString *) name size: (O2Float) size { return [(NSDictionary *) [_fontCache objectForKey: name] - objectForKey: [NSNumber numberWithFloat: size]]; + objectForKey: [NSNumber numberWithFloat: size]]; } - (void) setReference: (O2PDFObject *) reference - forFontWithName: (NSString *) name - size: (O2Float) size + forFontWithName: (NSString *) name + size: (O2Float) size { NSMutableDictionary *sizes = [_fontCache objectForKey: name]; @@ -336,8 +336,9 @@ const NSString *kO2PDFContextTitle = @"kO2PDFContextTitle"; next = [NSNumber numberWithInt: (next == nil) ? 0 : [next intValue] + 1]; [_categoryToNext setObject: next forKey: key]; - const char *objectName = [[NSString - stringWithFormat: @"%s%d", categoryName, [next intValue]] UTF8String]; + const char *objectName = + [[NSString stringWithFormat: @"%s%d", categoryName, [next intValue]] + UTF8String]; [category setObjectForKey: objectName value: pdfObject]; return [O2PDFObject_Name pdfObjectWithCString: objectName]; @@ -349,21 +350,21 @@ const NSString *kO2PDFContextTitle = @"kO2PDFContextTitle"; const O2Point *points = O2PathPoints(path); NSInteger pi = 0; O2AffineTransform invertUserSpaceTransform = O2AffineTransformInvert( - O2GStateUserSpaceTransform(O2ContextCurrentGState(self))); + O2GStateUserSpaceTransform(O2ContextCurrentGState(self))); for (i = 0; i < numberOfElements; i++) { switch (elements[i]) { case kO2PathElementMoveToPoint: { O2Point point = O2PointApplyAffineTransform( - points[pi++], invertUserSpaceTransform); + points[pi++], invertUserSpaceTransform); [self contentWithFormat: @"%g %g m ", point.x, point.y]; } break; case kO2PathElementAddLineToPoint: { O2Point point = O2PointApplyAffineTransform( - points[pi++], invertUserSpaceTransform); + points[pi++], invertUserSpaceTransform); [self contentWithFormat: @"%g %g l ", point.x, point.y]; } break; @@ -374,8 +375,8 @@ const NSString *kO2PDFContextTitle = @"kO2PDFContextTitle"; O2Point end = O2PointApplyAffineTransform(points[pi++], invertUserSpaceTransform); - [self - contentWithFormat: @"%g %g %g %g v ", c1.x, c1.y, end.x, end.y]; + [self contentWithFormat: @"%g %g %g %g v ", c1.x, c1.y, end.x, + end.y]; } break; case kO2PathElementAddCurveToPoint: { @@ -585,8 +586,8 @@ const NSString *kO2PDFContextTitle = @"kO2PDFContextTitle"; O2GState *state = O2ContextCurrentGState(self); O2PDFObject *pdfObject = [O2GStateFont(state) - encodeReferenceWithContext: self - size: O2GStatePointSize(state)]; + encodeReferenceWithContext: self + size: O2GStatePointSize(state)]; O2PDFObject *name = [self nameForResource: pdfObject inCategory: "Font"]; [self contentWithFormat: @"%@ %g Tf ", name, @@ -683,7 +684,7 @@ const NSString *kO2PDFContextTitle = @"kO2PDFContextTitle"; for (i = 0; i < [_indirectObjects count]; i++) { // do not cache 'count', can grow during encoding O2PDFObject *object = - [[[_indirectObjects objectAtIndex: i] retain] autorelease]; + [[[_indirectObjects objectAtIndex: i] retain] autorelease]; if (![array containsObject: object]) { O2PDFxrefEntry *entry = [_indirectEntries objectAtIndex: i]; [_indirectObjects replaceObjectAtIndex: i diff --git a/Onyx2D/O2PDFDictionary.m b/Onyx2D/O2PDFDictionary.m index cb0753e5..410ca86e 100644 --- a/Onyx2D/O2PDFDictionary.m +++ b/Onyx2D/O2PDFDictionary.m @@ -67,8 +67,12 @@ void O2PDFFreeCString(NSMapTable *table, void *data) { NSZoneFree(NULL, data); } -NSMapTableKeyCallBacks O2PDFOwnedCStringKeyCallBacks = { - O2PDFHashCString, O2PDFIsEqualCString, NULL, O2PDFFreeCString, NULL, NULL}; +NSMapTableKeyCallBacks O2PDFOwnedCStringKeyCallBacks = {O2PDFHashCString, + O2PDFIsEqualCString, + NULL, + O2PDFFreeCString, + NULL, + NULL}; @implementation O2PDFDictionary diff --git a/Onyx2D/O2PDFFilter.m b/Onyx2D/O2PDFFilter.m index ad170076..b3c5f45e 100644 --- a/Onyx2D/O2PDFFilter.m +++ b/Onyx2D/O2PDFFilter.m @@ -38,7 +38,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ { int len; unsigned char *result = - stbi_zlib_decode_malloc([data bytes], [data length], &len); + stbi_zlib_decode_malloc([data bytes], [data length], &len); if (result == NULL) return nil; diff --git a/Onyx2D/O2PDFFont.m b/Onyx2D/O2PDFFont.m index 07f13255..2c6a0eca 100644 --- a/Onyx2D/O2PDFFont.m +++ b/Onyx2D/O2PDFFont.m @@ -69,7 +69,7 @@ static inline O2TextEncoding textEncodingWithName(const char *name) { O2PDFError(__FILE__, __LINE__, @"No data on FontFile stream"); else { O2DataProviderRef provider = - O2DataProviderCreateWithCFData((CFDataRef) data); + O2DataProviderCreateWithCFData((CFDataRef) data); _resourceFont = O2FontCreateWithDataProvider(provider); O2DataProviderRelease(provider); @@ -82,7 +82,7 @@ static inline O2TextEncoding textEncodingWithName(const char *name) { O2PDFError(__FILE__, __LINE__, @"No data on FontFile2 stream"); else { O2DataProviderRef provider = - O2DataProviderCreateWithCFData((CFDataRef) data); + O2DataProviderCreateWithCFData((CFDataRef) data); _resourceFont = O2FontCreateWithDataProvider(provider); O2DataProviderRelease(provider); @@ -102,7 +102,7 @@ static inline O2TextEncoding textEncodingWithName(const char *name) { O2PDFError(__FILE__, __LINE__, @"No data on FontFile3 stream"); else { O2DataProviderRef provider = - O2DataProviderCreateWithCFData((CFDataRef) data); + O2DataProviderCreateWithCFData((CFDataRef) data); _resourceFont = O2FontCreateWithDataProvider(provider); O2DataProviderRelease(provider); @@ -178,8 +178,8 @@ static inline O2TextEncoding textEncodingWithName(const char *name) { _graphicsFont = [_resourceFont retain]; else _graphicsFont = O2FontCreateWithFontName([NSString - stringWithCString: _baseFont - encoding: NSUTF8StringEncoding]); + stringWithCString: _baseFont + encoding: NSUTF8StringEncoding]); _encoding = [_graphicsFont createEncodingForTextEncoding: textEncoding]; @@ -199,9 +199,9 @@ static inline O2TextEncoding textEncodingWithName(const char *name) { NSString *string = [[NSString alloc] initWithCString: name]; O2Glyph glyph = O2FontGetGlyphWithGlyphName( - _graphicsFont, (CFStringRef) string); + _graphicsFont, (CFStringRef) string); uint16_t unicode = - O2FontUnicodeForGlyphName((CFStringRef) string); + O2FontUnicodeForGlyphName((CFStringRef) string); [newEncoding setGlyph: glyph unicode: unicode diff --git a/Onyx2D/O2PDFFunction_Type0.m b/Onyx2D/O2PDFFunction_Type0.m index 64676e4e..1fb55d38 100644 --- a/Onyx2D/O2PDFFunction_Type0.m +++ b/Onyx2D/O2PDFFunction_Type0.m @@ -65,13 +65,13 @@ static void evaluate(void *info, const O2Float *input, O2Float *output) { } - initWithDomain: (O2PDFArray *) domain - range: (O2PDFArray *) range - size: (O2PDFArray *) size - bitsPerSample: (O2PDFInteger) bps - order: (O2PDFInteger) order - encode: (O2PDFArray *) encode - decode: (O2PDFArray *) decode - data: (NSData *) data + range: (O2PDFArray *) range + size: (O2PDFArray *) size + bitsPerSample: (O2PDFInteger) bps + order: (O2PDFInteger) order + encode: (O2PDFArray *) encode + decode: (O2PDFArray *) decode + data: (NSData *) data { if ([super initWithDomain: domain range: range] == nil) return nil; diff --git a/Onyx2D/O2PDFFunction_Type2.m b/Onyx2D/O2PDFFunction_Type2.m index 10a2ec71..7e1e273d 100644 --- a/Onyx2D/O2PDFFunction_Type2.m +++ b/Onyx2D/O2PDFFunction_Type2.m @@ -38,8 +38,8 @@ static void evaluate(void *info, const O2Float *input, O2Float *output) { } } else { for (i = 0; i < self->_C0Count; i++) { - output[i] = - self->_C0[i] + pow(x, self->_N) * (self->_C1[i] - self->_C0[i]); + output[i] = self->_C0[i] + + pow(x, self->_N) * (self->_C1[i] - self->_C0[i]); } } } diff --git a/Onyx2D/O2PDFFunction_Type3.m b/Onyx2D/O2PDFFunction_Type3.m index 8b4a4148..592a007e 100644 --- a/Onyx2D/O2PDFFunction_Type3.m +++ b/Onyx2D/O2PDFFunction_Type3.m @@ -39,8 +39,8 @@ static void evaluate(void *info, const O2Float *input, O2Float *output) { bounds[0] = (i == 0) ? self->_domain[0] : self->_bounds[i - 1]; bounds[1] = (i == self->_boundsCount) - ? self->_domain[self->_domainCount - 1] - : self->_bounds[i]; + ? self->_domain[self->_domainCount - 1] + : self->_bounds[i]; encode[0] = self->_encode[i * 2]; encode[1] = self->_encode[i * 2 + 1]; @@ -53,10 +53,10 @@ static void evaluate(void *info, const O2Float *input, O2Float *output) { } - initWithDomain: (O2PDFArray *) domain - range: (O2PDFArray *) range - functions: (NSArray *) functions - bounds: (O2PDFArray *) bounds - encode: (O2PDFArray *) encode + range: (O2PDFArray *) range + functions: (NSArray *) functions + bounds: (O2PDFArray *) bounds + encode: (O2PDFArray *) encode { NSInteger i; @@ -147,7 +147,7 @@ static void evaluate(void *info, const O2Float *input, O2Float *output) { O2PDFArray *fnArray = [O2PDFArray pdfArray]; for (i = 0; i < _functionCount; i++) [fnArray - addObject: [_functions[i] encodeReferenceWithContext: context]]; + addObject: [_functions[i] encodeReferenceWithContext: context]]; [result setObjectForKey: "Functions" value: fnArray]; return [context encodeIndirectPDFObject: result]; diff --git a/Onyx2D/O2PDFFunction_Type4.m b/Onyx2D/O2PDFFunction_Type4.m index 4b278ed0..dd249a37 100644 --- a/Onyx2D/O2PDFFunction_Type4.m +++ b/Onyx2D/O2PDFFunction_Type4.m @@ -87,8 +87,8 @@ static void runBlock(NSMutableArray *stack, O2PDFBlock *block) { if ([[stack lastObject] checkForType: kO2PDFObjectTypeInteger value: &value]) { [stack removeLastObject]; - [stack - addObject: [O2PDFObject_Real pdfObjectWithReal: value]]; + [stack addObject: [O2PDFObject_Real + pdfObjectWithReal: value]]; } } break; @@ -172,7 +172,7 @@ static void runBlock(NSMutableArray *stack, O2PDFBlock *block) { [stack removeLastObject]; [stack addObject: [O2PDFObject_Real - pdfObjectWithReal: num1 - num2]]; + pdfObjectWithReal: num1 - num2]]; } break; case O2PDFIdentifier_truncate: @@ -542,7 +542,7 @@ static BOOL O2PDFScanCalculator(const char *bytes, NSUInteger length, currentInt = currentInt * 10 + code - '0'; else { *objectp = [O2PDFObject_Integer - pdfObjectWithInteger: currentSign * currentInt]; + pdfObjectWithInteger: currentSign * currentInt]; *lastPosition = position; return YES; } @@ -554,7 +554,7 @@ static BOOL O2PDFScanCalculator(const char *bytes, NSUInteger length, currentFraction *= 0.1; } else { *objectp = [O2PDFObject_Real - pdfObjectWithReal: currentSign * currentReal]; + pdfObjectWithReal: currentSign * currentReal]; *lastPosition = position; return YES; } @@ -568,7 +568,7 @@ static BOOL O2PDFScanCalculator(const char *bytes, NSUInteger length, const char *name = bytes + inlineLocation; NSUInteger length = position - inlineLocation; O2PDFIdentifier identifier = - O2PostScriptClassifyIdentifier(name, length); + O2PostScriptClassifyIdentifier(name, length); if (identifier == O2PDFIdentifier_true) *objectp = [O2PDFObject_Boolean pdfObjectWithTrue]; @@ -576,9 +576,9 @@ static BOOL O2PDFScanCalculator(const char *bytes, NSUInteger length, *objectp = [O2PDFObject_Boolean pdfObjectWithFalse]; else *objectp = [O2PDFObject_identifier - pdfObjectWithIdentifier: identifier - name: name - length: length]; + pdfObjectWithIdentifier: identifier + name: name + length: length]; *lastPosition = position; return YES; @@ -663,8 +663,8 @@ static O2PDFBlock *O2PDFParseCalculator(const char *bytes, NSUInteger length, } - initWithDomain: (O2PDFArray *) domain - range: (O2PDFArray *) range - calculator: (NSData *) data + range: (O2PDFArray *) range + calculator: (NSData *) data { NSLog(@"INITIALIZE TYPE 4"); if ([super initWithDomain: domain range: range] == nil) diff --git a/Onyx2D/O2PDFObject_Boolean.m b/Onyx2D/O2PDFObject_Boolean.m index c7985c57..b33ce5ca 100644 --- a/Onyx2D/O2PDFObject_Boolean.m +++ b/Onyx2D/O2PDFObject_Boolean.m @@ -53,8 +53,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (NSString *) description { - return [NSString - stringWithFormat: @"<%@ %s>", [self class], _value ? "true" : "false"]; + return [NSString stringWithFormat: @"<%@ %s>", [self class], + _value ? "true" : "false"]; } - (void) encodeWithPDFContext: (O2PDFContext *) encoder { diff --git a/Onyx2D/O2PDFObject_Name.m b/Onyx2D/O2PDFObject_Name.m index 25069a33..5b2f78f2 100644 --- a/Onyx2D/O2PDFObject_Name.m +++ b/Onyx2D/O2PDFObject_Name.m @@ -38,9 +38,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } + pdfObjectWithBytes: (const char *) bytes length: (unsigned) length { - return - [[(O2PDFObject_Name *) [self alloc] initWithBytes: bytes - length: length] autorelease]; + return [[(O2PDFObject_Name *) [self alloc] initWithBytes: bytes + length: length] + autorelease]; } + pdfObjectWithCString: (const char *) cString { diff --git a/Onyx2D/O2PDFObject_R.m b/Onyx2D/O2PDFObject_R.m index 4e675c70..29d4c424 100644 --- a/Onyx2D/O2PDFObject_R.m +++ b/Onyx2D/O2PDFObject_R.m @@ -25,8 +25,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation O2PDFObject_R - initWithNumber: (O2PDFInteger) number - generation: (O2PDFInteger) generation - xref: (O2PDFxref *) xref + generation: (O2PDFInteger) generation + xref: (O2PDFxref *) xref { _number = number; _generation = generation; diff --git a/Onyx2D/O2PDFObject_const.m b/Onyx2D/O2PDFObject_const.m index f7400e98..8269618e 100644 --- a/Onyx2D/O2PDFObject_const.m +++ b/Onyx2D/O2PDFObject_const.m @@ -29,37 +29,39 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + pdfObjectArrayMark { return [[[self alloc] initWithObjectType: O2PDFObjectTypeMark_array_open] - autorelease]; + autorelease]; } + pdfObjectArrayMarkEnd { return [[[self alloc] initWithObjectType: O2PDFObjectTypeMark_array_close] - autorelease]; + autorelease]; } + pdfObjectDictionaryMark { return [[[self alloc] - initWithObjectType: O2PDFObjectTypeMark_dictionary_open] autorelease]; + initWithObjectType: O2PDFObjectTypeMark_dictionary_open] + autorelease]; } + pdfObjectDictionaryMarkEnd { return [[[self alloc] - initWithObjectType: O2PDFObjectTypeMark_dictionary_close] autorelease]; + initWithObjectType: O2PDFObjectTypeMark_dictionary_close] + autorelease]; } + pdfObjectWithNull { - return - [[[self alloc] initWithObjectType: kO2PDFObjectTypeNull] autorelease]; + return [[[self alloc] initWithObjectType: kO2PDFObjectTypeNull] + autorelease]; } + pdfObjectProcMark { return [[[self alloc] initWithObjectType: O2PDFObjectTypeMark_proc_open] - autorelease]; + autorelease]; } + pdfObjectProcMarkEnd { return [[[self alloc] initWithObjectType: O2PDFObjectTypeMark_proc_close] - autorelease]; + autorelease]; } - (O2PDFObjectType) objectType { diff --git a/Onyx2D/O2PDFObject_identifier.m b/Onyx2D/O2PDFObject_identifier.m index 34c01373..af969a32 100644 --- a/Onyx2D/O2PDFObject_identifier.m +++ b/Onyx2D/O2PDFObject_identifier.m @@ -102,6 +102,6 @@ O2PDFIdentifier O2PDFClassifyIdentifier(const char *bytes, unsigned length) { - (NSString *) description { return [NSString - stringWithFormat: @"<%@ %d %s", [self class], _identifier, _bytes]; + stringWithFormat: @"<%@ %d %s", [self class], _identifier, _bytes]; } @end diff --git a/Onyx2D/O2PDFOperatorTable.m b/Onyx2D/O2PDFOperatorTable.m index 36dafd47..cb2c4fc9 100644 --- a/Onyx2D/O2PDFOperatorTable.m +++ b/Onyx2D/O2PDFOperatorTable.m @@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + (O2PDFOperatorTable *) renderingOperatorTable { O2PDFOperatorTable *result = - [[[O2PDFOperatorTable alloc] init] autorelease]; + [[[O2PDFOperatorTable alloc] init] autorelease]; O2PDF_render_populateOperatorTable(result); diff --git a/Onyx2D/O2PDFOperators.m b/Onyx2D/O2PDFOperators.m index ff37e1d6..f56d0565 100644 --- a/Onyx2D/O2PDFOperators.m +++ b/Onyx2D/O2PDFOperators.m @@ -334,14 +334,14 @@ void O2PDF_render_Do(O2PDFScanner *scanner, void *info) { } contentStream = [[[O2PDFContentStream alloc] - initWithStream: stream - resources: resources - parent: [scanner contentStream]] autorelease]; + initWithStream: stream + resources: resources + parent: [scanner contentStream]] autorelease]; operatorTable = [O2PDFOperatorTable renderingOperatorTable]; - doScanner = - [[[O2PDFScanner alloc] initWithContentStream: contentStream - operatorTable: operatorTable - info: info] autorelease]; + doScanner = [[[O2PDFScanner alloc] initWithContentStream: contentStream + operatorTable: operatorTable + info: info] + autorelease]; if (doIt) [doScanner scan]; @@ -537,7 +537,7 @@ void O2PDF_render_gs(O2PDFScanner *scanner, void *info) { if ([array getDictionaryAtIndex: 0 value: &fontDictionary] && [array getNumberAtIndex: 1 value: &scale]) { O2PDFFont *font = - [O2PDFFont createWithPDFDictionary: fontDictionary]; + [O2PDFFont createWithPDFDictionary: fontDictionary]; establishFontInContext(context, font, scale); @@ -721,7 +721,7 @@ void O2PDF_render_ID(O2PDFScanner *scanner, void *info) { size_t bytesPerRow = (width * bitsPerComponent) / 8; NSData *data = - O2PDFScannerCreateDataWithLength(scanner, height * bytesPerRow); + O2PDFScannerCreateDataWithLength(scanner, height * bytesPerRow); } // setlinejoin, Set line join style @@ -957,7 +957,7 @@ void O2PDF_render_SC(O2PDFScanner *scanner, void *info) { O2ColorRef color = O2ContextStrokeColor(context); O2ColorSpaceRef colorSpace = O2ColorGetColorSpace(color); NSUInteger numberOfComponents = - O2ColorSpaceGetNumberOfComponents(colorSpace); + O2ColorSpaceGetNumberOfComponents(colorSpace); NSInteger count = numberOfComponents; O2Float components[count + 1]; @@ -979,7 +979,7 @@ void O2PDF_render_sc(O2PDFScanner *scanner, void *info) { O2ColorRef color = O2ContextFillColor(context); O2ColorSpaceRef colorSpace = O2ColorGetColorSpace(color); NSUInteger numberOfComponents = - O2ColorSpaceGetNumberOfComponents(colorSpace); + O2ColorSpaceGetNumberOfComponents(colorSpace); NSInteger count = numberOfComponents; O2Float components[count + 1]; @@ -1002,7 +1002,7 @@ void O2PDF_render_SCN(O2PDFScanner *scanner, void *info) { O2ColorRef color = O2ContextStrokeColor(context); O2ColorSpaceRef colorSpace = O2ColorGetColorSpace(color); NSUInteger numberOfComponents = - O2ColorSpaceGetNumberOfComponents(colorSpace); + O2ColorSpaceGetNumberOfComponents(colorSpace); NSInteger count = numberOfComponents; O2Float components[count + 1]; @@ -1025,7 +1025,7 @@ void O2PDF_render_scn(O2PDFScanner *scanner, void *info) { O2ColorRef color = O2ContextFillColor(context); O2ColorSpaceRef colorSpace = O2ColorGetColorSpace(color); NSUInteger numberOfComponents = - O2ColorSpaceGetNumberOfComponents(colorSpace); + O2ColorSpaceGetNumberOfComponents(colorSpace); NSInteger count = numberOfComponents; O2PDFReal components[count + 1]; @@ -1068,8 +1068,8 @@ void O2PDF_render_T_star(O2PDFScanner *scanner, void *info) { O2Context *context = kgContextFromInfo(info); O2AffineTransform Tlm = O2ContextGetTextLineMatrix(context); - O2AffineTransform result = - O2AffineTransformTranslate(Tlm, 0, -O2ContextGetTextLeading(context)); + O2AffineTransform result = O2AffineTransformTranslate( + Tlm, 0, -O2ContextGetTextLeading(context)); O2ContextSetTextMatrix(context, result); O2ContextSetTextLineMatrix(context, result); @@ -1214,8 +1214,8 @@ void O2PDF_render_TJ(O2PDFScanner *scanner, void *info) { // The amount is expressed in thousands of a text space unit and // subtracted O2AffineTransform Tm = O2ContextGetTextMatrix(context); - O2Size advance = - O2SizeApplyAffineTransform(O2SizeMake(real / 1000.0, 0), Tm); + O2Size advance = O2SizeApplyAffineTransform( + O2SizeMake(real / 1000.0, 0), Tm); Tm.tx -= advance.width; Tm.ty -= advance.height; diff --git a/Onyx2D/O2PDFPage.m b/Onyx2D/O2PDFPage.m index 5b3568fe..2a5b6806 100644 --- a/Onyx2D/O2PDFPage.m +++ b/Onyx2D/O2PDFPage.m @@ -198,13 +198,13 @@ O2AffineTransform O2PDFPageGetDrawingTransform(O2PDFPageRef self, O2PDFBox box, - (void) drawInContext: (O2Context *) context { O2PDFContentStream *contentStream = - [[[O2PDFContentStream alloc] initWithPage: self] autorelease]; + [[[O2PDFContentStream alloc] initWithPage: self] autorelease]; O2PDFOperatorTable *operatorTable = - [O2PDFOperatorTable renderingOperatorTable]; + [O2PDFOperatorTable renderingOperatorTable]; O2PDFScanner *scanner = - [[[O2PDFScanner alloc] initWithContentStream: contentStream - operatorTable: operatorTable - info: context] autorelease]; + [[[O2PDFScanner alloc] initWithContentStream: contentStream + operatorTable: operatorTable + info: context] autorelease]; [scanner scan]; } diff --git a/Onyx2D/O2PDFScanner.m b/Onyx2D/O2PDFScanner.m index 7a1487bd..d3b4f3f5 100644 --- a/Onyx2D/O2PDFScanner.m +++ b/Onyx2D/O2PDFScanner.m @@ -82,7 +82,7 @@ static inline void O2PDFByteBufferAppend(O2PDFByteBuffer *buffer, } else { buffer->capacity *= 2; buffer->bytes = - NSZoneRealloc(NULL, buffer->bytes, buffer->capacity); + NSZoneRealloc(NULL, buffer->bytes, buffer->capacity); } } buffer->bytes[buffer->length++] = c; @@ -145,9 +145,9 @@ static void debugTracev(const char *bytes, unsigned length, va_list arguments) { NSString *dump = [[[NSString alloc] - initWithBytes: bytes + position - length: MIN(80, (length - position)) - encoding: NSISOLatin1StringEncoding] autorelease]; + initWithBytes: bytes + position + length: MIN(80, (length - position)) + encoding: NSISOLatin1StringEncoding] autorelease]; NSLogv(format, arguments); NSLog(@"position=%d,dump=[%@]", position, dump); @@ -322,8 +322,8 @@ BOOL O2PDFScanVersion(const char *bytes, unsigned length, return debugError(bytes, length, 0, @"Does not begin with %%PDF-"); *versionp = - [O2PDFString pdfObjectWithBytes: (const unsigned char *) bytes + 5 - length: 3]; + [O2PDFString pdfObjectWithBytes: (const unsigned char *) bytes + 5 + length: 3]; position = length; @@ -472,7 +472,7 @@ BOOL O2PDFScanObject(const char *bytes, unsigned length, O2PDFInteger position, currentInt = currentInt * 10 + code - '0'; else { *objectp = [O2PDFObject_Integer - pdfObjectWithInteger: currentSign * currentInt]; + pdfObjectWithInteger: currentSign * currentInt]; *lastPosition = position; return YES; } @@ -484,7 +484,7 @@ BOOL O2PDFScanObject(const char *bytes, unsigned length, O2PDFInteger position, currentFraction *= 0.1; } else { *objectp = [O2PDFObject_Real - pdfObjectWithReal: currentSign * currentReal]; + pdfObjectWithReal: currentSign * currentReal]; *lastPosition = position; return YES; } @@ -493,10 +493,11 @@ BOOL O2PDFScanObject(const char *bytes, unsigned length, O2PDFInteger position, case STATE_STRING_NOFREE: if (code == ')') { *objectp = [O2PDFString - pdfObjectWithBytesNoCopyNoFree: (const unsigned char *) - bytes + - inlineLocation - length: position - inlineLocation]; + pdfObjectWithBytesNoCopyNoFree: (const unsigned char *) + bytes + + inlineLocation + length: position - + inlineLocation]; *lastPosition = position + 1; return YES; } else if (code == '\\') { @@ -637,8 +638,8 @@ BOOL O2PDFScanObject(const char *bytes, unsigned length, O2PDFInteger position, code); *objectp = [O2PDFObject_Name - pdfObjectWithBytes: bytes + inlineLocation - length: (position - inlineLocation)]; + pdfObjectWithBytes: bytes + inlineLocation + length: (position - inlineLocation)]; *lastPosition = position; return YES; } @@ -661,7 +662,7 @@ BOOL O2PDFScanObject(const char *bytes, unsigned length, O2PDFInteger position, const char *name = bytes + inlineLocation; unsigned length = position - inlineLocation; O2PDFIdentifier identifier = - O2PDFClassifyIdentifier(name, length); + O2PDFClassifyIdentifier(name, length); if (identifier == O2PDFIdentifier_true) *objectp = [O2PDFObject_Boolean pdfObjectWithTrue]; @@ -671,9 +672,9 @@ BOOL O2PDFScanObject(const char *bytes, unsigned length, O2PDFInteger position, *objectp = [O2PDFObject_const pdfObjectWithNull]; else *objectp = [O2PDFObject_identifier - pdfObjectWithIdentifier: identifier - name: name - length: length]; + pdfObjectWithIdentifier: identifier + name: name + length: length]; *lastPosition = position; return YES; @@ -824,8 +825,8 @@ BOOL O2PDFParseObject(const char *bytes, unsigned length, O2PDFInteger position, if (![[stack lastObject] checkForType: kO2PDFObjectTypeName value: &key]) return debugError( - bytes, length, position, - @"Expecting name on stack for dictionary"); + bytes, length, position, + @"Expecting name on stack for dictionary"); [dictionary setObjectForKey: key value: check]; [stack removeLastObject]; @@ -837,7 +838,7 @@ BOOL O2PDFParseObject(const char *bytes, unsigned length, O2PDFInteger position, case O2PDFObjectType_identifier: { O2PDFIdentifier identifier = - [(O2PDFObject_identifier *) check identifier]; + [(O2PDFObject_identifier *) check identifier]; if (identifier == O2PDFIdentifier_R) { O2PDFInteger generation; @@ -972,10 +973,10 @@ BOOL O2PDFParse_xrefAtPosition(NSData *data, O2PDFInteger position, break; case O2PDFIdentifier_n: - [table - addEntry: [O2PDFxrefEntry xrefEntryWithPosition: fieldOne - number: number - generation: fieldTwo]]; + [table addEntry: [O2PDFxrefEntry + xrefEntryWithPosition: fieldOne + number: number + generation: fieldTwo]]; break; default: @@ -1048,17 +1049,17 @@ BOOL O2PDFParseIndirectObject(NSData *data, O2PDFInteger position, return debugError(bytes, length, position, @"Expecting integer"); if (check != number) return debugError( - bytes, length, position, - @"Object number %d does not match indirect reference %d", check, - number); + bytes, length, position, + @"Object number %d does not match indirect reference %d", check, + number); if (!O2PDFScanInteger(bytes, length, position, &position, &check)) return debugError(bytes, length, position, @"Expecting integer"); if (check != generation) return debugError( - bytes, length, position, - @"Generation number %d does not match indirect reference %d", check, - number); + bytes, length, position, + @"Generation number %d does not match indirect reference %d", + check, number); if (!O2PDFScanIdentifier(bytes, length, position, &position, &identifier)) return debugError(bytes, length, position, @"Expecting obj identifier"); @@ -1095,10 +1096,10 @@ BOOL O2PDFParseIndirectObject(NSData *data, O2PDFInteger position, if (bytes[position] == LF) position++; - object = - [[[O2PDFStream alloc] initWithDictionary: dictionary - xref: xref - position: position] autorelease]; + object = [[[O2PDFStream alloc] initWithDictionary: dictionary + xref: xref + position: position] + autorelease]; position += streamLength; @@ -1127,7 +1128,7 @@ BOOL O2PDFParseIndirectObject(NSData *data, O2PDFInteger position, + (void) initialize { O2PDFScannerDumpStream = [[NSUserDefaults standardUserDefaults] - boolForKey: @"O2PDFScannerDumpStream"]; + boolForKey: @"O2PDFScannerDumpStream"]; } - initWithContentStream: (O2PDFContentStream *) stream @@ -1166,8 +1167,8 @@ BOOL O2PDFScannerPopObject(O2PDFScanner *self, O2PDFObject **value) { BOOL O2PDFScannerPopBoolean(O2PDFScanner *self, O2PDFBoolean *value) { BOOL result = - [[self->_stack lastObject] checkForType: kO2PDFObjectTypeBoolean - value: value]; + [[self->_stack lastObject] checkForType: kO2PDFObjectTypeBoolean + value: value]; [self->_stack removeLastObject]; @@ -1176,8 +1177,8 @@ BOOL O2PDFScannerPopBoolean(O2PDFScanner *self, O2PDFBoolean *value) { BOOL O2PDFScannerPopInteger(O2PDFScanner *self, O2PDFInteger *value) { BOOL result = - [[self->_stack lastObject] checkForType: kO2PDFObjectTypeInteger - value: value]; + [[self->_stack lastObject] checkForType: kO2PDFObjectTypeInteger + value: value]; [self->_stack removeLastObject]; @@ -1259,7 +1260,7 @@ NSData *O2PDFScannerCreateDataWithLength(O2PDFScanner *self, size_t length) { NSData *data = [stream data]; NSData *result = - [data subdataWithRange: NSMakeRange(self->_position, length)]; + [data subdataWithRange: NSMakeRange(self->_position, length)]; self->_position += length; @@ -1278,7 +1279,7 @@ NSData *O2PDFScannerCreateDataWithLength(O2PDFScanner *self, size_t length) { NSLog(@"data[%d]=%@", [data length], [[[NSString alloc] initWithData: data encoding: NSISOLatin1StringEncoding] - autorelease]); + autorelease]); while (_position < length) { O2PDFObject *object; @@ -1294,7 +1295,7 @@ NSData *O2PDFScannerCreateDataWithLength(O2PDFScanner *self, size_t length) { [_stack addObject: object]; else { O2PDFOperatorCallback callback = [_operatorTable - callbackForName: [(O2PDFObject_identifier *) object name]]; + callbackForName: [(O2PDFObject_identifier *) object name]]; if (callback != NULL) { callback(self, _info); diff --git a/Onyx2D/O2PDFStream.m b/Onyx2D/O2PDFStream.m index 67bbc87b..02834c1f 100644 --- a/Onyx2D/O2PDFStream.m +++ b/Onyx2D/O2PDFStream.m @@ -40,8 +40,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _data = nil; // FIX, can do a more efficient subdata here - _data = - [[[xref data] subdataWithRange: NSMakeRange(position, length)] retain]; + _data = [[[xref data] subdataWithRange: NSMakeRange(position, length)] + retain]; _xref = [xref retain]; return self; } diff --git a/Onyx2D/O2PDFString.m b/Onyx2D/O2PDFString.m index c5474201..2a9089b9 100644 --- a/Onyx2D/O2PDFString.m +++ b/Onyx2D/O2PDFString.m @@ -57,13 +57,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ { return [[(O2PDFString *) [self alloc] initWithBytesNoCopyNoFree: bytes length: length] - autorelease]; + autorelease]; } + pdfObjectWithCString: (const char *) cString { return [[(O2PDFString *) [self alloc] - initWithBytes: (const unsigned char *) cString - length: strlen(cString)] autorelease]; + initWithBytes: (const unsigned char *) cString + length: strlen(cString)] autorelease]; } + pdfObjectWithString: (NSString *) string { @@ -71,7 +71,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ return [[(O2PDFString *) [self alloc] initWithBytes: [data bytes] length: [data length]] - autorelease]; + autorelease]; } - (O2PDFObjectType) objectType { diff --git a/Onyx2D/O2PDFxref.m b/Onyx2D/O2PDFxref.m index 69fb8f63..e5286bfa 100644 --- a/Onyx2D/O2PDFxref.m +++ b/Onyx2D/O2PDFxref.m @@ -34,7 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _data = [data retain]; _previous = nil; _numberToEntries = NSCreateMapTable( - NSIntegerMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 0); + NSIntegerMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 0); _entryToObject = NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 0); _entriesInOrder = [NSMutableArray new]; diff --git a/Onyx2D/O2Paint_axialGradient.m b/Onyx2D/O2Paint_axialGradient.m index 77a04785..3b95cec0 100644 --- a/Onyx2D/O2Paint_axialGradient.m +++ b/Onyx2D/O2Paint_axialGradient.m @@ -71,7 +71,7 @@ ONYX2D_STATIC int linear_span_largb8u_PRE(O2Paint *selfX, int x, int y, for (i = 0; i < length; i++, x++, point.x += delta.width) { int skip = 0; O2argb8u value = - O2PaintFastAxialRamp(self, 1.0f, self->_rho, &skip); + O2PaintFastAxialRamp(self, 1.0f, self->_rho, &skip); if (skip != previous) { if (previous == -1) @@ -147,7 +147,7 @@ ONYX2D_STATIC int linear_span_largb32f_PRE(O2Paint *selfX, int x, int y, } - initWithShading: (O2Shading *) shading - deviceTransform: (O2AffineTransform) deviceTransform + deviceTransform: (O2AffineTransform) deviceTransform { // Calculate the number of samples based on the length of the gradient in @@ -155,7 +155,7 @@ ONYX2D_STATIC int linear_span_largb32f_PRE(O2Paint *selfX, int x, int y, O2Point startPoint = [shading startPoint]; O2Point endPoint = [shading endPoint]; O2Point deviceStart = - O2PointApplyAffineTransform(startPoint, deviceTransform); + O2PointApplyAffineTransform(startPoint, deviceTransform); O2Point deviceEnd = O2PointApplyAffineTransform(endPoint, deviceTransform); O2Float deltax = deviceStart.x - deviceEnd.x; O2Float deltay = deviceStart.y - deviceEnd.y; @@ -163,8 +163,8 @@ ONYX2D_STATIC int linear_span_largb32f_PRE(O2Paint *selfX, int x, int y, int numberOfSamples = RI_INT_CLAMP(distance, 2, 8192); [super initWithShading: shading - deviceTransform: deviceTransform - numberOfSamples: numberOfSamples]; + deviceTransform: deviceTransform + numberOfSamples: numberOfSamples]; _paint_largb8u_PRE = linear_span_largb8u_PRE; _paint_largb32f_PRE = linear_span_largb32f_PRE; diff --git a/Onyx2D/O2Paint_color.m b/Onyx2D/O2Paint_color.m index b3b012b1..d4791d0c 100644 --- a/Onyx2D/O2Paint_color.m +++ b/Onyx2D/O2Paint_color.m @@ -57,8 +57,8 @@ ONYX2D_STATIC int color_largb32f_PRE(O2Paint *selfX, int x, int y, } - initWithGray: (O2Float) gray - alpha: (O2Float) alpha - surfaceToPaintTransform: (O2AffineTransform) transform + alpha: (O2Float) alpha + surfaceToPaintTransform: (O2AffineTransform) transform { O2PaintInitWithTransform(self, transform); @@ -76,10 +76,10 @@ ONYX2D_STATIC int color_largb32f_PRE(O2Paint *selfX, int x, int y, } - initWithRed: (O2Float) red - green: (O2Float) green - blue: (O2Float) blue - alpha: (O2Float) alpha - surfaceToPaintTransform: (O2AffineTransform) transform + green: (O2Float) green + blue: (O2Float) blue + alpha: (O2Float) alpha + surfaceToPaintTransform: (O2AffineTransform) transform { O2PaintInitWithTransform(self, transform); diff --git a/Onyx2D/O2Paint_image.m b/Onyx2D/O2Paint_image.m index a96be7fc..4fc24ed9 100644 --- a/Onyx2D/O2Paint_image.m +++ b/Onyx2D/O2Paint_image.m @@ -116,7 +116,7 @@ ONYX2D_STATIC int O2PaintReadResampledLowSpan_largb8u_PRE(O2Paint *selfX, int x, } ONYX2D_STATIC int O2PaintReadResampledLowSpanFloatTranslate_largb8u_PRE( - O2Paint *selfX, int x, int y, O2argb8u *span, int length) + O2Paint *selfX, int x, int y, O2argb8u *span, int length) { O2Paint_image *self = (O2Paint_image *) selfX; @@ -267,12 +267,12 @@ ONYX2D_STATIC int stencil(O2Paint *selfX, int x, int y, O2argb32f *span, } - initWithImage: (O2Image *) image - mask: (O2ImageRef) mask - mode: (O2SurfaceMode) mode - paint: (O2Paint *) paint - interpolationQuality: (O2InterpolationQuality) interpolationQuality - surfaceToImage: (O2AffineTransform) surfaceToImage - surfaceToMask: (O2AffineTransform) surfaceToMask + mask: (O2ImageRef) mask + mode: (O2SurfaceMode) mode + paint: (O2Paint *) paint + interpolationQuality: (O2InterpolationQuality) interpolationQuality + surfaceToImage: (O2AffineTransform) surfaceToImage + surfaceToMask: (O2AffineTransform) surfaceToMask { bool integerTranslate = FALSE; bool floatTranslate = FALSE; @@ -320,10 +320,10 @@ ONYX2D_STATIC int stencil(O2Paint *selfX, int x, int y, O2argb32f *span, if (integerTranslate) _paint_largb8u_PRE = - O2PaintReadIntegerTranslateSpan_largb8u_PRE; + O2PaintReadIntegerTranslateSpan_largb8u_PRE; else if (floatTranslate) _paint_largb8u_PRE = - O2PaintReadResampledLowSpanFloatTranslate_largb8u_PRE; + O2PaintReadResampledLowSpanFloatTranslate_largb8u_PRE; else _paint_largb8u_PRE = O2PaintReadResampledLowSpan_largb8u_PRE; @@ -334,7 +334,7 @@ ONYX2D_STATIC int stencil(O2Paint *selfX, int x, int y, O2argb32f *span, default: if (integerTranslate) _paint_largb8u_PRE = - O2PaintReadIntegerTranslateSpan_largb8u_PRE; + O2PaintReadIntegerTranslateSpan_largb8u_PRE; else _paint_largb8u_PRE = O2PaintReadResampledNoneSpan_largb8u_PRE; _paint_largb32f_PRE = O2PaintReadResampledNoneSpan_largb32f_PRE; diff --git a/Onyx2D/O2Paint_pattern.m b/Onyx2D/O2Paint_pattern.m index edb820b2..a94c99d4 100644 --- a/Onyx2D/O2Paint_pattern.m +++ b/Onyx2D/O2Paint_pattern.m @@ -65,8 +65,8 @@ static int O2PaintReadPremultipliedPatternSpan(O2Paint *selfX,int x,int y,O2argb #endif - initWithImage: (O2Image *) image - surfaceToPaintTransform: (O2AffineTransform) xform - phase: (O2Size) phase + surfaceToPaintTransform: (O2AffineTransform) xform + phase: (O2Size) phase { // O2PaintInitWithTransform(self,O2AffineTransformMakeTranslation(phase.width,phase.height)); O2PaintInitWithTransform(self, O2AffineTransformIdentity); diff --git a/Onyx2D/O2Paint_radialGradient.m b/Onyx2D/O2Paint_radialGradient.m index 06937e28..29552408 100644 --- a/Onyx2D/O2Paint_radialGradient.m +++ b/Onyx2D/O2Paint_radialGradient.m @@ -63,7 +63,7 @@ void O2PaintRadialGradient(O2Paint_radialGradient *self, O2Float *g, O2Point p = O2PointMake(x, y); p = Vector2Subtract( - O2PointApplyAffineTransform(p, self->m_surfaceToPaintMatrix), O); + O2PointApplyAffineTransform(p, self->m_surfaceToPaintMatrix), O); O2Point f = self->_startPoint; f = Vector2Subtract(f, O); @@ -153,11 +153,11 @@ ONYX2D_STATIC int radial_span_largb32f_PRE(O2Paint *selfX, int x, int y, } - initWithShading: (O2Shading *) shading - deviceTransform: (O2AffineTransform) deviceTransform + deviceTransform: (O2AffineTransform) deviceTransform { [super initWithShading: shading - deviceTransform: deviceTransform - numberOfSamples: 1024]; + deviceTransform: deviceTransform + numberOfSamples: 1024]; _paint_largb8u_PRE = radial_span_largb8u_PRE; _paint_largb32f_PRE = radial_span_largb32f_PRE; _startRadius = [shading startRadius]; diff --git a/Onyx2D/O2Paint_ramp.m b/Onyx2D/O2Paint_ramp.m index 68b7f668..1936ae8b 100644 --- a/Onyx2D/O2Paint_ramp.m +++ b/Onyx2D/O2Paint_ramp.m @@ -56,8 +56,8 @@ ONYX2D_STATIC_INLINE void CMYKAToRGBA(O2Float *input, O2Float32 *output) { } - initWithShading: (O2Shading *) shading - deviceTransform: (O2AffineTransform) deviceTransform - numberOfSamples: (int) numberOfSamples + deviceTransform: (O2AffineTransform) deviceTransform + numberOfSamples: (int) numberOfSamples { O2PaintInitWithTransform(self, O2AffineTransformInvert(deviceTransform)); @@ -95,14 +95,14 @@ ONYX2D_STATIC_INLINE void CMYKAToRGBA(O2Float *input, O2Float32 *output) { _numberOfColorStops = numberOfSamples; _colorStops = - NSZoneMalloc(NULL, _numberOfColorStops * sizeof(GradientStop)); + NSZoneMalloc(NULL, _numberOfColorStops * sizeof(GradientStop)); int i; isOpaque = TRUE; for (i = 0; i < _numberOfColorStops; i++) { _colorStops[i].offset = - (O2Float) i / (O2Float)(_numberOfColorStops - 1); + (O2Float) i / (O2Float)(_numberOfColorStops - 1); // FIXME: This assumes range=0..1, we need to map this to the functions // range @@ -114,7 +114,7 @@ ONYX2D_STATIC_INLINE void CMYKAToRGBA(O2Float *input, O2Float32 *output) { isOpaque = FALSE; _colorStops[i].color32f = O2argb32fPremultiply( - O2argb32fInit(rgba[0], rgba[1], rgba[2], rgba[3])); + O2argb32fInit(rgba[0], rgba[1], rgba[2], rgba[3])); _colorStops[i].color8u = O2argb8uFromO2argb32f(_colorStops[i].color32f); } @@ -175,8 +175,8 @@ O2argb32f O2PaintIntegrateColorRamp(O2Paint_ramp *self, O2Float gmin, O2argb32f sc = readStopColor(self->_colorStops, i); O2argb32f ec = readStopColor(self->_colorStops, i + 1); O2argb32f rc = - O2argb32fAdd(O2argb32fMultiplyByFloat(sc, (1.0f - g)), - O2argb32fMultiplyByFloat(ec, g)); + O2argb32fAdd(O2argb32fMultiplyByFloat(sc, (1.0f - g)), + O2argb32fMultiplyByFloat(ec, g)); // subtract the average color from the start of the stop to gmin c = O2argb32fSubtract(c, @@ -195,15 +195,15 @@ O2argb32f O2PaintIntegrateColorRamp(O2Paint_ramp *self, O2Float gmin, O2argb32f ec = readStopColor(self->_colorStops, i + 1); // average of the stop - c = O2argb32fAdd( - c, O2argb32fMultiplyByFloat(O2argb32fAdd(sc, ec), 0.5f * (e - s))); + c = O2argb32fAdd(c, O2argb32fMultiplyByFloat(O2argb32fAdd(sc, ec), + 0.5f * (e - s))); if (gmax >= self->_colorStops[i].offset && gmax < self->_colorStops[i + 1].offset) { O2Float g = (gmax - s) / (e - s); O2argb32f rc = - O2argb32fAdd(O2argb32fMultiplyByFloat(sc, (1.0f - g)), - O2argb32fMultiplyByFloat(ec, g)); + O2argb32fAdd(O2argb32fMultiplyByFloat(sc, (1.0f - g)), + O2argb32fMultiplyByFloat(ec, g)); // subtract the average color from gmax to the end of the stop c = O2argb32fSubtract(c, @@ -231,10 +231,10 @@ O2argb32f O2PaintColorRamp(O2Paint_ramp *self, O2Float gradient, O2Float rho, } O2Float gmin = - gradient - - rho * 0.5f; // filter starting from the gradient point (if starts - // earlier, radial gradient center will be an average of the - // first and the last stop, which doesn't look good) + gradient - + rho * 0.5f; // filter starting from the gradient point (if starts + // earlier, radial gradient center will be an average of + // the first and the last stop, which doesn't look good) O2Float gmax = gradient + rho * 0.5f; if (gmin < 0.0f && !self->_extendStart) { @@ -260,14 +260,15 @@ O2argb32f O2PaintColorRamp(O2Paint_ramp *self, O2Float gradient, O2Float rho, O2Float e = self->_colorStops[i + 1].offset; RI_ASSERT(s < e); O2Float g = RI_CLAMP( - (gradient - s) / (e - s), 0.0f, - 1.0f); // clamp needed due to numerical inaccuracies + (gradient - s) / (e - s), 0.0f, + 1.0f); // clamp needed due to numerical inaccuracies O2argb32f sc = readStopColor(self->_colorStops, i); O2argb32f ec = readStopColor(self->_colorStops, i + 1); - return O2argb32fAdd(O2argb32fMultiplyByFloat(sc, (1.0f - g)), - O2argb32fMultiplyByFloat( - ec, g)); // return interpolated value + return O2argb32fAdd( + O2argb32fMultiplyByFloat(sc, (1.0f - g)), + O2argb32fMultiplyByFloat( + ec, g)); // return interpolated value } } return readStopColor(self->_colorStops, self->_numberOfColorStops - 1); @@ -279,8 +280,8 @@ O2argb32f O2PaintColorRamp(O2Paint_ramp *self, O2Float gradient, O2Float rho, } if (gmax > 1.0f) { c = O2argb32fMultiplyByFloat( - readStopColor(self->_colorStops, self->_numberOfColorStops - 1), - (gmax - RI_MAX(gmin, 1.0f))); + readStopColor(self->_colorStops, self->_numberOfColorStops - 1), + (gmax - RI_MAX(gmin, 1.0f))); } gmin = RI_CLAMP(gmin, 0.0f, 1.0f); diff --git a/Onyx2D/O2Path.m b/Onyx2D/O2Path.m index 35aa091e..e74fb671 100644 --- a/Onyx2D/O2Path.m +++ b/Onyx2D/O2Path.m @@ -24,9 +24,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation O2Path - initWithOperators: (unsigned char *) elements - numberOfElements: (size_t) numberOfElements - points: (O2Point *) points - numberOfPoints: (size_t) numberOfPoints + numberOfElements: (size_t) numberOfElements + points: (O2Point *) points + numberOfPoints: (size_t) numberOfPoints { return O2PathInitWithOperators(self, elements, numberOfElements, points, numberOfPoints); @@ -40,14 +40,14 @@ id O2PathInitWithOperators(O2Path *self, unsigned char *elements, self->_numberOfElements = numberOfElements; self->_elements = NSZoneMalloc( - NULL, (self->_numberOfElements == 0) ? 1 : self->_numberOfElements); + NULL, (self->_numberOfElements == 0) ? 1 : self->_numberOfElements); for (i = 0; i < self->_numberOfElements; i++) self->_elements[i] = elements[i]; self->_numberOfPoints = numberOfPoints; self->_points = NSZoneMalloc( - NULL, (self->_numberOfPoints == 0 ? 1 : self->_numberOfPoints) * - sizeof(O2Point)); + NULL, (self->_numberOfPoints == 0 ? 1 : self->_numberOfPoints) * + sizeof(O2Point)); for (i = 0; i < self->_numberOfPoints; i++) self->_points[i] = points[i]; @@ -88,10 +88,10 @@ O2PathRef O2PathCreateCopy(O2PathRef self) { O2MutablePathRef O2PathCreateMutableCopy(O2PathRef self) { return [[O2MutablePath allocWithZone: NULL] - initWithOperators: self->_elements - numberOfElements: self->_numberOfElements - points: self->_points - numberOfPoints: self->_numberOfPoints]; + initWithOperators: self->_elements + numberOfElements: self->_numberOfElements + points: self->_points + numberOfPoints: self->_numberOfPoints]; } size_t O2PathNumberOfElements(O2PathRef self) { @@ -113,8 +113,8 @@ const O2Point *O2PathPoints(O2PathRef self) { O2Point O2PathGetCurrentPoint(O2PathRef self) { // this is wrong w/ closepath last return (self->_numberOfPoints == 0) - ? O2PointZero - : self->_points[self->_numberOfPoints - 1]; + ? O2PointZero + : self->_points[self->_numberOfPoints - 1]; } BOOL O2PathEqualToPath(O2PathRef self, O2PathRef other) { @@ -225,7 +225,7 @@ int _countEvenOddCrossingOfPointAndLine(O2Point point, O2Point lineStart, // compute the actual edge-ray intersect x-coordinate O2Float vt = - (O2Float)(point.y - lineStart.y) / (lineEnd.y - lineStart.y); + (O2Float)(point.y - lineStart.y) / (lineEnd.y - lineStart.y); if (point.x < lineStart.x + vt * (lineEnd.x - lineStart.x)) { // point.x < intersect @@ -267,9 +267,9 @@ int _countYCrossingFromPointToCurve(O2Point point, O2Point curveFromPoint, // No need to test if there no chance of any crossing O2Float minY = - MIN(MIN(curveFromPoint.y, curveToPoint.y), MIN(tan1.y, tan2.y)); + MIN(MIN(curveFromPoint.y, curveToPoint.y), MIN(tan1.y, tan2.y)); O2Float maxY = - MAX(MAX(curveFromPoint.y, curveToPoint.y), MAX(tan1.y, tan2.y)); + MAX(MAX(curveFromPoint.y, curveToPoint.y), MAX(tan1.y, tan2.y)); if (minY > point.y || maxY < point.y) { return 0; } @@ -291,12 +291,12 @@ int _countYCrossingFromPointToCurve(O2Point point, O2Point curveFromPoint, (curveFromPoint.y + tan1.y) / 2); O2Point T = O2PointMake((tan1.x + tan2.x) / 2, (tan1.y + tan2.y) / 2); O2Point sub1_cp2 = - O2PointMake((sub1_cp1.x + T.x) / 2, (sub1_cp1.y + T.y) / 2); + O2PointMake((sub1_cp1.x + T.x) / 2, (sub1_cp1.y + T.y) / 2); O2Point sub2_end = curveToPoint; O2Point sub2_cp2 = O2PointMake((tan2.x + curveToPoint.x) / 2, (tan2.y + curveToPoint.y) / 2); O2Point sub2_cp1 = - O2PointMake((T.x + sub2_cp2.x) / 2, (T.y + sub2_cp2.y) / 2); + O2PointMake((T.x + sub2_cp2.x) / 2, (T.y + sub2_cp2.y) / 2); O2Point sub2_start = O2PointMake((sub1_cp2.x + sub2_cp1.x) / 2, (sub1_cp2.y + sub2_cp1.y) / 2); O2Point sub1_end = sub2_start; @@ -372,8 +372,9 @@ BOOL O2PathContainsPoint(O2PathRef self, const O2AffineTransform *xform, case kO2PathElementAddCurveToPoint: toPoint = points[2]; - cn += _countYCrossingFromPointToCurve( - point, currentPoint, toPoint, points[0], points[1], evenOdd); + cn += _countYCrossingFromPointToCurve(point, currentPoint, toPoint, + points[0], points[1], + evenOdd); currentPoint = toPoint; points += 3; break; diff --git a/Onyx2D/O2Pattern.m b/Onyx2D/O2Pattern.m index a738da39..9b1800bf 100644 --- a/Onyx2D/O2Pattern.m +++ b/Onyx2D/O2Pattern.m @@ -22,13 +22,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation O2Pattern - initWithInfo: (void *) info - bounds: (O2Rect) bounds - matrix: (O2AffineTransform) matrix - xstep: (O2Float) xstep - ystep: (O2Float) ystep - tiling: (O2PatternTiling) tiling - isColored: (BOOL) isColored - callbacks: (const O2PatternCallbacks *) callbacks + bounds: (O2Rect) bounds + matrix: (O2AffineTransform) matrix + xstep: (O2Float) xstep + ystep: (O2Float) ystep + tiling: (O2PatternTiling) tiling + isColored: (BOOL) isColored + callbacks: (const O2PatternCallbacks *) callbacks { _info = info; _bounds = bounds; diff --git a/Onyx2D/O2Shading+PDF.m b/Onyx2D/O2Shading+PDF.m index 739599e9..6593de83 100644 --- a/Onyx2D/O2Shading+PDF.m +++ b/Onyx2D/O2Shading+PDF.m @@ -242,7 +242,7 @@ O2Shading *radialShading(O2PDFDictionary *dictionary, } if ((colorSpace = [O2ColorSpace - createColorSpaceFromPDFObject: colorSpaceObject]) == nil) + createColorSpaceFromPDFObject: colorSpaceObject]) == nil) return nil; switch (shadingType) { diff --git a/Onyx2D/O2Surface.m b/Onyx2D/O2Surface.m index fd2d1472..e96a03a3 100644 --- a/Onyx2D/O2Surface.m +++ b/Onyx2D/O2Surface.m @@ -431,7 +431,7 @@ static BOOL initFunctionsForParameters(O2Surface *self, size_t bitsPerComponent, case kO2BitmapByteOrder16Little: case kO2BitmapByteOrder32Little: self->_writeargb32f = - O2SurfaceWrite_argb32f_to_ABGR8888; + O2SurfaceWrite_argb32f_to_ABGR8888; self->_writeargb8u = O2SurfaceWrite_argb8u_to_ABGR8888; return YES; @@ -529,12 +529,12 @@ static BOOL initFunctionsForParameters(O2Surface *self, size_t bitsPerComponent, } - initWithBytes: (void *) bytes - width: (size_t) width - height: (size_t) height - bitsPerComponent: (size_t) bitsPerComponent - bytesPerRow: (size_t) bytesPerRow - colorSpace: (O2ColorSpaceRef) colorSpace - bitmapInfo: (O2BitmapInfo) bitmapInfo + width: (size_t) width + height: (size_t) height + bitsPerComponent: (size_t) bitsPerComponent + bytesPerRow: (size_t) bytesPerRow + colorSpace: (O2ColorSpaceRef) colorSpace + bitmapInfo: (O2BitmapInfo) bitmapInfo { O2DataProvider *provider; int bitsPerPixel = 32; @@ -542,7 +542,7 @@ static BOOL initFunctionsForParameters(O2Surface *self, size_t bitsPerComponent, if (bytes != NULL) { provider = [[[O2DataProvider alloc] initWithBytes: bytes length: bytesPerRow * height] - autorelease]; + autorelease]; m_ownsData = NO; } else { if (bytesPerRow > 0 && bytesPerRow < (width * bitsPerPixel) / 8) { @@ -554,25 +554,26 @@ static BOOL initFunctionsForParameters(O2Surface *self, size_t bitsPerComponent, bytesPerRow = (width * bitsPerPixel) / 8; NSMutableData *data = [NSMutableData - dataWithLength: bytesPerRow * height * - sizeof(uint8_t)]; // this will also zero the bytes + dataWithLength: bytesPerRow * height * + sizeof(uint8_t)]; // this will also zero the + // bytes provider = - [O2DataProviderCreateWithCFData((CFDataRef) data) autorelease]; + [O2DataProviderCreateWithCFData((CFDataRef) data) autorelease]; m_ownsData = YES; } if ([super initWithWidth: width - height: height - bitsPerComponent: bitsPerComponent - bitsPerPixel: bitsPerPixel - bytesPerRow: bytesPerRow - colorSpace: colorSpace - bitmapInfo: bitmapInfo - decoder: NULL - provider: provider - decode: NULL - interpolate: YES - renderingIntent: kO2RenderingIntentDefault] == nil) + height: height + bitsPerComponent: bitsPerComponent + bitsPerPixel: bitsPerPixel + bytesPerRow: bytesPerRow + colorSpace: colorSpace + bitmapInfo: bitmapInfo + decoder: NULL + provider: provider + decode: NULL + interpolate: YES + renderingIntent: kO2RenderingIntentDefault] == nil) return nil; if ([provider isDirectAccess]) @@ -589,7 +590,7 @@ static BOOL initFunctionsForParameters(O2Surface *self, size_t bitsPerComponent, - (void) dealloc { _pixelBytes = - NULL; // if we own it, it's in the provider, if not, no release + NULL; // if we own it, it's in the provider, if not, no release pthread_mutex_destroy(&_lock); [super dealloc]; @@ -608,8 +609,8 @@ void O2SurfaceUnlock(O2Surface *surface) { } - (void) setWidth: (size_t) width - height: (size_t) height - reallocateOnlyIfRequired: (BOOL) roir + height: (size_t) height + reallocateOnlyIfRequired: (BOOL) roir { if (!m_ownsData) @@ -649,16 +650,16 @@ size_t O2SurfaceGetBytesPerRow(O2Surface *surface) { O2ImageRef O2SurfaceCreateImage(O2Surface *self) { NSData *data = - [[NSData alloc] initWithBytes: self->_pixelBytes - length: self->_bytesPerRow * self->_height]; + [[NSData alloc] initWithBytes: self->_pixelBytes + length: self->_bytesPerRow * self->_height]; O2DataProviderRef provider = - O2DataProviderCreateWithCFData((CFDataRef) data); + O2DataProviderCreateWithCFData((CFDataRef) data); O2Image *result = O2ImageCreate( - self->_width, self->_height, self->_bitsPerComponent, - self->_bitsPerPixel, self->_bytesPerRow, self->_colorSpace, - self->_bitmapInfo, provider, self->_decode, self->_interpolate, - self->_renderingIntent); + self->_width, self->_height, self->_bitsPerComponent, + self->_bitsPerPixel, self->_bytesPerRow, self->_colorSpace, + self->_bitmapInfo, provider, self->_decode, self->_interpolate, + self->_renderingIntent); O2DataProviderRelease(provider); [data release]; @@ -735,7 +736,7 @@ O2GaussianKernel *O2CreateGaussianKernelWithDeviation(O2Float stdDeviation) { O2Float totalWeightX = stdDeviationX * (O2Float) sqrt(2.0f * M_PI); O2Float totalWeightY = stdDeviationY * (O2Float) sqrt(2.0f * M_PI); const O2Float tolerance = - 0.99f; // use a kernel that covers 99% of the total Gaussian support + 0.99f; // use a kernel that covers 99% of the total Gaussian support O2Float expScaleX = -1.0f / (2.0f * stdDeviationX * stdDeviationX); O2Float expScaleY = -1.0f / (2.0f * stdDeviationY * stdDeviationY); @@ -767,13 +768,13 @@ O2GaussianKernel *O2CreateGaussianKernelWithDeviation(O2Float stdDeviation) { for (i = 0; i < kernel->xSize; i++) { int x = i - kernel->xShift; kernel->xValues[i] = - (O2Float) exp((O2Float) x * (O2Float) x * expScaleX); + (O2Float) exp((O2Float) x * (O2Float) x * expScaleX); kernel->xScale += kernel->xValues[i]; } kernel->xScale = - 1.0f / kernel->xScale; // NOTE: using the mathematical definition of the - // scaling term doesn't work since we cut the - // filter support early for performance + 1.0f / kernel->xScale; // NOTE: using the mathematical definition of + // the scaling term doesn't work since we cut + // the filter support early for performance kernel->ySize = kernelHeight * 2 + 1; kernel->yValues = NSZoneMalloc(NULL, sizeof(O2Float) * kernel->ySize); @@ -782,13 +783,13 @@ O2GaussianKernel *O2CreateGaussianKernelWithDeviation(O2Float stdDeviation) { for (i = 0; i < kernel->ySize; i++) { int y = i - kernel->yShift; kernel->yValues[i] = - (O2Float) exp((O2Float) y * (O2Float) y * expScaleY); + (O2Float) exp((O2Float) y * (O2Float) y * expScaleY); kernel->yScale += kernel->yValues[i]; } kernel->yScale = - 1.0f / kernel->yScale; // NOTE: using the mathematical definition of the - // scaling term doesn't work since we cut the - // filter support early for performance + 1.0f / kernel->yScale; // NOTE: using the mathematical definition of + // the scaling term doesn't work since we cut + // the filter support early for performance return kernel; } @@ -837,7 +838,7 @@ void O2SurfaceGaussianBlur(O2Surface *self, O2Image *src, RI_ASSERT(w > 0 && h > 0); O2argb32f *tmp = - NSZoneMalloc(NULL, src->_width * src->_height * sizeof(O2argb32f)); + NSZoneMalloc(NULL, src->_width * src->_height * sizeof(O2argb32f)); // copy source region to tmp and do conversion int i, j; @@ -867,11 +868,11 @@ void O2SurfaceGaussianBlur(O2Surface *self, O2Image *src, int ki; for (ki = 0; ki < kernel->xSize; ki++) { int x = i + ki - kernel->xShift; - sum = O2argb32fAdd( - sum, - O2argb32fMultiplyByFloat( - gaussianReadPixel(x, j, src->_width, src->_height, tmp), - kernel->xValues[ki])); + sum = O2argb32fAdd(sum, + O2argb32fMultiplyByFloat( + gaussianReadPixel(x, j, src->_width, + src->_height, tmp), + kernel->xValues[ki])); } tmp2[j * w + i] = O2argb32fMultiplyByFloat(sum, kernel->xScale); } @@ -884,9 +885,10 @@ void O2SurfaceGaussianBlur(O2Surface *self, O2Image *src, for (kj = 0; kj < kernel->ySize; kj++) { int y = j + kj - kernel->yShift; sum = O2argb32fAdd( - sum, O2argb32fMultiplyByFloat( - gaussianReadPixel(i, y, w, src->_height, tmp2), - kernel->yValues[kj])); + sum, + O2argb32fMultiplyByFloat( + gaussianReadPixel(i, y, w, src->_height, tmp2), + kernel->yValues[kj])); } sum = O2argb32fMultiplyByFloat(sum, kernel->yScale); O2SurfaceWriteSpan_largb32f_PRE(self, i, j, &sum, 1); diff --git a/Onyx2D/O2TIFFImageDirectory.m b/Onyx2D/O2TIFFImageDirectory.m index ea110c87..fa9e315c 100644 --- a/Onyx2D/O2TIFFImageDirectory.m +++ b/Onyx2D/O2TIFFImageDirectory.m @@ -351,9 +351,9 @@ static void sTIFFUnmapFileProc(thandle_t userData, tdata_t data, toff_t size) { break; case NSTIFFTagStripByteCounts: - [reader - expectArrayOfUnsigned16OrUnsigned32: &_stripByteCounts - count: &_sizeOfStripByteCounts]; + [reader expectArrayOfUnsigned16OrUnsigned32: &_stripByteCounts + count: & + _sizeOfStripByteCounts]; break; case NSTIFFTagStripOffsets: diff --git a/Onyx2D/O2TTFDecoder.m b/Onyx2D/O2TTFDecoder.m index 323f43b9..56aa20e8 100644 --- a/Onyx2D/O2TTFDecoder.m +++ b/Onyx2D/O2TTFDecoder.m @@ -298,264 +298,264 @@ static struct { O2Glyph glyph; NSString *name; } MacintoshNameMapping[258] = { - {0, @".notdef"}, - {1, @".null"}, - {2, @"nonmarkingreturn"}, - {3, @"space"}, - {4, @"exclam"}, - {5, @"quotedbl"}, - {6, @"numbersign"}, - {7, @"dollar"}, - {8, @"percent"}, - {9, @"ampersand"}, - {10, @"quotesingle"}, - {11, @"parenleft"}, - {12, @"parenright"}, - {13, @"asterisk"}, - {14, @"plus"}, - {15, @"comma"}, - {16, @"hyphen"}, - {17, @"period"}, - {18, @"slash"}, - {19, @"zero"}, - {20, @"one"}, - {21, @"two"}, - {22, @"three"}, - {23, @"four"}, - {24, @"five"}, - {25, @"six"}, - {26, @"seven"}, - {27, @"eight"}, - {28, @"nine"}, - {29, @"colon"}, - {30, @"semicolon"}, - {31, @"less"}, - {32, @"equal"}, - {33, @"greater"}, - {34, @"question"}, - {35, @"at"}, - {36, @"A"}, - {37, @"B"}, - {38, @"C"}, - {39, @"D"}, - {40, @"E"}, - {41, @"F"}, - {42, @"G"}, - {43, @"H"}, - {44, @"I"}, - {45, @"J"}, - {46, @"K"}, - {47, @"L"}, - {48, @"M"}, - {49, @"N"}, - {50, @"O"}, - {51, @"P"}, - {52, @"Q"}, - {53, @"R"}, - {54, @"S"}, - {55, @"T"}, - {56, @"U"}, - {57, @"V"}, - {58, @"W"}, - {59, @"X"}, - {60, @"Y"}, - {61, @"Z"}, - {62, @"bracketleft"}, - {63, @"backslash"}, - {64, @"bracketright"}, - {65, @"asciicircum"}, - {66, @"underscore"}, - {67, @"grave"}, - {68, @"a"}, - {69, @"b"}, - {70, @"c"}, - {71, @"d"}, - {72, @"e"}, - {73, @"f"}, - {74, @"g"}, - {75, @"h"}, - {76, @"i"}, - {77, @"j"}, - {78, @"k"}, - {79, @"l"}, - {80, @"m"}, - {81, @"n"}, - {82, @"o"}, - {83, @"p"}, - {84, @"q"}, - {85, @"r"}, - {86, @"s"}, - {87, @"t"}, - {88, @"u"}, - {89, @"v"}, - {90, @"w"}, - {91, @"x"}, - {92, @"y"}, - {93, @"z"}, - {94, @"braceleft"}, - {95, @"bar"}, - {96, @"braceright"}, - {97, @"asciitilde"}, - {98, @"Adieresis"}, - {99, @"Aring"}, - {100, @"Ccedilla"}, - {101, @"Eacute"}, - {102, @"Ntilde"}, - {103, @"Odieresis"}, - {104, @"Udieresis"}, - {105, @"aacute"}, - {106, @"agrave"}, - {107, @"acircumflex"}, - {108, @"adieresis"}, - {109, @"atilde"}, - {110, @"aring"}, - {111, @"ccedilla"}, - {112, @"eacute"}, - {113, @"egrave"}, - {114, @"ecircumflex"}, - {115, @"edieresis"}, - {116, @"iacute"}, - {117, @"igrave"}, - {118, @"icircumflex"}, - {119, @"idieresis"}, - {120, @"ntilde"}, - {121, @"oacute"}, - {122, @"ograve"}, - {123, @"ocircumflex"}, - {124, @"odieresis"}, - {125, @"otilde"}, - {126, @"uacute"}, - {127, @"ugrave"}, - {128, @"ucircumflex"}, - {129, @"udieresis"}, - {130, @"dagger"}, - {131, @"degree"}, - {132, @"cent"}, - {133, @"sterling"}, - {134, @"section"}, - {135, @"bullet"}, - {136, @"paragraph"}, - {137, @"germandbls"}, - {138, @"registered"}, - {139, @"copyright"}, - {140, @"trademark"}, - {141, @"acute"}, - {142, @"dieresis"}, - {143, @"notequal"}, - {144, @"AE"}, - {145, @"Oslash"}, - {146, @"infinity"}, - {147, @"plusminus"}, - {148, @"lessequal"}, - {149, @"greaterequal"}, - {150, @"yen"}, - {151, @"mu"}, - {152, @"partialdiff"}, - {153, @"summation"}, - {154, @"product"}, - {155, @"pi"}, - {156, @"integral"}, - {157, @"ordfeminine"}, - {158, @"ordmasculine"}, - {159, @"Omega"}, - {160, @"ae"}, - {161, @"oslash"}, - {162, @"questiondown"}, - {163, @"exclamdown"}, - {164, @"logicalnot"}, - {165, @"radical"}, - {166, @"florin"}, - {167, @"approxequal"}, - {168, @"Delta"}, - {169, @"guillemotleft"}, - {170, @"guillemotright"}, - {171, @"ellipsis"}, - {172, @"nonbreakingspace"}, - {173, @"Agrave"}, - {174, @"Atilde"}, - {175, @"Otilde"}, - {176, @"OE"}, - {177, @"oe"}, - {178, @"endash"}, - {179, @"emdash"}, - {180, @"quotedblleft"}, - {181, @"quotedblright"}, - {182, @"quoteleft"}, - {183, @"quoteright"}, - {184, @"divide"}, - {185, @"lozenge"}, - {186, @"ydieresis"}, - {187, @"Ydieresis"}, - {188, @"fraction"}, - {189, @"currency"}, - {190, @"guilsinglleft"}, - {191, @"guilsinglright"}, - {192, @"fi"}, - {193, @"fl"}, - {194, @"daggerdbl"}, - {195, @"periodcentered"}, - {196, @"quotesinglbase"}, - {197, @"quotedblbase"}, - {198, @"perthousand"}, - {199, @"Acircumflex"}, - {200, @"Ecircumflex"}, - {201, @"Aacute"}, - {202, @"Edieresis"}, - {203, @"Egrave"}, - {204, @"Iacute"}, - {205, @"Icircumflex"}, - {206, @"Idieresis"}, - {207, @"Igrave"}, - {208, @"Oacute"}, - {209, @"Ocircumflex"}, - {210, @"apple"}, - {211, @"Ograve"}, - {212, @"Uacute"}, - {213, @"Ucircumflex"}, - {214, @"Ugrave"}, - {215, @"dotlessi"}, - {216, @"circumflex"}, - {217, @"tilde"}, - {218, @"macron"}, - {219, @"breve"}, - {220, @"dotaccent"}, - {221, @"ring"}, - {222, @"cedilla"}, - {223, @"hungarumlaut"}, - {224, @"ogonek"}, - {225, @"caron"}, - {226, @"Lslash"}, - {227, @"lslash"}, - {228, @"Scaron"}, - {229, @"scaron"}, - {230, @"Zcaron"}, - {231, @"zcaron"}, - {232, @"brokenbar"}, - {233, @"Eth"}, - {234, @"eth"}, - {235, @"Yacute"}, - {236, @"yacute"}, - {237, @"Thorn"}, - {238, @"thorn"}, - {239, @"minus"}, - {240, @"multiply"}, - {241, @"onesuperior"}, - {242, @"twosuperior"}, - {243, @"threesuperior"}, - {244, @"onehalf"}, - {245, @"onequarter"}, - {246, @"threequarters"}, - {247, @"franc"}, - {248, @"Gbreve"}, - {249, @"gbreve"}, - {250, @"Idotaccent"}, - {251, @"Scedilla"}, - {252, @"scedilla"}, - {253, @"Cacute"}, - {254, @"cacute"}, - {255, @"Ccaron"}, - {256, @"ccaron"}, - {257, @"dcroat"}, + {0, @".notdef"}, + {1, @".null"}, + {2, @"nonmarkingreturn"}, + {3, @"space"}, + {4, @"exclam"}, + {5, @"quotedbl"}, + {6, @"numbersign"}, + {7, @"dollar"}, + {8, @"percent"}, + {9, @"ampersand"}, + {10, @"quotesingle"}, + {11, @"parenleft"}, + {12, @"parenright"}, + {13, @"asterisk"}, + {14, @"plus"}, + {15, @"comma"}, + {16, @"hyphen"}, + {17, @"period"}, + {18, @"slash"}, + {19, @"zero"}, + {20, @"one"}, + {21, @"two"}, + {22, @"three"}, + {23, @"four"}, + {24, @"five"}, + {25, @"six"}, + {26, @"seven"}, + {27, @"eight"}, + {28, @"nine"}, + {29, @"colon"}, + {30, @"semicolon"}, + {31, @"less"}, + {32, @"equal"}, + {33, @"greater"}, + {34, @"question"}, + {35, @"at"}, + {36, @"A"}, + {37, @"B"}, + {38, @"C"}, + {39, @"D"}, + {40, @"E"}, + {41, @"F"}, + {42, @"G"}, + {43, @"H"}, + {44, @"I"}, + {45, @"J"}, + {46, @"K"}, + {47, @"L"}, + {48, @"M"}, + {49, @"N"}, + {50, @"O"}, + {51, @"P"}, + {52, @"Q"}, + {53, @"R"}, + {54, @"S"}, + {55, @"T"}, + {56, @"U"}, + {57, @"V"}, + {58, @"W"}, + {59, @"X"}, + {60, @"Y"}, + {61, @"Z"}, + {62, @"bracketleft"}, + {63, @"backslash"}, + {64, @"bracketright"}, + {65, @"asciicircum"}, + {66, @"underscore"}, + {67, @"grave"}, + {68, @"a"}, + {69, @"b"}, + {70, @"c"}, + {71, @"d"}, + {72, @"e"}, + {73, @"f"}, + {74, @"g"}, + {75, @"h"}, + {76, @"i"}, + {77, @"j"}, + {78, @"k"}, + {79, @"l"}, + {80, @"m"}, + {81, @"n"}, + {82, @"o"}, + {83, @"p"}, + {84, @"q"}, + {85, @"r"}, + {86, @"s"}, + {87, @"t"}, + {88, @"u"}, + {89, @"v"}, + {90, @"w"}, + {91, @"x"}, + {92, @"y"}, + {93, @"z"}, + {94, @"braceleft"}, + {95, @"bar"}, + {96, @"braceright"}, + {97, @"asciitilde"}, + {98, @"Adieresis"}, + {99, @"Aring"}, + {100, @"Ccedilla"}, + {101, @"Eacute"}, + {102, @"Ntilde"}, + {103, @"Odieresis"}, + {104, @"Udieresis"}, + {105, @"aacute"}, + {106, @"agrave"}, + {107, @"acircumflex"}, + {108, @"adieresis"}, + {109, @"atilde"}, + {110, @"aring"}, + {111, @"ccedilla"}, + {112, @"eacute"}, + {113, @"egrave"}, + {114, @"ecircumflex"}, + {115, @"edieresis"}, + {116, @"iacute"}, + {117, @"igrave"}, + {118, @"icircumflex"}, + {119, @"idieresis"}, + {120, @"ntilde"}, + {121, @"oacute"}, + {122, @"ograve"}, + {123, @"ocircumflex"}, + {124, @"odieresis"}, + {125, @"otilde"}, + {126, @"uacute"}, + {127, @"ugrave"}, + {128, @"ucircumflex"}, + {129, @"udieresis"}, + {130, @"dagger"}, + {131, @"degree"}, + {132, @"cent"}, + {133, @"sterling"}, + {134, @"section"}, + {135, @"bullet"}, + {136, @"paragraph"}, + {137, @"germandbls"}, + {138, @"registered"}, + {139, @"copyright"}, + {140, @"trademark"}, + {141, @"acute"}, + {142, @"dieresis"}, + {143, @"notequal"}, + {144, @"AE"}, + {145, @"Oslash"}, + {146, @"infinity"}, + {147, @"plusminus"}, + {148, @"lessequal"}, + {149, @"greaterequal"}, + {150, @"yen"}, + {151, @"mu"}, + {152, @"partialdiff"}, + {153, @"summation"}, + {154, @"product"}, + {155, @"pi"}, + {156, @"integral"}, + {157, @"ordfeminine"}, + {158, @"ordmasculine"}, + {159, @"Omega"}, + {160, @"ae"}, + {161, @"oslash"}, + {162, @"questiondown"}, + {163, @"exclamdown"}, + {164, @"logicalnot"}, + {165, @"radical"}, + {166, @"florin"}, + {167, @"approxequal"}, + {168, @"Delta"}, + {169, @"guillemotleft"}, + {170, @"guillemotright"}, + {171, @"ellipsis"}, + {172, @"nonbreakingspace"}, + {173, @"Agrave"}, + {174, @"Atilde"}, + {175, @"Otilde"}, + {176, @"OE"}, + {177, @"oe"}, + {178, @"endash"}, + {179, @"emdash"}, + {180, @"quotedblleft"}, + {181, @"quotedblright"}, + {182, @"quoteleft"}, + {183, @"quoteright"}, + {184, @"divide"}, + {185, @"lozenge"}, + {186, @"ydieresis"}, + {187, @"Ydieresis"}, + {188, @"fraction"}, + {189, @"currency"}, + {190, @"guilsinglleft"}, + {191, @"guilsinglright"}, + {192, @"fi"}, + {193, @"fl"}, + {194, @"daggerdbl"}, + {195, @"periodcentered"}, + {196, @"quotesinglbase"}, + {197, @"quotedblbase"}, + {198, @"perthousand"}, + {199, @"Acircumflex"}, + {200, @"Ecircumflex"}, + {201, @"Aacute"}, + {202, @"Edieresis"}, + {203, @"Egrave"}, + {204, @"Iacute"}, + {205, @"Icircumflex"}, + {206, @"Idieresis"}, + {207, @"Igrave"}, + {208, @"Oacute"}, + {209, @"Ocircumflex"}, + {210, @"apple"}, + {211, @"Ograve"}, + {212, @"Uacute"}, + {213, @"Ucircumflex"}, + {214, @"Ugrave"}, + {215, @"dotlessi"}, + {216, @"circumflex"}, + {217, @"tilde"}, + {218, @"macron"}, + {219, @"breve"}, + {220, @"dotaccent"}, + {221, @"ring"}, + {222, @"cedilla"}, + {223, @"hungarumlaut"}, + {224, @"ogonek"}, + {225, @"caron"}, + {226, @"Lslash"}, + {227, @"lslash"}, + {228, @"Scaron"}, + {229, @"scaron"}, + {230, @"Zcaron"}, + {231, @"zcaron"}, + {232, @"brokenbar"}, + {233, @"Eth"}, + {234, @"eth"}, + {235, @"Yacute"}, + {236, @"yacute"}, + {237, @"Thorn"}, + {238, @"thorn"}, + {239, @"minus"}, + {240, @"multiply"}, + {241, @"onesuperior"}, + {242, @"twosuperior"}, + {243, @"threesuperior"}, + {244, @"onehalf"}, + {245, @"onequarter"}, + {246, @"threequarters"}, + {247, @"franc"}, + {248, @"Gbreve"}, + {249, @"gbreve"}, + {250, @"Idotaccent"}, + {251, @"Scedilla"}, + {252, @"scedilla"}, + {253, @"Cacute"}, + {254, @"cacute"}, + {255, @"Ccaron"}, + {256, @"ccaron"}, + {257, @"dcroat"}, }; static void loadMacintoshNameMapping(NSMapTable *table) { @@ -754,9 +754,9 @@ void O2TTFDecoderGetNameTable(O2TTFDecoderRef self) { NSLog(@"position=%ld,stringOffset=%d,offset=%d", self->_position, stringOffset, offset); - NSString *string = - [NSString stringWithCString: (const char *) self->_bytes + location - length: length]; + NSString *string = [NSString + stringWithCString: (const char *) self->_bytes + location + length: length]; NSLog(@"platformID=%d,languageID=%d,string=%@", platformID, languageID, string); diff --git a/Onyx2D/O2argb8u.m b/Onyx2D/O2argb8u.m index 512dc69c..ff77cac3 100644 --- a/Onyx2D/O2argb8u.m +++ b/Onyx2D/O2argb8u.m @@ -34,8 +34,8 @@ void O2ApplyCoverageToSpan_largb8u_PRE(O2argb8u *dst, int coverage, O2argb8u d = *dst; *dst = O2argb8uAdd( - O2argb8uMultiplyByCoverageNoBypass(r, coverage), - O2argb8uMultiplyByCoverageNoBypass(d, oneMinusCoverage)); + O2argb8uMultiplyByCoverageNoBypass(r, coverage), + O2argb8uMultiplyByCoverageNoBypass(d, oneMinusCoverage)); } } } @@ -120,14 +120,18 @@ void O2argb8u_sover_by_coverage(O2argb8u *src, O2argb8u *dst, unsigned coverage, O2argb8u d = *dst; uint32_t sa = 255 - s.a; - r.a = RI_UINT32_MIN( - (uint32_t) s.a + O2Image_8u_mul_8u_div_255(d.a, sa), 255); - r.r = RI_UINT32_MIN( - (uint32_t) s.r + O2Image_8u_mul_8u_div_255(d.r, sa), 255); - r.g = RI_UINT32_MIN( - (uint32_t) s.g + O2Image_8u_mul_8u_div_255(d.g, sa), 255); - r.b = RI_UINT32_MIN( - (uint32_t) s.b + O2Image_8u_mul_8u_div_255(d.b, sa), 255); + r.a = RI_UINT32_MIN((uint32_t) s.a + + O2Image_8u_mul_8u_div_255(d.a, sa), + 255); + r.r = RI_UINT32_MIN((uint32_t) s.r + + O2Image_8u_mul_8u_div_255(d.r, sa), + 255); + r.g = RI_UINT32_MIN((uint32_t) s.g + + O2Image_8u_mul_8u_div_255(d.g, sa), + 255); + r.b = RI_UINT32_MIN((uint32_t) s.b + + O2Image_8u_mul_8u_div_255(d.b, sa), + 255); } *dst = r; } @@ -144,26 +148,30 @@ void O2argb8u_sover_by_coverage(O2argb8u *src, O2argb8u *dst, unsigned coverage, dcomp = s.a; tmp = ((uint32_t) s.a + O2Image_8u_mul_8u_div_255(dcomp, sa)) * coverage; - r.a = RI_UINT32_MIN( - (tmp + dcomp * oneMinusCoverage) / COVERAGE_MULTIPLIER, 255); + r.a = RI_UINT32_MIN((tmp + dcomp * oneMinusCoverage) / + COVERAGE_MULTIPLIER, + 255); dcomp = d.r; tmp = ((uint32_t) s.r + O2Image_8u_mul_8u_div_255(dcomp, sa)) * coverage; - r.r = RI_UINT32_MIN( - (tmp + dcomp * oneMinusCoverage) / COVERAGE_MULTIPLIER, 255); + r.r = RI_UINT32_MIN((tmp + dcomp * oneMinusCoverage) / + COVERAGE_MULTIPLIER, + 255); dcomp = d.g; tmp = ((uint32_t) s.g + O2Image_8u_mul_8u_div_255(dcomp, sa)) * coverage; - r.g = RI_UINT32_MIN( - (tmp + dcomp * oneMinusCoverage) / COVERAGE_MULTIPLIER, 255); + r.g = RI_UINT32_MIN((tmp + dcomp * oneMinusCoverage) / + COVERAGE_MULTIPLIER, + 255); dcomp = d.b; tmp = ((uint32_t) s.b + O2Image_8u_mul_8u_div_255(dcomp, sa)) * coverage; - r.b = RI_UINT32_MIN( - (tmp + dcomp * oneMinusCoverage) / COVERAGE_MULTIPLIER, 255); + r.b = RI_UINT32_MIN((tmp + dcomp * oneMinusCoverage) / + COVERAGE_MULTIPLIER, + 255); *dst = r; } @@ -313,19 +321,19 @@ void O2BlendSpanXOR_8888(O2argb8u *src, O2argb8u *dst, int length) { r.r = RI_INT_MIN(((unsigned) s.r * (255 - (unsigned) d.a) + (unsigned) d.r * (255 - (unsigned) s.a)) / - 255, + 255, 255); r.g = RI_INT_MIN(((unsigned) s.g * (255 - (unsigned) d.a) + (unsigned) d.g * (255 - (unsigned) s.a)) / - 255, + 255, 255); r.b = RI_INT_MIN(((unsigned) s.b * (255 - (unsigned) d.a) + (unsigned) d.b * (255 - (unsigned) s.a)) / - 255, + 255, 255); r.a = RI_INT_MIN(((unsigned) s.a * (255 - (unsigned) d.a) + (unsigned) d.a * (255 - (unsigned) s.a)) / - 255, + 255, 255); src[i] = r; diff --git a/Onyx2D/O2zlib.m b/Onyx2D/O2zlib.m index 6d1fb24e..77274d83 100644 --- a/Onyx2D/O2zlib.m +++ b/Onyx2D/O2zlib.m @@ -215,7 +215,7 @@ static void expand(O2FlateDecode *inflate, int n) { } while (inflate->outPosition + n > inflate->outLength); inflate->outBytes = - NSZoneRealloc(NULL, inflate->outBytes, inflate->outLength); + NSZoneRealloc(NULL, inflate->outBytes, inflate->outLength); } } @@ -271,7 +271,7 @@ static int parse_huffman_block(O2FlateDecode *inflate) { static int compute_huffman_codes(O2FlateDecode *inflate) { static unsigned char length_dezigzag[19] = { - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; zhuffman z_codelength; unsigned char lencodes[286 + 32 + 137]; // padding for maximum single op unsigned char codelength_sizes[19]; @@ -334,7 +334,7 @@ static int parse_uncompressed_block(O2FlateDecode *inflate) { k = 0; while (inflate->num_bits > 0) { header[k++] = - (unsigned char) (inflate->code_buffer & 255); // wtf this warns? + (unsigned char) (inflate->code_buffer & 255); // wtf this warns? inflate->code_buffer >>= 8; inflate->num_bits -= 8; } @@ -378,24 +378,24 @@ static int parse_zlib_header(O2FlateDecode *inflate) { } static const unsigned char default_length[288] = { - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, }; static const unsigned char default_distance[32] = { - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, }; static int parse_zlib(O2FlateDecode *inflate) { diff --git a/Onyx2D/VGPath.m b/Onyx2D/VGPath.m index 5bd5e5b3..57d3c9e5 100644 --- a/Onyx2D/VGPath.m +++ b/Onyx2D/VGPath.m @@ -322,10 +322,10 @@ static O2Point circularLerp(O2Point t0, O2Point t1, O2Float ratio) { self->_vertexCount = 0; self->_vertexCapacity = 2; self->_vertices = - NSZoneMalloc(NULL, self->_vertexCapacity * sizeof(Vertex)); + NSZoneMalloc(NULL, self->_vertexCapacity * sizeof(Vertex)); self->_segmentToVertexCapacity = 2; self->_segmentToVertex = NSZoneMalloc(NULL, self->_segmentToVertexCapacity * - sizeof(VertexIndex)); + sizeof(VertexIndex)); return self; } @@ -353,8 +353,8 @@ int VGPathCountNumCoordinates(const uint8_t *segments, int numSegments) { int coordinates = 0; int i; for (i = 0; i < numSegments; i++) - coordinates += - O2PathElementTypeToNumCoordinates((O2PathElementType) segments[i]); + coordinates += O2PathElementTypeToNumCoordinates( + (O2PathElementType) segments[i]); return coordinates; } @@ -372,7 +372,7 @@ void VGPathFill(VGPath *self, O2AffineTransform pathToSurface, for (i = 0; i < self->_vertexCount; i++) { O2Point p1 = O2PointApplyAffineTransform( - self->_vertices[i].userPosition, pathToSurface); + self->_vertices[i].userPosition, pathToSurface); if (!(self->_vertices[i].flags & START_SEGMENT)) { // in the middle of a segment @@ -412,7 +412,7 @@ void VGPathInterpolateStroke(O2AffineTransform pathToSurface, const O2Float tessellationAngle = 5.0f; O2Float angle = RI_RAD_TO_DEG((O2Float) acos( - RI_CLAMP(Vector2Dot(v0.t, v1.t), -1.0f, 1.0f))) / + RI_CLAMP(Vector2Dot(v0.t, v1.t), -1.0f, 1.0f))) / tessellationAngle; int samples = RI_INT_MAX((int) ceil(angle), 1); @@ -430,10 +430,10 @@ void VGPathInterpolateStroke(O2AffineTransform pathToSurface, O2Point v0p = O2PointApplyAffineTransform(v0.p, pathToSurface); O2Point v1p = O2PointApplyAffineTransform(v1.p, pathToSurface); O2Point n = O2PointApplyAffineTransformNoTranslate( - Vector2MultiplyByFloat( - Vector2Normalize(Vector2PerpendicularCCW(v1.t)), - strokeWidth * 0.5f), - pathToSurface); + Vector2MultiplyByFloat( + Vector2Normalize(Vector2PerpendicularCCW(v1.t)), + strokeWidth * 0.5f), + pathToSurface); O2Point npccw = Vector2Add(v0p, n); O2Point npcw = Vector2Subtract(v0p, n); @@ -487,24 +487,24 @@ void VGPathInterpolateStroke(O2AffineTransform pathToSurface, for (j = 0; j < samples; j++) { O2Float t = (O2Float)(j + 1) / (O2Float) samples; O2Point position = - Vector2Add(Vector2MultiplyByFloat(v0.p, (1.0f - t)), - Vector2MultiplyByFloat(v1.p, t)); + Vector2Add(Vector2MultiplyByFloat(v0.p, (1.0f - t)), + Vector2MultiplyByFloat(v1.p, t)); O2Point tangent = circularLerp(v0.t, v1.t, t); O2Point n = Vector2MultiplyByFloat( - Vector2Normalize(Vector2PerpendicularCCW(tangent)), - strokeWidth * 0.5f); + Vector2Normalize(Vector2PerpendicularCCW(tangent)), + strokeWidth * 0.5f); if (j == samples - 1) position = v1.p; - O2Point npccw = - O2PointApplyAffineTransform(Vector2Add(prev, n), pathToSurface); + O2Point npccw = O2PointApplyAffineTransform(Vector2Add(prev, n), + pathToSurface); O2Point npcw = O2PointApplyAffineTransform(Vector2Subtract(prev, n), pathToSurface); O2Point nnccw = O2PointApplyAffineTransform(Vector2Add(position, n), pathToSurface); O2Point nncw = O2PointApplyAffineTransform( - Vector2Subtract(position, n), pathToSurface); + Vector2Subtract(position, n), pathToSurface); O2DContextAddEdge(context, npccw, nnccw); O2DContextAddEdge(context, nnccw, nncw); @@ -578,17 +578,17 @@ void VGPathDoCap(O2AffineTransform pathToSurface, O2Context_builtin *context, #if 1 O2Point vp = O2PointApplyAffineTransform(v.p, pathToSurface); O2Point next = O2PointApplyAffineTransformNoTranslate( - Vector2MultiplyByFloat(circularLerpWithDirection(u0, u1, t), - strokeWidth * 0.5f), - pathToSurface); + Vector2MultiplyByFloat(circularLerpWithDirection(u0, u1, t), + strokeWidth * 0.5f), + pathToSurface); next = Vector2Add(vp, next); #else O2Point next = Vector2Add( - v.p, - Vector2MultiplyByFloat(circularLerpWithDirection(u0, u1, t), - strokeWidth * 0.5f)); + v.p, + Vector2MultiplyByFloat(circularLerpWithDirection(u0, u1, t), + strokeWidth * 0.5f)); next = O2PointApplyAffineTransform(next, pathToSurface); #endif @@ -606,7 +606,7 @@ void VGPathDoCap(O2AffineTransform pathToSurface, O2Context_builtin *context, O2Point vccw = O2PointApplyAffineTransform(v.ccw, pathToSurface); O2Point vcw = O2PointApplyAffineTransform(v.cw, pathToSurface); O2Point strokeRadius = O2PointApplyAffineTransformNoTranslate( - Vector2MultiplyByFloat(t, strokeWidth * 0.5f), pathToSurface); + Vector2MultiplyByFloat(t, strokeWidth * 0.5f), pathToSurface); O2Point ccws = Vector2Add(vccw, strokeRadius); O2Point cws = Vector2Add(vcw, strokeRadius); @@ -662,7 +662,7 @@ void VGPathDoJoin(O2AffineTransform pathToSurface, O2Context_builtin *context, switch (joinStyle) { case kO2LineJoinMiter: { O2Float theta = (O2Float) acos( - RI_CLAMP(Vector2Dot(v0.t, Vector2Negate(v1.t)), -1.0f, 1.0f)); + RI_CLAMP(Vector2Dot(v0.t, Vector2Negate(v1.t)), -1.0f, 1.0f)); O2Float miterLengthPerStrokeWidth = 1.0f / (O2Float) sin(theta * 0.5f); if (miterLengthPerStrokeWidth < miterLimit) { // miter O2Float l = (O2Float) cos(theta * 0.5f) * @@ -670,8 +670,8 @@ void VGPathDoJoin(O2AffineTransform pathToSurface, O2Context_builtin *context, l = RI_MIN(l, RI_FLOAT_MAX); // force finite O2Point c = Vector2Add( - m, O2PointApplyAffineTransformNoTranslate( - Vector2MultiplyByFloat(v0.t, l), pathToSurface)); + m, O2PointApplyAffineTransformNoTranslate( + Vector2MultiplyByFloat(v0.t, l), pathToSurface)); O2DContextAddEdge(context, s, c); O2DContextAddEdge(context, c, e); @@ -690,7 +690,7 @@ void VGPathDoJoin(O2AffineTransform pathToSurface, O2Context_builtin *context, O2Point prev = s; O2Float angle = RI_RAD_TO_DEG((O2Float) acos( - RI_CLAMP(Vector2Dot(st, et), -1.0f, 1.0f))) / + RI_CLAMP(Vector2Dot(st, et), -1.0f, 1.0f))) / tessellationAngle; int samples = (int) ceil(angle); if (samples) { @@ -699,16 +699,17 @@ void VGPathDoJoin(O2AffineTransform pathToSurface, O2Context_builtin *context, int j; for (j = 1; j < samples; j++) { O2Point position = O2PointApplyAffineTransform( - Vector2Add(Vector2MultiplyByFloat(v0.p, (1.0f - t)), - Vector2MultiplyByFloat(v1.p, t)), - pathToSurface); + Vector2Add(Vector2MultiplyByFloat(v0.p, (1.0f - t)), + Vector2MultiplyByFloat(v1.p, t)), + pathToSurface); O2Point tangent = circularLerpWithDirection(st, et, t); O2Point strokeRadius = O2PointApplyAffineTransformNoTranslate( - Vector2MultiplyByFloat( - Vector2Normalize(Vector2Perpendicular(tangent, cw)), - strokeWidth * 0.5f), - pathToSurface); + Vector2MultiplyByFloat( + Vector2Normalize( + Vector2Perpendicular(tangent, cw)), + strokeWidth * 0.5f), + pathToSurface); O2Point next = Vector2Add(position, strokeRadius); O2DContextAddEdge(context, prev, next); @@ -775,13 +776,15 @@ void VGPathStroke(VGPath *self, O2AffineTransform pathToSurface, v1.t = v.userTangent; v1.ccw = Vector2Add( - v1.p, Vector2MultiplyByFloat( - Vector2Normalize(Vector2PerpendicularCCW(v1.t)), - strokeWidth * 0.5f)); + v1.p, + Vector2MultiplyByFloat( + Vector2Normalize(Vector2PerpendicularCCW(v1.t)), + strokeWidth * 0.5f)); v1.cw = Vector2Add( - v1.p, Vector2MultiplyByFloat( - Vector2Normalize(Vector2PerpendicularCW(v1.t)), - strokeWidth * 0.5f)); + v1.p, + Vector2MultiplyByFloat( + Vector2Normalize(Vector2PerpendicularCW(v1.t)), + strokeWidth * 0.5f)); v1.pathLength = v.pathLength; v1.flags = v.flags; @@ -833,19 +836,20 @@ void VGPathStroke(VGPath *self, O2AffineTransform pathToSurface, v1.t = v.userTangent; RI_ASSERT(!Vector2IsZero(v1.t)); // don't allow zero tangents v1.ccw = Vector2Add( - v1.p, Vector2MultiplyByFloat( - Vector2Normalize(Vector2PerpendicularCCW(v1.t)), - strokeWidth * 0.5f)); + v1.p, + Vector2MultiplyByFloat( + Vector2Normalize(Vector2PerpendicularCCW(v1.t)), + strokeWidth * 0.5f)); v1.cw = Vector2Add( - v1.p, Vector2MultiplyByFloat( - Vector2Normalize(Vector2PerpendicularCW(v1.t)), - strokeWidth * 0.5f)); + v1.p, + Vector2MultiplyByFloat( + Vector2Normalize(Vector2PerpendicularCW(v1.t)), + strokeWidth * 0.5f)); v1.pathLength = v.pathLength; v1.flags = v.flags; - v1.inDash = - dashing ? inDash - : YES; // NOTE: for other than START_SEGMENT vertices - // inDash will be updated after dashing + v1.inDash = dashing ? inDash : YES; // NOTE: for other than + // START_SEGMENT vertices inDash + // will be updated after dashing // process the vertex event if (v.flags & START_SEGMENT) { @@ -860,7 +864,7 @@ void VGPathStroke(VGPath *self, O2AffineTransform pathToSurface, for (;;) { O2Float prevDash = nextDash; nextDash = - prevDash + RI_MAX(dashPattern[d], 0.0f); + prevDash + RI_MAX(dashPattern[d], 0.0f); if (nextDash >= v1.pathLength) break; @@ -904,8 +908,8 @@ void VGPathStroke(VGPath *self, O2AffineTransform pathToSurface, IMPLICIT_CLOSE_SUBPATH)) { // normal segment, do stroking if (dashing) { StrokeVertex prevDashVertex = - v0; // dashing of the segment starts from the - // previous vertex + v0; // dashing of the segment starts from the + // previous vertex if (nextDash + 10000.0f * dashPatternLength < v1.pathLength) @@ -917,31 +921,34 @@ void VGPathStroke(VGPath *self, O2AffineTransform pathToSurface, // their starting point to this segment already in order // to generate a join int numDashStops = 0; - while ( - nextDash < v1.pathLength || - (nextDash <= v1.pathLength && - dashPattern[(d + 1) % dashPatternSize] == 0.0f)) { + while (nextDash < v1.pathLength || + (nextDash <= v1.pathLength && + dashPattern[(d + 1) % dashPatternSize] == + 0.0f)) { O2Float edgeLength = v1.pathLength - v0.pathLength; O2Float ratio = 0.0f; if (edgeLength > 0.0f) ratio = (nextDash - v0.pathLength) / edgeLength; StrokeVertex nextDashVertex = StrokeVertexInit(); nextDashVertex.p = Vector2Add( - Vector2MultiplyByFloat(v0.p, (1.0f - ratio)), - Vector2MultiplyByFloat(v1.p, ratio)); + Vector2MultiplyByFloat(v0.p, + (1.0f - ratio)), + Vector2MultiplyByFloat(v1.p, ratio)); nextDashVertex.t = circularLerp(v0.t, v1.t, ratio); nextDashVertex.ccw = Vector2Add( - nextDashVertex.p, - Vector2MultiplyByFloat( - Vector2Normalize(Vector2PerpendicularCCW( - nextDashVertex.t)), - strokeWidth * 0.5f)); + nextDashVertex.p, + Vector2MultiplyByFloat( + Vector2Normalize( + Vector2PerpendicularCCW( + nextDashVertex.t)), + strokeWidth * 0.5f)); nextDashVertex.cw = Vector2Add( - nextDashVertex.p, - Vector2MultiplyByFloat( - Vector2Normalize(Vector2PerpendicularCW( - nextDashVertex.t)), - strokeWidth * 0.5f)); + nextDashVertex.p, + Vector2MultiplyByFloat( + Vector2Normalize( + Vector2PerpendicularCW( + nextDashVertex.t)), + strokeWidth * 0.5f)); if (inDash) { // stroke from prevDashVertex -> // nextDashVertex @@ -958,8 +965,8 @@ void VGPathStroke(VGPath *self, O2AffineTransform pathToSurface, strokeWidth, capStyle); } VGPathInterpolateStroke( - pathToSurface, context, prevDashVertex, - nextDashVertex, strokeWidth); + pathToSurface, context, prevDashVertex, + nextDashVertex, strokeWidth); VGPathDoCap(pathToSurface, context, nextDashVertex, strokeWidth, capStyle); // end cap @@ -1064,18 +1071,19 @@ void VGPathGetPointAlong(VGPath *self, int startIndex, int numSegments, RI_ASSERT(startVertex >= 0 && startVertex < self->_vertexCount); RI_ASSERT(endVertex >= 0 && endVertex < self->_vertexCount); - distance += self->_vertices[startVertex] + distance += + self->_vertices[startVertex] .pathLength; // map distance to the range of the whole path if (distance <= self->_vertices[startVertex] - .pathLength) { // return the first point of the path + .pathLength) { // return the first point of the path *p = self->_vertices[startVertex].userPosition; *t = self->_vertices[startVertex].userTangent; return; } if (distance >= self->_vertices[endVertex] - .pathLength) { // return the last point of the path + .pathLength) { // return the last point of the path *p = self->_vertices[endVertex].userPosition; *t = self->_vertices[endVertex].userTangent; return; @@ -1095,25 +1103,25 @@ void VGPathGetPointAlong(VGPath *self, int startIndex, int numSegments, if (distance >= self->_vertices[start].pathLength && distance < - self->_vertices[end] - .pathLength) { // segment contains the queried distance + self->_vertices[end].pathLength) { // segment contains the + // queried distance int i; for (i = start; i < end; i++) { Vertex v0 = self->_vertices[i]; Vertex v1 = self->_vertices[i + 1]; if (distance >= v0.pathLength && distance < - v1.pathLength) { // segment found, interpolate linearly - // between its end points + v1.pathLength) { // segment found, interpolate + // linearly between its end points O2Float edgeLength = v1.pathLength - v0.pathLength; RI_ASSERT(edgeLength > 0.0f); O2Float r = (distance - v0.pathLength) / edgeLength; *p = Vector2Add( - Vector2MultiplyByFloat(v0.userPosition, (1.0f - r)), - Vector2MultiplyByFloat(v1.userPosition, r)); + Vector2MultiplyByFloat(v0.userPosition, (1.0f - r)), + Vector2MultiplyByFloat(v1.userPosition, r)); *t = Vector2Add( - Vector2MultiplyByFloat(v0.userTangent, (1.0f - r)), - Vector2MultiplyByFloat(v1.userTangent, r)); + Vector2MultiplyByFloat(v0.userTangent, (1.0f - r)), + Vector2MultiplyByFloat(v1.userTangent, r)); return; } } @@ -1221,7 +1229,7 @@ void VGPathAddVertex(VGPath *self, O2Point p, O2Point t, O2Float pathLength, if (self->_vertexCount + 1 > self->_vertexCapacity) { self->_vertexCapacity *= 2; self->_vertices = (Vertex *) NSZoneRealloc( - NULL, self->_vertices, self->_vertexCapacity * sizeof(Vertex)); + NULL, self->_vertices, self->_vertexCapacity * sizeof(Vertex)); } self->_vertices[self->_vertexCount++] = v; @@ -1283,9 +1291,9 @@ void VGPathAddEndPath(VGPath *self, O2Point p0, O2Point p1, O2Point t = Vector2Normalize(Vector2Subtract(p1, p0)); if (Vector2IsZero(t)) t = self->_vertices[self->_vertexCount - 1] - .userTangent; // if the segment is zero-length, use the tangent - // of the last segment end point so that proper - // join will be generated + .userTangent; // if the segment is zero-length, use the + // tangent of the last segment end point so + // that proper join will be generated RI_ASSERT(!Vector2IsZero(t)); VGPathAddEdge(self, p0, p1, t, t, flags | START_SEGMENT, @@ -1351,13 +1359,13 @@ BOOL VGPathAddQuadTo(VGPath *self, O2Point p0, O2Point p1, O2Point p2, O2Float t = (O2Float) i / (O2Float) segments; O2Float u = 1.0f - t; O2Point pn = - Vector2Add(Vector2Add(Vector2MultiplyByFloat(p0, u * u), - Vector2MultiplyByFloat(p1, 2.0f * t * u)), - Vector2MultiplyByFloat(p2, t * t)); + Vector2Add(Vector2Add(Vector2MultiplyByFloat(p0, u * u), + Vector2MultiplyByFloat(p1, 2.0f * t * u)), + Vector2MultiplyByFloat(p2, t * t)); O2Point tn = Vector2Add( - Vector2Add(Vector2MultiplyByFloat(p0, (-1.0f + t)), - Vector2MultiplyByFloat(p1, (1.0f - 2.0f * t))), - Vector2MultiplyByFloat(p2, t)); + Vector2Add(Vector2MultiplyByFloat(p0, (-1.0f + t)), + Vector2MultiplyByFloat(p1, (1.0f - 2.0f * t))), + Vector2MultiplyByFloat(p2, t)); tn = Vector2Normalize(tn); if (Vector2IsZero(tn)) tn = tp; @@ -1462,17 +1470,19 @@ BOOL VGPathAddCubicTo(VGPath *self, O2Point p0, O2Point p1, O2Point p2, O2Float t = (O2Float) i / (O2Float) segments; O2Float u = 1.0f - t; O2Point pn = Vector2Add( - Vector2Add(Vector2Add(Vector2MultiplyByFloat(p0, u * u * u), - Vector2MultiplyByFloat(p1, 3.0f * t * u * u)), - Vector2MultiplyByFloat(p2, 3.0f * t * t * u)), - Vector2MultiplyByFloat(p3, t * t * t)); + Vector2Add(Vector2Add(Vector2MultiplyByFloat(p0, u * u * u), + Vector2MultiplyByFloat(p1, + 3.0f * t * u * u)), + Vector2MultiplyByFloat(p2, 3.0f * t * t * u)), + Vector2MultiplyByFloat(p3, t * t * t)); O2Point tn = Vector2Add( - Vector2Add(Vector2Add(Vector2MultiplyByFloat( - p0, (-1.0f + 2.0f * t - t * t)), - Vector2MultiplyByFloat( - p1, (1.0f - 4.0f * t + 3.0f * t * t))), - Vector2MultiplyByFloat(p2, (2.0f * t - 3.0f * t * t))), - Vector2MultiplyByFloat(p3, t * t)); + Vector2Add( + Vector2Add(Vector2MultiplyByFloat( + p0, (-1.0f + 2.0f * t - t * t)), + Vector2MultiplyByFloat(p1, (1.0f - 4.0f * t + + 3.0f * t * t))), + Vector2MultiplyByFloat(p2, (2.0f * t - 3.0f * t * t))), + Vector2MultiplyByFloat(p3, t * t)); tn = Vector2Normalize(tn); if (Vector2IsZero(tn)) tn = tp; @@ -1509,18 +1519,19 @@ void VGPathTessellateIfNeeded(VGPath *self) { if (self->_segmentToVertexCapacity < numberOfElements) { self->_segmentToVertexCapacity = numberOfElements; self->_segmentToVertex = NSZoneRealloc( - NULL, self->_segmentToVertex, - self->_segmentToVertexCapacity * sizeof(VertexIndex)); + NULL, self->_segmentToVertex, + self->_segmentToVertexCapacity * sizeof(VertexIndex)); } int coordIndex = 0; O2Point s = O2PointMake(0, 0); // the beginning of the current subpath O2Point o = O2PointMake(0, 0); // the last point of the previous segment O2Point p = O2PointMake( - 0, - 0); // the last internal control point of the previous segment, - // if the segment was a (regular or smooth) quadratic or cubic - // Bezier, or else the last point of the previous segment + 0, + 0); // the last internal control point of the previous segment, + // if the segment was a (regular or smooth) quadratic or + // cubic Bezier, or else the last point of the previous + // segment // tessellate the path segments coordIndex = 0; @@ -1602,7 +1613,7 @@ void VGPathTessellateIfNeeded(VGPath *self) { } else { // segment didn't produce vertices (zero-length segment). // Ignore it. self->_segmentToVertex[i].start = - self->_segmentToVertex[i].end = self->_vertexCount - 1; + self->_segmentToVertex[i].end = self->_vertexCount - 1; } prevSegment = segment; coordIndex += coords; diff --git a/Onyx2D/include/Onyx2D/O2BitmapContext.h b/Onyx2D/include/Onyx2D/O2BitmapContext.h index 9f5d472e..3cc19710 100644 --- a/Onyx2D/include/Onyx2D/O2BitmapContext.h +++ b/Onyx2D/include/Onyx2D/O2BitmapContext.h @@ -37,9 +37,9 @@ typedef void (*O2BitmapContextReleaseDataCallback)(void *userInfo, void *data); - (O2Surface *) surface; O2ContextRef O2BitmapContextCreateWithData( - void *bytes, size_t width, size_t height, size_t bitsPerComponent, - size_t bytesPerRow, O2ColorSpaceRef colorSpace, O2BitmapInfo bitmapInfo, - O2BitmapContextReleaseDataCallback releaseCallback, void *releaseInfo); + void *bytes, size_t width, size_t height, size_t bitsPerComponent, + size_t bytesPerRow, O2ColorSpaceRef colorSpace, O2BitmapInfo bitmapInfo, + O2BitmapContextReleaseDataCallback releaseCallback, void *releaseInfo); O2ContextRef O2BitmapContextCreate(void *bytes, size_t width, size_t height, size_t bitsPerComponent, size_t bytesPerRow, @@ -68,6 +68,6 @@ O2ImageRef O2BitmapContextCreateImage(O2ContextRef self); colorSpace: (O2ColorSpaceRef) colorSpace bitmapInfo: (O2BitmapInfo) bitmapInfo releaseCallback: - (O2BitmapContextReleaseDataCallback) releaseCallback + (O2BitmapContextReleaseDataCallback) releaseCallback releaseInfo: (void *) releaseInfo; @end diff --git a/Onyx2D/include/Onyx2D/O2ClipPhase.h b/Onyx2D/include/Onyx2D/O2ClipPhase.h index 48d08d73..33092085 100644 --- a/Onyx2D/include/Onyx2D/O2ClipPhase.h +++ b/Onyx2D/include/Onyx2D/O2ClipPhase.h @@ -24,8 +24,8 @@ typedef enum { O2ClipPhase *O2ClipPhaseInitWithNonZeroPath(O2ClipPhase *self, O2Path *path); - initWithEOPath: (O2Path *) path; - initWithMask: (O2Image *) mask - rect: (O2Rect) rect - transform: (O2AffineTransform) transform; + rect: (O2Rect) rect + transform: (O2AffineTransform) transform; O2ClipPhaseType O2ClipPhasePhaseType(O2ClipPhase *self); id O2ClipPhaseObject(O2ClipPhase *self); diff --git a/Onyx2D/include/Onyx2D/O2ClipState.h b/Onyx2D/include/Onyx2D/O2ClipState.h index bdd0b549..81db233c 100644 --- a/Onyx2D/include/Onyx2D/O2ClipState.h +++ b/Onyx2D/include/Onyx2D/O2ClipState.h @@ -39,7 +39,7 @@ O2ClipMask *O2ClipStateIntegralMask(O2ClipState *self); - (void) addNonZeroWindingPath: (O2Path *) path; - (void) addEvenOddWindingPath: (O2Path *) path; - (void) addMask: (O2Image *) image - inRect: (O2Rect) rect - transform: (O2AffineTransform) transform; + inRect: (O2Rect) rect + transform: (O2AffineTransform) transform; @end diff --git a/Onyx2D/include/Onyx2D/O2Context.h b/Onyx2D/include/Onyx2D/O2Context.h index 7648d6b4..b875c264 100644 --- a/Onyx2D/include/Onyx2D/O2Context.h +++ b/Onyx2D/include/Onyx2D/O2Context.h @@ -25,8 +25,8 @@ extern "C" { #endif @class O2Context, O2Color, O2Shading, O2Image, O2GState, O2MutablePath, O2Path, - O2Pattern, O2Layer, O2PDFPage, NSMutableArray, CGWindow, O2Surface, - NSDictionary, NSData, O2Font, O2Encoding, O2PDFCharWidths, O2ClipState; + O2Pattern, O2Layer, O2PDFPage, NSMutableArray, CGWindow, O2Surface, + NSDictionary, NSData, O2Font, O2Encoding, O2PDFCharWidths, O2ClipState; typedef O2Context *O2ContextRef; @@ -337,7 +337,7 @@ void O2ContextSetShouldSmoothFonts(O2ContextRef self, BOOL yesOrNo); void O2ContextSetAllowsFontSmoothing(O2ContextRef self, BOOL allowsFontSmoothing); void O2ContextSetAllowsFontSubpixelQuantization( - O2ContextRef self, BOOL allowsFontSubpixelQuantization); + O2ContextRef self, BOOL allowsFontSubpixelQuantization); void O2ContextSetShouldSubpixelQuantizeFonts(O2ContextRef self, BOOL shouldSubpixelQuantizeFonts); void O2ContextSetLineWidth(O2ContextRef self, O2Float width); @@ -347,7 +347,7 @@ void O2ContextSetMiterLimit(O2ContextRef self, O2Float miterLimit); void O2ContextSetLineDash(O2ContextRef self, O2Float phase, const O2Float *lengths, NSUInteger count); void O2ContextSetAllowsFontSubpixelPositioning( - O2ContextRef self, BOOL allowsFontSubpixelPositioning); + O2ContextRef self, BOOL allowsFontSubpixelPositioning); void O2ContextSetShouldSubpixelPositionFonts(O2ContextRef self, BOOL shouldSubpixelPositionFonts); void O2ContextSetRenderingIntent(O2ContextRef self, diff --git a/Onyx2D/include/Onyx2D/O2Context_builtin.h b/Onyx2D/include/Onyx2D/O2Context_builtin.h index b44e35c1..40a1f060 100644 --- a/Onyx2D/include/Onyx2D/O2Context_builtin.h +++ b/Onyx2D/include/Onyx2D/O2Context_builtin.h @@ -103,8 +103,8 @@ typedef void (*O2WriteCoverage_argb8u)(O2Surface *surface, O2Surface *mask, } - (void) setWidth: (size_t) width - height: (size_t) height - reallocateOnlyIfRequired: (BOOL) roir; + height: (size_t) height + reallocateOnlyIfRequired: (BOOL) roir; void O2RasterizerDealloc(O2Context_builtin *self); void O2RasterizerSetViewport(O2Context_builtin *self, int x, int y, int vpwidth, diff --git a/Onyx2D/include/Onyx2D/O2Exceptions.h b/Onyx2D/include/Onyx2D/O2Exceptions.h index 25de8a64..a7b47d81 100644 --- a/Onyx2D/include/Onyx2D/O2Exceptions.h +++ b/Onyx2D/include/Onyx2D/O2Exceptions.h @@ -4,12 +4,11 @@ static inline void _KGInvalidAbstractInvocation(SEL selector, id object, const char *file, int line) { - [NSException - raise: NSInvalidArgumentException - format: - @"-%s only defined for abstract class. Define -[%@ %s] in %s:%d!", - sel_getName(selector), [object class], sel_getName(selector), file, - line]; + [NSException raise: NSInvalidArgumentException + format: @"-%s only defined for abstract class. Define -[%@ %s] " + @"in %s:%d!", + sel_getName(selector), [object class], + sel_getName(selector), file, line]; } static inline void _KGUnimplementedMethod(SEL selector, id object, diff --git a/Onyx2D/include/Onyx2D/O2GraphicsState.h b/Onyx2D/include/Onyx2D/O2GraphicsState.h index c2e3be86..e807a4fd 100644 --- a/Onyx2D/include/Onyx2D/O2GraphicsState.h +++ b/Onyx2D/include/Onyx2D/O2GraphicsState.h @@ -26,7 +26,8 @@ extern "C" { #endif @class O2Image, O2ColorSpace, O2Color, O2Pattern, O2MutablePath, O2Path, - NSArray, NSMutableArray, O2Font, O2Encoding, O2PDFCharWidths, O2ClipState; + NSArray, NSMutableArray, O2Font, O2Encoding, O2PDFCharWidths, + O2ClipState; @interface O2GState : NSObject { @public diff --git a/Onyx2D/include/Onyx2D/O2Image.h b/Onyx2D/include/Onyx2D/O2Image.h index ea6ac444..d3f15755 100644 --- a/Onyx2D/include/Onyx2D/O2Image.h +++ b/Onyx2D/include/Onyx2D/O2Image.h @@ -126,26 +126,26 @@ typedef O2Float *(*O2ImageFunction_read_a32f)(O2Image *self, int x, int y, } - initWithWidth: (size_t) width - height: (size_t) height - bitsPerComponent: (size_t) bitsPerComponent - bitsPerPixel: (size_t) bitsPerPixel - bytesPerRow: (size_t) bytesPerRow - colorSpace: (O2ColorSpaceRef) colorSpace - bitmapInfo: (O2BitmapInfo) bitmapInfo - decoder: (O2ImageDecoder *) decoder - provider: (O2DataProvider *) provider - decode: (const O2Float *) decode - interpolate: (BOOL) interpolate - renderingIntent: (O2ColorRenderingIntent) renderingIntent; + height: (size_t) height + bitsPerComponent: (size_t) bitsPerComponent + bitsPerPixel: (size_t) bitsPerPixel + bytesPerRow: (size_t) bytesPerRow + colorSpace: (O2ColorSpaceRef) colorSpace + bitmapInfo: (O2BitmapInfo) bitmapInfo + decoder: (O2ImageDecoder *) decoder + provider: (O2DataProvider *) provider + decode: (const O2Float *) decode + interpolate: (BOOL) interpolate + renderingIntent: (O2ColorRenderingIntent) renderingIntent; - initMaskWithWidth: (size_t) width - height: (size_t) height - bitsPerComponent: (size_t) bitsPerComponent - bitsPerPixel: (size_t) bitsPerPixel - bytesPerRow: (size_t) bytesPerRow - provider: (O2DataProvider *) provider - decode: (const O2Float *) decode - interpolate: (BOOL) interpolate; + height: (size_t) height + bitsPerComponent: (size_t) bitsPerComponent + bitsPerPixel: (size_t) bitsPerPixel + bytesPerRow: (size_t) bytesPerRow + provider: (O2DataProvider *) provider + decode: (const O2Float *) decode + interpolate: (BOOL) interpolate; - initWithJPEGDataProvider: (O2DataProvider *) jpegProvider decode: (const O2Float *) decode @@ -303,8 +303,8 @@ void O2ImagePointSampling_largb32f_PRE(O2Image *self, int x, int y, O2argb32f *span, int length, O2AffineTransform surfaceToImage); void O2ImageBilinearFloatTranslate_largb8u_PRE( - O2Image *self, int x, int y, O2argb8u *span, int length, - O2AffineTransform surfaceToImage); + O2Image *self, int x, int y, O2argb8u *span, int length, + O2AffineTransform surfaceToImage); void O2ImageIntegerTranslate_largb8u_PRE(O2Image *self, int x, int y, O2argb8u *span, int length, O2AffineTransform surfaceToImage); diff --git a/Onyx2D/include/Onyx2D/O2LZW.h b/Onyx2D/include/Onyx2D/O2LZW.h index 60e4f990..7e91c587 100644 --- a/Onyx2D/include/Onyx2D/O2LZW.h +++ b/Onyx2D/include/Onyx2D/O2LZW.h @@ -34,15 +34,17 @@ typedef struct LZWFileType { int LZWError; LZWWord BitsPerPixel, /* Bits per pixel (Codes uses at least this + 1). */ - ClearCode, /* The CLEAR LZ code. */ - EOFCode, /* The EOF LZ code. */ - RunningCode, /* The next code algorithm can generate. */ - RunningBits, /* The number of bits required to represent RunningCode. */ - MaxCode1, /* 1 bigger than max. possible code, in RunningBits bits. */ - LastCode, /* The code before the current code. */ - CrntCode, /* Current algorithm code. */ - StackPtr, /* For character stack (see below). */ - CrntShiftState; /* Number of bits in CrntShiftDWord. */ + ClearCode, /* The CLEAR LZ code. */ + EOFCode, /* The EOF LZ code. */ + RunningCode, /* The next code algorithm can generate. */ + RunningBits, /* The number of bits required to represent + RunningCode. */ + MaxCode1, /* 1 bigger than max. possible code, in RunningBits bits. + */ + LastCode, /* The code before the current code. */ + CrntCode, /* Current algorithm code. */ + StackPtr, /* For character stack (see below). */ + CrntShiftState; /* Number of bits in CrntShiftDWord. */ unsigned long CrntShiftDWord; /* For bytes decomposition into codes. */ unsigned long PixelCount; /* Number of pixels in image. */ NSInputStream *inputStream; diff --git a/Onyx2D/include/Onyx2D/O2PDFCharWidths.h b/Onyx2D/include/Onyx2D/O2PDFCharWidths.h index 5abac52b..7f73db63 100644 --- a/Onyx2D/include/Onyx2D/O2PDFCharWidths.h +++ b/Onyx2D/include/Onyx2D/O2PDFCharWidths.h @@ -8,9 +8,9 @@ } - initWithArray: (O2PDFArray *) array - firstChar: (int) firstChar - lastChar: (int) lastChar - missingWidth: (CGFloat) missingWidth; + firstChar: (int) firstChar + lastChar: (int) lastChar + missingWidth: (CGFloat) missingWidth; void O2PDFCharWidthsGetAdvances(O2PDFCharWidths *self, O2Size *advances, const uint8_t *bytes, int length); diff --git a/Onyx2D/include/Onyx2D/O2PDFContentStream.h b/Onyx2D/include/Onyx2D/O2PDFContentStream.h index 041a7d0a..abada8f7 100644 --- a/Onyx2D/include/Onyx2D/O2PDFContentStream.h +++ b/Onyx2D/include/Onyx2D/O2PDFContentStream.h @@ -20,7 +20,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class O2PDFPage, O2PDFStream, O2PDFDictionary, O2PDFArray, NSArray, - O2PDFObject; + O2PDFObject; @interface O2PDFContentStream : NSObject { NSArray *_streams; @@ -30,8 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - initWithPage: (O2PDFPage *) page; - initWithStream: (O2PDFStream *) stream - resources: (O2PDFDictionary *) resources - parent: (O2PDFContentStream *) parent; + resources: (O2PDFDictionary *) resources + parent: (O2PDFContentStream *) parent; - (NSArray *) streams; - (id) resourceForCategory: (const char *) category name: (const char *) name; diff --git a/Onyx2D/include/Onyx2D/O2PDFContext.h b/Onyx2D/include/Onyx2D/O2PDFContext.h index 05b74f93..58e51400 100644 --- a/Onyx2D/include/Onyx2D/O2PDFContext.h +++ b/Onyx2D/include/Onyx2D/O2PDFContext.h @@ -21,7 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import @class O2PDFContext, O2PDFxref, O2PDFObject, O2PDFDictionary, O2PDFArray, - NSMutableData, NSMutableDictionary, O2DataConsumer; + NSMutableData, NSMutableDictionary, O2DataConsumer; const NSString *kO2PDFContextTitle; @@ -45,8 +45,8 @@ const NSString *kO2PDFContextTitle; } - initWithConsumer: (O2DataConsumer *) consumer - mediaBox: (const O2Rect *) mediaBox - auxiliaryInfo: (NSDictionary *) auxiliaryInfo; + mediaBox: (const O2Rect *) mediaBox + auxiliaryInfo: (NSDictionary *) auxiliaryInfo; - (NSUInteger) length; @@ -61,8 +61,8 @@ const NSString *kO2PDFContextTitle; - (O2PDFObject *) referenceForFontWithName: (NSString *) name size: (O2Float) size; - (void) setReference: (O2PDFObject *) reference - forFontWithName: (NSString *) name - size: (O2Float) size; + forFontWithName: (NSString *) name + size: (O2Float) size; - (O2PDFObject *) referenceForObject: (O2PDFObject *) object; - (void) encodePDFObject: (O2PDFObject *) object; diff --git a/Onyx2D/include/Onyx2D/O2PDFFunction_Type0.h b/Onyx2D/include/Onyx2D/O2PDFFunction_Type0.h index e1816c76..4ca8c765 100644 --- a/Onyx2D/include/Onyx2D/O2PDFFunction_Type0.h +++ b/Onyx2D/include/Onyx2D/O2PDFFunction_Type0.h @@ -37,12 +37,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithDomain: (O2PDFArray *) domain - range: (O2PDFArray *) range - size: (O2PDFArray *) size - bitsPerSample: (O2PDFInteger) bps - order: (O2PDFInteger) order - encode: (O2PDFArray *) encode - decode: (O2PDFArray *) decode - data: (NSData *) data; + range: (O2PDFArray *) range + size: (O2PDFArray *) size + bitsPerSample: (O2PDFInteger) bps + order: (O2PDFInteger) order + encode: (O2PDFArray *) encode + decode: (O2PDFArray *) decode + data: (NSData *) data; @end diff --git a/Onyx2D/include/Onyx2D/O2PDFFunction_Type3.h b/Onyx2D/include/Onyx2D/O2PDFFunction_Type3.h index d1c1ce21..adf77365 100644 --- a/Onyx2D/include/Onyx2D/O2PDFFunction_Type3.h +++ b/Onyx2D/include/Onyx2D/O2PDFFunction_Type3.h @@ -32,9 +32,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithDomain: (O2PDFArray *) domain - range: (O2PDFArray *) range - functions: (NSArray *) functions - bounds: (O2PDFArray *) bounds - encode: (O2PDFArray *) encode; + range: (O2PDFArray *) range + functions: (NSArray *) functions + bounds: (O2PDFArray *) bounds + encode: (O2PDFArray *) encode; @end diff --git a/Onyx2D/include/Onyx2D/O2PDFFunction_Type4.h b/Onyx2D/include/Onyx2D/O2PDFFunction_Type4.h index 3b9e9e5c..83c88407 100644 --- a/Onyx2D/include/Onyx2D/O2PDFFunction_Type4.h +++ b/Onyx2D/include/Onyx2D/O2PDFFunction_Type4.h @@ -27,7 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithDomain: (O2PDFArray *) domain - range: (O2PDFArray *) range - calculator: (NSData *) calculator; + range: (O2PDFArray *) range + calculator: (NSData *) calculator; @end diff --git a/Onyx2D/include/Onyx2D/O2PDFScanner.h b/Onyx2D/include/Onyx2D/O2PDFScanner.h index 1b53233b..ca715809 100644 --- a/Onyx2D/include/Onyx2D/O2PDFScanner.h +++ b/Onyx2D/include/Onyx2D/O2PDFScanner.h @@ -26,7 +26,7 @@ typedef O2PDFScanner *O2PDFScannerRef; @class NSData, NSMutableArray; @class O2PDFContentStream, O2PDFOperatorTable; @class O2PDFString, O2PDFArray, O2PDFDictionary, O2PDFStream, O2PDFxref, - O2PDFObject_identifier; + O2PDFObject_identifier; BOOL O2PDFScanBackwardsByLines(const char *bytes, unsigned length, O2PDFInteger position, diff --git a/Onyx2D/include/Onyx2D/O2Paint_axialGradient.h b/Onyx2D/include/Onyx2D/O2Paint_axialGradient.h index c80add5f..170c8e67 100644 --- a/Onyx2D/include/Onyx2D/O2Paint_axialGradient.h +++ b/Onyx2D/include/Onyx2D/O2Paint_axialGradient.h @@ -34,6 +34,6 @@ } - initWithShading: (O2Shading *) shading - deviceTransform: (O2AffineTransform) deviceTransform; + deviceTransform: (O2AffineTransform) deviceTransform; @end diff --git a/Onyx2D/include/Onyx2D/O2Paint_color.h b/Onyx2D/include/Onyx2D/O2Paint_color.h index 1526738e..93334f3d 100644 --- a/Onyx2D/include/Onyx2D/O2Paint_color.h +++ b/Onyx2D/include/Onyx2D/O2Paint_color.h @@ -34,12 +34,12 @@ } - initWithGray: (O2Float) gray - alpha: (O2Float) alpha - surfaceToPaintTransform: (O2AffineTransform) transform; + alpha: (O2Float) alpha + surfaceToPaintTransform: (O2AffineTransform) transform; - initWithRed: (O2Float) red - green: (O2Float) green - blue: (O2Float) blue - alpha: (O2Float) alpha - surfaceToPaintTransform: (O2AffineTransform) transform; + green: (O2Float) green + blue: (O2Float) blue + alpha: (O2Float) alpha + surfaceToPaintTransform: (O2AffineTransform) transform; @end diff --git a/Onyx2D/include/Onyx2D/O2Paint_image.h b/Onyx2D/include/Onyx2D/O2Paint_image.h index e9b9718b..da9b60e8 100644 --- a/Onyx2D/include/Onyx2D/O2Paint_image.h +++ b/Onyx2D/include/Onyx2D/O2Paint_image.h @@ -37,11 +37,11 @@ } - initWithImage: (O2Image *) image - mask: (O2ImageRef) mask - mode: (O2SurfaceMode) mode - paint: (O2Paint *) paint - interpolationQuality: (O2InterpolationQuality) interpolationQuality - surfaceToImage: (O2AffineTransform) surfaceToImage - surfaceToMask: (O2AffineTransform) surfaceToMask; + mask: (O2ImageRef) mask + mode: (O2SurfaceMode) mode + paint: (O2Paint *) paint + interpolationQuality: (O2InterpolationQuality) interpolationQuality + surfaceToImage: (O2AffineTransform) surfaceToImage + surfaceToMask: (O2AffineTransform) surfaceToMask; @end diff --git a/Onyx2D/include/Onyx2D/O2Paint_pattern.h b/Onyx2D/include/Onyx2D/O2Paint_pattern.h index e87c418e..d8910f20 100644 --- a/Onyx2D/include/Onyx2D/O2Paint_pattern.h +++ b/Onyx2D/include/Onyx2D/O2Paint_pattern.h @@ -34,7 +34,7 @@ } - initWithImage: (O2Image *) image - surfaceToPaintTransform: (O2AffineTransform) xform - phase: (O2Size) phase; + surfaceToPaintTransform: (O2AffineTransform) xform + phase: (O2Size) phase; @end diff --git a/Onyx2D/include/Onyx2D/O2Paint_radialGradient.h b/Onyx2D/include/Onyx2D/O2Paint_radialGradient.h index 6061e862..187044a3 100644 --- a/Onyx2D/include/Onyx2D/O2Paint_radialGradient.h +++ b/Onyx2D/include/Onyx2D/O2Paint_radialGradient.h @@ -33,6 +33,6 @@ } - initWithShading: (O2Shading *) shading - deviceTransform: (O2AffineTransform) deviceTransform; + deviceTransform: (O2AffineTransform) deviceTransform; @end diff --git a/Onyx2D/include/Onyx2D/O2Paint_ramp.h b/Onyx2D/include/Onyx2D/O2Paint_ramp.h index ff4c40fa..9a83ca28 100644 --- a/Onyx2D/include/Onyx2D/O2Paint_ramp.h +++ b/Onyx2D/include/Onyx2D/O2Paint_ramp.h @@ -51,7 +51,7 @@ O2argb32f O2PaintColorRamp(O2Paint_ramp *self, O2Float gradient, O2Float rho, int *skip); - initWithShading: (O2Shading *) shading - deviceTransform: (O2AffineTransform) deviceTransform - numberOfSamples: (int) numberOfSamples; + deviceTransform: (O2AffineTransform) deviceTransform + numberOfSamples: (int) numberOfSamples; @end diff --git a/Onyx2D/include/Onyx2D/O2Path.h b/Onyx2D/include/Onyx2D/O2Path.h index 32cccd0f..a4cbea4d 100644 --- a/Onyx2D/include/Onyx2D/O2Path.h +++ b/Onyx2D/include/Onyx2D/O2Path.h @@ -53,9 +53,9 @@ typedef void (*O2PathApplierFunction)(void *info, const O2PathElement *element); } - initWithOperators: (unsigned char *) elements - numberOfElements: (size_t) numberOfElements - points: (O2Point *) points - numberOfPoints: (size_t) numberOfPoints; + numberOfElements: (size_t) numberOfElements + points: (O2Point *) points + numberOfPoints: (size_t) numberOfPoints; // internal id O2PathInitWithOperators(O2Path *self, unsigned char *elements, diff --git a/Onyx2D/include/Onyx2D/O2Surface.h b/Onyx2D/include/Onyx2D/O2Surface.h index 7b286d0b..e0bbd161 100644 --- a/Onyx2D/include/Onyx2D/O2Surface.h +++ b/Onyx2D/include/Onyx2D/O2Surface.h @@ -73,18 +73,18 @@ typedef void (*O2SurfaceWriteSpan_argb32f)(O2Surface *self, int x, int y, } - initWithBytes: (void *) bytes - width: (size_t) width - height: (size_t) height - bitsPerComponent: (size_t) bitsPerComponent - bytesPerRow: (size_t) bytesPerRow - colorSpace: (O2ColorSpaceRef) colorSpace - bitmapInfo: (O2BitmapInfo) bitmapInfo; + width: (size_t) width + height: (size_t) height + bitsPerComponent: (size_t) bitsPerComponent + bytesPerRow: (size_t) bytesPerRow + colorSpace: (O2ColorSpaceRef) colorSpace + bitmapInfo: (O2BitmapInfo) bitmapInfo; - (void *) pixelBytes; - (void) setWidth: (size_t) width - height: (size_t) height - reallocateOnlyIfRequired: (BOOL) roir; + height: (size_t) height + reallocateOnlyIfRequired: (BOOL) roir; void *O2SurfaceGetPixelBytes(O2Surface *surface); size_t O2SurfaceGetWidth(O2Surface *surface); diff --git a/Onyx2D/platform_Windows/O2Context_builtin_gdi.m b/Onyx2D/platform_Windows/O2Context_builtin_gdi.m index 9fc0c216..951da4dc 100644 --- a/Onyx2D/platform_Windows/O2Context_builtin_gdi.m +++ b/Onyx2D/platform_Windows/O2Context_builtin_gdi.m @@ -274,10 +274,10 @@ static void drawFreeTypeBitmap(O2Context_builtin_gdi *self, O2Surface *surface, CGFloat fpy, O2Paint *paint) { drawGray8Stencil( - self, surface, fpx, fpy, paint, O2GlyphStencilGetCoverage(stencil), - O2GlyphStencilGetWidth(stencil), O2GlyphStencilGetWidth(stencil), - O2GlyphStencilGetHeight(stencil), O2GlyphStencilGetLeft(stencil), - O2GlyphStencilGetTop(stencil)); + self, surface, fpx, fpy, paint, O2GlyphStencilGetCoverage(stencil), + O2GlyphStencilGetWidth(stencil), O2GlyphStencilGetWidth(stencil), + O2GlyphStencilGetHeight(stencil), O2GlyphStencilGetLeft(stencil), + O2GlyphStencilGetTop(stencil)); } #endif @@ -303,9 +303,9 @@ static inline void cacheStencilForGlyphIndex(O2Context_builtin_gdi *self, while (glyph >= self->_glyphCacheCount) self->_glyphCacheCount *= 2; - self->_glyphCache = - NSZoneRealloc(NULL, self->_glyphCache, - sizeof(O2GlyphStencilRef) * self->_glyphCacheCount); + self->_glyphCache = NSZoneRealloc(NULL, self->_glyphCache, + sizeof(O2GlyphStencilRef) * + self->_glyphCacheCount); for (; count < self->_glyphCacheCount; count++) self->_glyphCache[count] = NULL; @@ -338,9 +338,9 @@ static inline void purgeGlyphCache(O2Context_builtin_gdi *self) { float scaleX = sqrt((Trm.a * Trm.a) + (Trm.c * Trm.c)); float scaleY = sqrt((Trm.b * Trm.b) + (Trm.d * Trm.d)); O2AffineTransform scalingTransform = - O2AffineTransformMakeScale(scaleX, scaleY); + O2AffineTransformMakeScale(scaleX, scaleY); O2Size fontSize = O2SizeApplyAffineTransform( - O2SizeMake(0, O2GStatePointSize(gState)), scalingTransform); + O2SizeMake(0, O2GStatePointSize(gState)), scalingTransform); int i; O2Size defaultAdvances[count]; @@ -497,9 +497,9 @@ static inline void purgeGlyphCache(O2Context_builtin_gdi *self) { // Rotate the font according to the current transform O2Float32 angle = atan2(-Trm.b, Trm.a); self->_gdiFont = [(O2Font_gdi *) font - createGDIFontSelectedInDC: context->_dc - pointSize: ABS(fontSize.height) - angle: angle]; + createGDIFontSelectedInDC: context->_dc + pointSize: ABS(fontSize.height) + angle: angle]; } SelectObject(context->_dc, [self->_gdiFont fontHandle]); SetTextColor(context->_dc, COLORREFFromColor(O2ContextFillColor(self))); @@ -520,8 +520,8 @@ static inline void purgeGlyphCache(O2Context_builtin_gdi *self) { float previousEnd = lroundf(point.x); for (int i = 0; i < count; i++) { float delta = - O2SizeApplyAffineTransform(usedAdvances[i], Trm).width + - gState->_characterSpacing; + O2SizeApplyAffineTransform(usedAdvances[i], Trm).width + + gState->_characterSpacing; total += delta; dx[i] = lroundf(total - previousEnd); previousEnd += dx[i]; @@ -580,8 +580,9 @@ static inline void purgeGlyphCache(O2Context_builtin_gdi *self) { continue; } stencil = O2GlyphStencilCreate( - slot->bitmap.width, slot->bitmap.rows, slot->bitmap.buffer, - slot->bitmap.width, slot->bitmap_left, slot->bitmap_top); + slot->bitmap.width, slot->bitmap.rows, + slot->bitmap.buffer, slot->bitmap.width, + slot->bitmap_left, slot->bitmap_top); cacheStencilForGlyphIndex(self, glyphs[i], stencil); } @@ -591,8 +592,8 @@ static inline void purgeGlyphCache(O2Context_builtin_gdi *self) { if (advances != NULL) point.x += O2SizeApplyAffineTransform(advances[i], Trm).width; else { - point.x += - O2SizeApplyAffineTransform(defaultAdvances[i], Trm).width; + point.x += O2SizeApplyAffineTransform(defaultAdvances[i], Trm) + .width; // point.x+=slot->advance.x >> 6; } } @@ -617,7 +618,7 @@ static inline BOOL transformIsFlipped(O2AffineTransform matrix) { - (NSData *) captureBitmapInRect: (NSRect) rect { O2AffineTransform transformToDevice = - O2ContextGetUserSpaceToDeviceSpaceTransform(self); + O2ContextGetUserSpaceToDeviceSpaceTransform(self); NSPoint pt = O2PointApplyAffineTransform(rect.origin, transformToDevice); int width = rect.size.width; int height = rect.size.height; @@ -663,12 +664,12 @@ static inline BOOL transformIsFlipped(O2AffineTransform matrix) { for (i = 3; i < bmSize; i += 4) ((char *) bmBits)[i] = 255; // set alpha value bmFileHeader.bfOffBits = - sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); bmFileHeader.bfSize = bmFileHeader.bfOffBits + bmSize; NSMutableData *result = - [NSMutableData dataWithBytes: &bmFileHeader - length: sizeof(BITMAPFILEHEADER)]; + [NSMutableData dataWithBytes: &bmFileHeader + length: sizeof(BITMAPFILEHEADER)]; [result appendBytes: &bmInfo.bmiHeader length: sizeof(BITMAPINFOHEADER)]; [result appendBytes: bmBits length: bmSize]; diff --git a/Onyx2D/platform_Windows/O2Context_gdi.m b/Onyx2D/platform_Windows/O2Context_gdi.m index 242d1e04..131899ec 100644 --- a/Onyx2D/platform_Windows/O2Context_gdi.m +++ b/Onyx2D/platform_Windows/O2Context_gdi.m @@ -47,7 +47,7 @@ static inline BOOL transformIsFlipped(O2AffineTransform matrix) { static NSRect Win32TransformRect(O2AffineTransform matrix, NSRect rect) { NSPoint point1 = O2PointApplyAffineTransform(rect.origin, matrix); NSPoint point2 = O2PointApplyAffineTransform( - NSMakePoint(NSMaxX(rect), NSMaxY(rect)), matrix); + NSMakePoint(NSMaxX(rect), NSMaxY(rect)), matrix); if (point2.y < point1.y) { float temp = point2.y; @@ -226,7 +226,7 @@ static RECT NSRectToRECT(NSRect rect) { NSLog(@"ModifyWorldTransform failed"); O2DeviceContextEstablishDeviceSpacePath_gdi( - _dc, path, O2AffineTransformInvert(state->_userSpaceTransform)); + _dc, path, O2AffineTransformInvert(state->_userSpaceTransform)); { HBRUSH fillBrush = CreateSolidBrush(COLORREFFromColor(fillColor)); @@ -319,8 +319,8 @@ static RECT NSRectToRECT(NSRect rect) { O2GStateClearFontIsDirty(gState); [_gdiFont release]; _gdiFont = [(O2Font_gdi *) O2GStateFont(gState) - createGDIFontSelectedInDC: _dc - pointSize: O2GStatePointSize(gState)]; + createGDIFontSelectedInDC: _dc + pointSize: O2GStatePointSize(gState)]; } } @@ -330,10 +330,10 @@ static RECT NSRectToRECT(NSRect rect) { { // FIXME: use advances if not NULL O2AffineTransform transformToDevice = - O2ContextGetUserSpaceToDeviceSpaceTransform(self); + O2ContextGetUserSpaceToDeviceSpaceTransform(self); O2GState *gState = O2ContextCurrentGState(self); O2AffineTransform Trm = - O2AffineTransformConcat(_textMatrix, transformToDevice); + O2AffineTransformConcat(_textMatrix, transformToDevice); NSPoint point = O2PointApplyAffineTransform(NSMakePoint(0, 0), Trm); [self establishFontStateInDeviceIfDirty]; @@ -412,21 +412,20 @@ static inline float axialBandIntervalFromMagnitude(O2Function *function, BOOL extendStart = [shading extendStart]; BOOL extendEnd = [shading extendEnd]; NSPoint startPoint = - O2PointApplyAffineTransform([shading startPoint], matrix); + O2PointApplyAffineTransform([shading startPoint], matrix); NSPoint endPoint = O2PointApplyAffineTransform([shading endPoint], matrix); NSPoint vector = - NSMakePoint(endPoint.x - startPoint.x, endPoint.y - startPoint.y); + NSMakePoint(endPoint.x - startPoint.x, endPoint.y - startPoint.y); float magnitude = ceilf(sqrtf(vector.x * vector.x + vector.y * vector.y)); - float angle = - (magnitude == 0) - ? 0 - : (atanf(vector.y / vector.x) + ((vector.x < 0) ? M_PI : 0)); + float angle = (magnitude == 0) ? 0 + : (atanf(vector.y / vector.x) + + ((vector.x < 0) ? M_PI : 0)); float bandInterval = axialBandIntervalFromMagnitude(function, magnitude); int bandCount = bandInterval; int i, rectIndex = 0; float rectWidth = (bandCount == 0) ? 0 : magnitude / bandInterval; float domainInterval = - (bandCount == 0) ? 0 : (domain[1] - domain[0]) / bandInterval; + (bandCount == 0) ? 0 : (domain[1] - domain[0]) / bandInterval; GRADIENT_RECT rect[1 + bandCount + 1]; int vertexIndex = 0; TRIVERTEX vertices[(1 + bandCount + 1) * 2]; @@ -443,7 +442,7 @@ static inline float axialBandIntervalFromMagnitude(O2Function *function, ULONG, ULONG); HANDLE library = LoadLibrary("MSIMG32"); gradientType gradientFill = - (gradientType) GetProcAddress(library, "GradientFill"); + (gradientType) GetProcAddress(library, "GradientFill"); if (gradientFill == NULL) { NSLog(@"Unable to locate GradientFill"); @@ -586,7 +585,7 @@ static int appendCircle(NSPoint *cp, int position, float x, float y, O2MutablePathEllipseToBezier(cp + position, x, y, radius, radius); for (i = 0; i < 13; i++) cp[position + i] = - O2PointApplyAffineTransform(cp[position + i], matrix); + O2PointApplyAffineTransform(cp[position + i], matrix); return position + 13; } @@ -626,13 +625,13 @@ static inline float numberOfRadialBands(O2Function *function, startRadiusPoint = O2PointApplyAffineTransform(startRadiusPoint, matrix); endRadiusPoint = O2PointApplyAffineTransform(endRadiusPoint, matrix); { - NSPoint lineVector = - NSMakePoint(endPoint.x - startPoint.x, endPoint.y - startPoint.y); - float lineMagnitude = ceilf( - sqrtf(lineVector.x * lineVector.x + lineVector.y * lineVector.y)); + NSPoint lineVector = NSMakePoint(endPoint.x - startPoint.x, + endPoint.y - startPoint.y); + float lineMagnitude = ceilf(sqrtf(lineVector.x * lineVector.x + + lineVector.y * lineVector.y)); NSPoint radiusVector = - NSMakePoint(endRadiusPoint.x - startRadiusPoint.x, - endRadiusPoint.y - startRadiusPoint.y); + NSMakePoint(endRadiusPoint.x - startRadiusPoint.x, + endRadiusPoint.y - startRadiusPoint.y); float radiusMagnitude = ceilf(sqrtf(radiusVector.x * radiusVector.x + radiusVector.y * radiusVector.y)) * 2; @@ -682,10 +681,10 @@ static void extend(HDC dc, int i, int direction, float bandInterval, // accurately but these are undesirable gradients { - NSPoint lineVector = - NSMakePoint(endPoint.x - startPoint.x, endPoint.y - startPoint.y); - float lineMagnitude = ceilf( - sqrtf(lineVector.x * lineVector.x + lineVector.y * lineVector.y)); + NSPoint lineVector = NSMakePoint(endPoint.x - startPoint.x, + endPoint.y - startPoint.y); + float lineMagnitude = ceilf(sqrtf(lineVector.x * lineVector.x + + lineVector.y * lineVector.y)); if ((lineMagnitude + startRadius) < endRadius) { BeginPath(dc); @@ -782,7 +781,7 @@ static void extend(HDC dc, int i, int direction, float bandInterval, startRadius, endRadius, matrix); int i, bandCount = bandInterval; float domainInterval = - (bandCount == 0) ? 0 : (domain[1] - domain[0]) / bandInterval; + (bandCount == 0) ? 0 : (domain[1] - domain[0]) / bandInterval; float output[O2ColorSpaceGetNumberOfComponents(colorSpace) + 1]; float rgba[4]; void (*outputToRGBA)(float *, float *); @@ -811,8 +810,8 @@ static void extend(HDC dc, int i, int direction, float bandInterval, O2FunctionEvaluate(function, domain[0], output); outputToRGBA(output, rgba); - brush = - CreateSolidBrush(RGB(rgba[0] * 255, rgba[1] * 255, rgba[2] * 255)); + brush = CreateSolidBrush( + RGB(rgba[0] * 255, rgba[1] * 255, rgba[2] * 255)); SelectObject(_dc, brush); SetPolyFillMode(_dc, ALTERNATE); extend(_dc, 0, -1, bandInterval, startPoint, endPoint, startRadius, @@ -850,7 +849,7 @@ static void extend(HDC dc, int i, int direction, float bandInterval, O2FunctionEvaluate(function, x0, output); outputToRGBA(output, rgba); brush = CreateSolidBrush( - RGB(output[0] * 255, output[1] * 255, output[2] * 255)); + RGB(output[0] * 255, output[1] * 255, output[2] * 255)); SelectObject(_dc, brush); SetPolyFillMode(_dc, ALTERNATE); FillPath(_dc); @@ -862,8 +861,8 @@ static void extend(HDC dc, int i, int direction, float bandInterval, O2FunctionEvaluate(function, domain[1], output); outputToRGBA(output, rgba); - brush = - CreateSolidBrush(RGB(rgba[0] * 255, rgba[1] * 255, rgba[2] * 255)); + brush = CreateSolidBrush( + RGB(rgba[0] * 255, rgba[1] * 255, rgba[2] * 255)); SelectObject(_dc, brush); SetPolyFillMode(_dc, ALTERNATE); extend(_dc, i, 1, bandInterval, startPoint, endPoint, startRadius, @@ -875,7 +874,7 @@ static void extend(HDC dc, int i, int direction, float bandInterval, - (void) drawShading: (O2ShadingRef) shading { O2AffineTransform transformToDevice = - O2ContextGetUserSpaceToDeviceSpaceTransform(self); + O2ContextGetUserSpaceToDeviceSpaceTransform(self); if ([shading isAxial]) [self drawInUserSpace: transformToDevice axialShading: shading]; @@ -1033,12 +1032,14 @@ void O2GraphicsSourceOver_bgra32_onto_bgrx32(unsigned char *sourceBGRA, #if 1 if ((O2ImageGetAlphaInfo(image) == kO2ImageAlphaPremultipliedFirst) && (O2ImageGetBitmapInfo(image) & kO2BitmapByteOrderMask) == - kO2BitmapByteOrder32Little) - O2GraphicsSourceOver_bgra32_onto_bgrx32( - imageRGBA, (unsigned char *) combineBGRX, width, height, fraction); + kO2BitmapByteOrder32Little) + O2GraphicsSourceOver_bgra32_onto_bgrx32(imageRGBA, + (unsigned char *) combineBGRX, + width, height, fraction); else - O2GraphicsSourceOver_rgba32_onto_bgrx32( - imageRGBA, (unsigned char *) combineBGRX, width, height, fraction); + O2GraphicsSourceOver_rgba32_onto_bgrx32(imageRGBA, + (unsigned char *) combineBGRX, + width, height, fraction); #else sourceOverImage(image, combineBGRX, width, height, fraction); #endif @@ -1130,12 +1131,13 @@ static void zeroBytes(void *bytes, int size) { blendFunction.BlendFlags = 0; blendFunction.SourceConstantAlpha = 0xFF; blendFunction.BlendOp = AC_SRC_ALPHA; { - typedef WINGDIAPI BOOL WINAPI (*alphaType)( - HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION); + typedef WINGDIAPI BOOL WINAPI (*alphaType)(HDC, int, int, int, int, HDC, + int, int, int, int, + BLENDFUNCTION); HANDLE library = LoadLibrary("MSIMG32"); alphaType alphaBlend = - (alphaType) GetProcAddress(library, "AlphaBlend"); + (alphaType) GetProcAddress(library, "AlphaBlend"); if (alphaBlend == NULL) NSLog(@"Unable to get AlphaBlend", alphaBlend); @@ -1155,7 +1157,7 @@ static void zeroBytes(void *bytes, int size) { - (void) drawImage: (O2Image *) image inRect: (O2Rect) rect { O2AffineTransform transformToDevice = - O2ContextGetUserSpaceToDeviceSpaceTransform(self); + O2ContextGetUserSpaceToDeviceSpaceTransform(self); O2GState *gState = O2ContextCurrentGState(self); O2ClipPhase *phase = [[O2GStateClipState(gState) clipPhases] lastObject]; @@ -1206,12 +1208,12 @@ static void zeroBytes(void *bytes, int size) { return; } O2DeviceContext_gdi *deviceContext = - [(O2Context_gdi *) context deviceContext]; + [(O2Context_gdi *) context deviceContext]; - [self - drawDeviceContext: deviceContext - inRect: rect - ctm: O2ContextCurrentGState(self)->_deviceSpaceTransform]; + [self drawDeviceContext: deviceContext + inRect: rect + ctm: O2ContextCurrentGState(self)-> + _deviceSpaceTransform]; } - (void) copyBitsInRect: (NSRect) rect @@ -1219,11 +1221,11 @@ static void zeroBytes(void *bytes, int size) { gState: (int) gState { O2AffineTransform transformToDevice = - O2ContextGetUserSpaceToDeviceSpaceTransform(self); + O2ContextGetUserSpaceToDeviceSpaceTransform(self); NSRect srcRect = Win32TransformRect(transformToDevice, rect); NSRect dstRect = Win32TransformRect( - transformToDevice, - NSMakeRect(point.x, point.y, rect.size.width, rect.size.height)); + transformToDevice, + NSMakeRect(point.x, point.y, rect.size.width, rect.size.height)); NSRect scrollRect = NSUnionRect(srcRect, dstRect); int dx = dstRect.origin.x - srcRect.origin.x; int dy = dstRect.origin.y - srcRect.origin.y; @@ -1259,7 +1261,7 @@ static void zeroBytes(void *bytes, int size) { - (NSData *) captureBitmapInRect: (NSRect) rect { O2AffineTransform transformToDevice = - O2ContextGetUserSpaceToDeviceSpaceTransform(self); + O2ContextGetUserSpaceToDeviceSpaceTransform(self); NSPoint pt = O2PointApplyAffineTransform(rect.origin, transformToDevice); int width = rect.size.width; int height = rect.size.height; @@ -1305,12 +1307,12 @@ static void zeroBytes(void *bytes, int size) { for (i = 3; i < bmSize; i += 4) ((char *) bmBits)[i] = 255; // set alpha value bmFileHeader.bfOffBits = - sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); bmFileHeader.bfSize = bmFileHeader.bfOffBits + bmSize; NSMutableData *result = - [NSMutableData dataWithBytes: &bmFileHeader - length: sizeof(BITMAPFILEHEADER)]; + [NSMutableData dataWithBytes: &bmFileHeader + length: sizeof(BITMAPFILEHEADER)]; [result appendBytes: &bmInfo.bmiHeader length: sizeof(BITMAPINFOHEADER)]; [result appendBytes: bmBits length: bmSize]; diff --git a/Onyx2D/platform_Windows/O2DeviceContext_gdi.m b/Onyx2D/platform_Windows/O2DeviceContext_gdi.m index 5f521b77..b665d4b4 100644 --- a/Onyx2D/platform_Windows/O2DeviceContext_gdi.m +++ b/Onyx2D/platform_Windows/O2DeviceContext_gdi.m @@ -85,29 +85,29 @@ void O2DeviceContextEstablishDeviceSpacePath_gdi(HDC dc, O2Path *path, case kO2PathElementMoveToPoint: { NSPoint point = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); MoveToEx(dc, float2int(point.x), float2int(point.y), NULL); } break; case kO2PathElementAddLineToPoint: { NSPoint point = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); LineTo(dc, float2int(point.x), float2int(point.y)); } break; case kO2PathElementAddCurveToPoint: { NSPoint cp1 = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); NSPoint cp2 = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); NSPoint end = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); POINT points[3] = { - {float2int(cp1.x), float2int(cp1.y)}, - {float2int(cp2.x), float2int(cp2.y)}, - {float2int(end.x), float2int(end.y)}, + {float2int(cp1.x), float2int(cp1.y)}, + {float2int(cp2.x), float2int(cp2.y)}, + {float2int(end.x), float2int(end.y)}, }; PolyBezierTo(dc, points, 3); @@ -116,14 +116,14 @@ void O2DeviceContextEstablishDeviceSpacePath_gdi(HDC dc, O2Path *path, // FIX, this is wrong case kO2PathElementAddQuadCurveToPoint: { NSPoint cp1 = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); NSPoint cp2 = - O2PointApplyAffineTransform(points[pointIndex++], xform); + O2PointApplyAffineTransform(points[pointIndex++], xform); NSPoint end = cp2; POINT points[3] = { - {float2int(cp1.x), float2int(cp1.y)}, - {float2int(cp2.x), float2int(cp2.y)}, - {float2int(end.x), float2int(end.y)}, + {float2int(cp1.x), float2int(cp1.y)}, + {float2int(cp2.x), float2int(cp2.y)}, + {float2int(end.x), float2int(end.y)}, }; PolyBezierTo(dc, points, 3); diff --git a/Onyx2D/platform_Windows/O2DeviceContext_gdiDIBSection.h b/Onyx2D/platform_Windows/O2DeviceContext_gdiDIBSection.h index 691d4678..d442b300 100644 --- a/Onyx2D/platform_Windows/O2DeviceContext_gdiDIBSection.h +++ b/Onyx2D/platform_Windows/O2DeviceContext_gdiDIBSection.h @@ -33,8 +33,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ height: (size_t) height deviceContext: (O2DeviceContext_gdi *) compatible; - initGray8WithWidth: (size_t) width - height: (size_t) height - deviceContext: (O2DeviceContext_gdi *) compatible; + height: (size_t) height + deviceContext: (O2DeviceContext_gdi *) compatible; - (void *) bitmapBytes; diff --git a/Onyx2D/platform_Windows/O2DeviceContext_gdiDIBSection.m b/Onyx2D/platform_Windows/O2DeviceContext_gdiDIBSection.m index 6947156a..b2f4052c 100644 --- a/Onyx2D/platform_Windows/O2DeviceContext_gdiDIBSection.m +++ b/Onyx2D/platform_Windows/O2DeviceContext_gdiDIBSection.m @@ -23,9 +23,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation O2DeviceContext_gdiDIBSection - initWithWidth: (size_t) width - height: (size_t) height - deviceContext: (O2DeviceContext_gdi *) compatible - bitsPerPixel: (int) bpp + height: (size_t) height + deviceContext: (O2DeviceContext_gdi *) compatible + bitsPerPixel: (int) bpp { HDC compatibleDC = (compatible != nil) ? [compatible dc] : GetDC(NULL); @@ -83,8 +83,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initGray8WithWidth: (size_t) width - height: (size_t) height - deviceContext: (O2DeviceContext_gdi *) compatible + height: (size_t) height + deviceContext: (O2DeviceContext_gdi *) compatible { HDC compatibleDC = (compatible != nil) ? [compatible dc] : GetDC(NULL); diff --git a/Onyx2D/platform_Windows/O2Font_gdi.m b/Onyx2D/platform_Windows/O2Font_gdi.m index 39f0c2df..03c65125 100644 --- a/Onyx2D/platform_Windows/O2Font_gdi.m +++ b/Onyx2D/platform_Windows/O2Font_gdi.m @@ -49,10 +49,10 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, // CreateFontIndirectW with the received logFont For some mysterious reason, // CreateFontIndirectW is returning the wrong font for some faces like // "Minya Nouvelle Italic" (the Regular version is returned instead) - HFONT font = - CreateFontW(0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, - OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, - DEFAULT_PITCH | FF_DONTCARE, logFont->elfFullName); + HFONT font = CreateFontW(0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, + DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, + CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, + DEFAULT_PITCH | FF_DONTCARE, logFont->elfFullName); if (font) { // Ignore fonts for which we can't get a full name @@ -67,7 +67,7 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, // Get the full face name - on Win8, this is a localized name NSString *winName = - [NSString stringWithFormat: @"%S", logFont->elfFullName]; + [NSString stringWithFormat: @"%S", logFont->elfFullName]; if (winName.length == 0) { if (logFont->elfLogFont.lfFaceName) { NSLog(@"Empty full name for face name %S", @@ -94,7 +94,7 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, // Get the PS name for the font... DWORD bufferSize = - GetFontData(dc, CFSwapInt32HostToBig('name'), 0, NULL, 0); + GetFontData(dc, CFSwapInt32HostToBig('name'), 0, NULL, 0); if (bufferSize >= 6 && bufferSize != GDI_ERROR) { uint8_t buffer[bufferSize]; bzero(buffer, 6); @@ -103,29 +103,29 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, name_table_header_t *header = (name_table_header_t *) buffer; uint16_t count = CFSwapInt16BigToHost(header->count); uint16_t stringsOffset = - CFSwapInt16BigToHost(header->stringOffset); + CFSwapInt16BigToHost(header->stringOffset); if (bufferSize > stringsOffset) { uint8_t *strings = buffer + stringsOffset; name_records_t *nameRecords = - (name_records_t *) (buffer + - sizeof(name_table_header_t)); + (name_records_t *) (buffer + + sizeof(name_table_header_t)); // Parse all of the name records until we find a US full // name there so we can have both the US name and the // localized name in the font name -> PS name table NSString *fontNameUS = nil; for (int i = 0; i < count; i++) { uint16_t platformID = - CFSwapInt16BigToHost(nameRecords[i].platformID); + CFSwapInt16BigToHost(nameRecords[i].platformID); uint16_t platformSpecificID = CFSwapInt16BigToHost( - nameRecords[i].platformSpecificID); + nameRecords[i].platformSpecificID); uint16_t languageID = - CFSwapInt16BigToHost(nameRecords[i].languageID); + CFSwapInt16BigToHost(nameRecords[i].languageID); uint16_t nameID = - CFSwapInt16BigToHost(nameRecords[i].nameID); + CFSwapInt16BigToHost(nameRecords[i].nameID); uint16_t length = - CFSwapInt16BigToHost(nameRecords[i].length); + CFSwapInt16BigToHost(nameRecords[i].length); uint16_t offset = - CFSwapInt16BigToHost(nameRecords[i].offset); + CFSwapInt16BigToHost(nameRecords[i].offset); // Full name, US language if (nameID == 4 && languageID == 0x0409) { // First check we get a string that's in our buffer, @@ -140,10 +140,11 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, platformSpecificID == 1) { // Win name - unicode encoding NSString *name = [[[NSString alloc] - initWithBytes: strings + offset - length: length - encoding: NSUnicodeStringEncoding] - autorelease]; + initWithBytes: strings + offset + length: length + encoding: + NSUnicodeStringEncoding] + autorelease]; if ([name length]) { if (![winName isEqualToString: name]) { fontNameUS = name; @@ -154,8 +155,8 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, platformSpecificID == 0) { // Mac name - ASCII NSString *name = [NSString - stringWithCString: strings + offset - length: length]; + stringWithCString: strings + offset + length: length]; if ([name length]) { if (![winName isEqualToString: name]) { fontNameUS = name; @@ -171,17 +172,17 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, // there for (int i = 0; i < count; i++) { uint16_t platformID = - CFSwapInt16BigToHost(nameRecords[i].platformID); + CFSwapInt16BigToHost(nameRecords[i].platformID); uint16_t platformSpecificID = CFSwapInt16BigToHost( - nameRecords[i].platformSpecificID); + nameRecords[i].platformSpecificID); uint16_t languageID = - CFSwapInt16BigToHost(nameRecords[i].languageID); + CFSwapInt16BigToHost(nameRecords[i].languageID); uint16_t nameID = - CFSwapInt16BigToHost(nameRecords[i].nameID); + CFSwapInt16BigToHost(nameRecords[i].nameID); uint16_t length = - CFSwapInt16BigToHost(nameRecords[i].length); + CFSwapInt16BigToHost(nameRecords[i].length); uint16_t offset = - CFSwapInt16BigToHost(nameRecords[i].offset); + CFSwapInt16BigToHost(nameRecords[i].offset); if (nameID == 6) { // First check we get a string that's in our buffer, // in case of some corrupted font or font entry @@ -196,10 +197,11 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, platformSpecificID == 1) { // Win PS name - unicode encoding NSString *name = [[[NSString alloc] - initWithBytes: strings + offset - length: length - encoding: NSUnicodeStringEncoding] - autorelease]; + initWithBytes: strings + offset + length: length + encoding: + NSUnicodeStringEncoding] + autorelease]; if ([name length]) { // It seems some users have some // corrupted font table - NEVER replace @@ -207,14 +209,14 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, // isn't some kind of arial if (!([name hasPrefix: @"Arial"] && [winName rangeOfString: @"Arial"] - .location == - NSNotFound)) { + .location == + NSNotFound)) { [sPSToWin32Table setObject: winName forKey: name]; } else { - NSLog( - @"Skipping matching %@ with %@", - name, winName); + NSLog(@"Skipping matching %@ with " + @"%@", + name, winName); } [sWin32ToPSTable setObject: name forKey: winName]; @@ -222,8 +224,8 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, // Add the US font name -> PS // mapping [sWin32ToPSTable - setObject: name - forKey: fontNameUS]; + setObject: name + forKey: fontNameUS]; } } break; @@ -231,8 +233,8 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, platformSpecificID == 0) { // Mac PS name - ASCII NSString *name = [NSString - stringWithCString: strings + offset - length: length]; + stringWithCString: strings + offset + length: length]; if ([name length]) { // It seems some users have some // corrupted font table - NEVER replace @@ -240,14 +242,14 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, // isn't some kind of arial if (!([name hasPrefix: @"Arial"] && [winName rangeOfString: @"Arial"] - .location == - NSNotFound)) { + .location == + NSNotFound)) { [sPSToWin32Table setObject: winName forKey: name]; } else { - NSLog( - @"Skipping matching %@ with %@", - name, winName); + NSLog(@"Skipping matching %@ with " + @"%@", + name, winName); } [sWin32ToPSTable setObject: name forKey: winName]; @@ -255,8 +257,8 @@ static int CALLBACK EnumFontFromFamilyCallBack(const EXTLOGFONTW *logFont, // Add the US font name -> PS // mapping [sWin32ToPSTable - setObject: name - forKey: fontNameUS]; + setObject: name + forKey: fontNameUS]; } } break; @@ -280,7 +282,7 @@ static int CALLBACK EnumFamiliesCallBackW(const EXTLOGFONTW *logFont, { NSMutableSet *families = (NSMutableSet *) p; NSString *winName = - [NSString stringWithFormat: @"%S", logFont->elfLogFont.lfFaceName]; + [NSString stringWithFormat: @"%S", logFont->elfLogFont.lfFaceName]; [families addObject: winName]; return 1; @@ -388,26 +390,26 @@ static int CALLBACK EnumFamiliesCallBackW(const EXTLOGFONTW *logFont, + (void) initialize { if (self == [O2Font_gdi class]) { // Set some decent defaut substitution fonts - [O2Font - setPreferredFontNames: - [NSArray arrayWithObjects: @"Arial", // Latin/Greek/Cyrillic, - // Arabic, Hebrew - @"Meiryo", // Japanese - @"FangSong", // Simplified Chinese - @"MingLiU", // Traditional Chinese - @"Batang", // Korean - nil]]; + [O2Font setPreferredFontNames: + [NSArray arrayWithObjects: + @"Arial", // Latin/Greek/Cyrillic, + // Arabic, Hebrew + @"Meiryo", // Japanese + @"FangSong", // Simplified Chinese + @"MingLiU", // Traditional Chinese + @"Batang", // Korean + nil]]; } } static HFONT Win32FontHandleWithName(NSString *name, int unitsPerEm) { - const unichar *wideName = - (const unichar *) [name cStringUsingEncoding: NSUnicodeStringEncoding]; + const unichar *wideName = (const unichar *) [name + cStringUsingEncoding: NSUnicodeStringEncoding]; O2FontLog(@"Creating font with name: %@ unitsPerEm: %d", name, unitsPerEm); - HFONT result = - CreateFontW(-unitsPerEm, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, - DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, - DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, wideName); + HFONT result = CreateFontW(-unitsPerEm, 0, 0, 0, FW_NORMAL, FALSE, FALSE, + FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, + CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, + DEFAULT_PITCH | FF_DONTCARE, wideName); if (result == NULL) { O2FontLog(@"CreateFontW failed"); } @@ -552,7 +554,7 @@ static HFONT Win32FontHandleWithName(NSString *name, int unitsPerEm) { DWORD numberOfFonts = 1; _fontMemResource = - AddFontMemResourceEx((PVOID) bytes, length, 0, &numberOfFonts); + AddFontMemResourceEx((PVOID) bytes, length, 0, &numberOfFonts); NSLog(@"FAILURE AddFontMemResourceEx bytes=%p length=%d " @"numberOfFonts=%d,result=%x", bytes, length, numberOfFonts, _fontMemResource); @@ -831,8 +833,8 @@ static HFONT Win32FontHandleWithName(NSString *name, int unitsPerEm) { } - (NSString *) description { - return - [NSString stringWithFormat: @"%@ name: %@", [super description], _name]; + return [NSString + stringWithFormat: @"%@ name: %@", [super description], _name]; } @end diff --git a/Onyx2D/platform_Windows/O2Surface_DIBSection.h b/Onyx2D/platform_Windows/O2Surface_DIBSection.h index 45256a59..4f16bdf9 100644 --- a/Onyx2D/platform_Windows/O2Surface_DIBSection.h +++ b/Onyx2D/platform_Windows/O2Surface_DIBSection.h @@ -25,8 +25,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithWidth: (int) width - height: (int) height - compatibleWithDeviceContext: (O2DeviceContext_gdi *) compatible; + height: (int) height + compatibleWithDeviceContext: (O2DeviceContext_gdi *) compatible; - (O2DeviceContext_gdi *) deviceContext; diff --git a/Onyx2D/platform_Windows/O2Surface_DIBSection.m b/Onyx2D/platform_Windows/O2Surface_DIBSection.m index c9f3bff8..42323154 100644 --- a/Onyx2D/platform_Windows/O2Surface_DIBSection.m +++ b/Onyx2D/platform_Windows/O2Surface_DIBSection.m @@ -23,13 +23,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation O2Surface_DIBSection - initWithWidth: (int) width - height: (int) height - compatibleWithDeviceContext: (O2DeviceContext_gdi *) compatible + height: (int) height + compatibleWithDeviceContext: (O2DeviceContext_gdi *) compatible { - _deviceContext = - [[O2DeviceContext_gdiDIBSection alloc] initARGB32WithWidth: width - height: height - deviceContext: compatible]; + _deviceContext = [[O2DeviceContext_gdiDIBSection alloc] + initARGB32WithWidth: width + height: height + deviceContext: compatible]; // we support -height for flipped DIB sections @@ -42,13 +42,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ O2ColorSpaceRef colorSpace = O2ColorSpaceCreateDeviceRGB(); if ([super initWithBytes: [_deviceContext bitmapBytes] - width: width - height: height - bitsPerComponent: [_deviceContext bitsPerComponent] - bytesPerRow: [_deviceContext bytesPerRow] - colorSpace: colorSpace - bitmapInfo: kO2ImageAlphaPremultipliedFirst | - kO2BitmapByteOrder32Little] == nil) { + width: width + height: height + bitsPerComponent: [_deviceContext bitsPerComponent] + bytesPerRow: [_deviceContext bytesPerRow] + colorSpace: colorSpace + bitmapInfo: kO2ImageAlphaPremultipliedFirst | + kO2BitmapByteOrder32Little] == nil) { [colorSpace release]; return nil; } @@ -58,20 +58,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithBytes: (void *) bytes - width: (size_t) width - height: (size_t) height - bitsPerComponent: (size_t) bitsPerComponent - bytesPerRow: (size_t) bytesPerRow - colorSpace: (O2ColorSpaceRef) colorSpace - bitmapInfo: (O2BitmapInfo) bitmapInfo + width: (size_t) width + height: (size_t) height + bitsPerComponent: (size_t) bitsPerComponent + bytesPerRow: (size_t) bytesPerRow + colorSpace: (O2ColorSpaceRef) colorSpace + bitmapInfo: (O2BitmapInfo) bitmapInfo { if (bytes == NULL && bitsPerComponent == 8 && bitmapInfo == - (kO2ImageAlphaPremultipliedFirst | kO2BitmapByteOrder32Host) && + (kO2ImageAlphaPremultipliedFirst | kO2BitmapByteOrder32Host) && O2ColorSpaceGetModel(colorSpace) == kO2ColorSpaceModelRGB) { return [self initWithWidth: width - height: height - compatibleWithDeviceContext: nil]; + height: height + compatibleWithDeviceContext: nil]; } height = ABS(height); diff --git a/Onyx2D/platform_Windows/Win32Font.h b/Onyx2D/platform_Windows/Win32Font.h index 62b54495..97ef3b9a 100644 --- a/Onyx2D/platform_Windows/Win32Font.h +++ b/Onyx2D/platform_Windows/Win32Font.h @@ -27,12 +27,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithName: (NSString *) name - height: (int) height - antialias: (BOOL) antialias; + height: (int) height + antialias: (BOOL) antialias; - initWithName: (NSString *) name - height: (int) height - antialias: (BOOL) antialias - angle: (CGFloat) angle; + height: (int) height + antialias: (BOOL) antialias + angle: (CGFloat) angle; - (HFONT) fontHandle; diff --git a/Onyx2D/platform_Windows/Win32Font.m b/Onyx2D/platform_Windows/Win32Font.m index 2f6a7cdc..680a9928 100644 --- a/Onyx2D/platform_Windows/Win32Font.m +++ b/Onyx2D/platform_Windows/Win32Font.m @@ -31,9 +31,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @implementation Win32Font - initWithName: (NSString *) name - height: (int) height - antialias: (BOOL) antialias - angle: (CGFloat) angle + height: (int) height + antialias: (BOOL) antialias + angle: (CGFloat) angle { NSUInteger length = [name length]; unichar buffer[length + 1]; @@ -45,10 +45,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ O2FontLog(@"selecting font: %@ height: %d for drawing", name, height); angle = 180. * angle / M_PI * 10; // Tenth of degrees - _handle = - CreateFontW(height, 0, angle, angle, FW_NORMAL, FALSE, FALSE, FALSE, - DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, - quality, DEFAULT_PITCH | FF_DONTCARE, buffer); + _handle = CreateFontW(height, 0, angle, angle, FW_NORMAL, FALSE, FALSE, + FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, + CLIP_DEFAULT_PRECIS, quality, + DEFAULT_PITCH | FF_DONTCARE, buffer); if (_handle == NULL) { O2FontLog(@"CreateFontW for name: %@ failed", name); @@ -58,8 +58,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - initWithName: (NSString *) name - height: (int) height - antialias: (BOOL) antialias + height: (int) height + antialias: (BOOL) antialias { return [self initWithName: name height: height diff --git a/PDFKit/PDFDocument.h b/PDFKit/PDFDocument.h index c8f9e7f0..eece352d 100644 --- a/PDFKit/PDFDocument.h +++ b/PDFKit/PDFDocument.h @@ -3,7 +3,7 @@ #import @class NSURL, NSArray, NSMutableArray, PDFPage, PDFSelection, NSTimer, - NSNotification; + NSNotification; PDFKIT_EXPORT NSString *const PDFDocumentDidEndFindNotification; PDFKIT_EXPORT NSString *const PDFDocumentDidFindMatchNotification; diff --git a/PDFKit/PDFDocument.m b/PDFKit/PDFDocument.m index d7d4ba1a..89cca62d 100644 --- a/PDFKit/PDFDocument.m +++ b/PDFKit/PDFDocument.m @@ -11,9 +11,9 @@ #import NSString *const PDFDocumentDidEndFindNotification = - @"PDFDocumentDidEndFindNotification"; + @"PDFDocumentDidEndFindNotification"; NSString *const PDFDocumentDidFindMatchNotification = - @"PDFDocumentDidFindMatchNotification"; + @"PDFDocumentDidFindMatchNotification"; @implementation PDFDocument @@ -127,9 +127,10 @@ NSString *const PDFDocumentDidFindMatchNotification = NSInteger pageRangeLocation = MAX(0, rangeLocation); NSInteger pageRangeLength = maxRange - pageRangeLocation; PDFSelectedRange *selectedRange = [[[PDFSelectedRange alloc] - initWithPage: page - range: NSMakeRange(pageRangeLocation, - pageRangeLength)] autorelease]; + initWithPage: page + range: NSMakeRange(pageRangeLocation, + pageRangeLength)] + autorelease]; [selectionRanges addObject: selectedRange]; @@ -140,15 +141,15 @@ NSString *const PDFDocumentDidFindMatchNotification = if (pageForRange < 0) break; - maxRange = - [[[_pages objectAtIndex: pageForRange] string] length]; + maxRange = [[[_pages objectAtIndex: pageForRange] string] + length]; rangeLocation = maxRange - pageRangeLength; } } while (maxRange > rangeLocation); PDFSelection *selection = - [[[PDFSelection alloc] initWithDocument: self] autorelease]; + [[[PDFSelection alloc] initWithDocument: self] autorelease]; [selection _setSelectedRanges: selectionRanges]; @@ -174,13 +175,16 @@ NSString *const PDFDocumentDidFindMatchNotification = [_delegate didMatchString: selection]; [[NSNotificationCenter defaultCenter] - postNotificationName: PDFDocumentDidFindMatchNotification - object: self - userInfo: - [NSDictionary - dictionaryWithObject: selection - forKey: @"PDFDocumentFoundSel" - @"ection"]]; + postNotificationName: PDFDocumentDidFindMatchNotification + object: self + userInfo: + [NSDictionary + dictionaryWithObject: selection + forKey: @"PDFDocu" + @"mentFou" + @"ndSel" + @"ectio" + @"n"]]; } _findPageIndex++; @@ -190,9 +194,9 @@ NSString *const PDFDocumentDidFindMatchNotification = _findTimer = nil; [[NSNotificationCenter defaultCenter] - postNotificationName: PDFDocumentDidEndFindNotification - object: self - userInfo: nil]; + postNotificationName: PDFDocumentDidEndFindNotification + object: self + userInfo: nil]; } } @@ -260,12 +264,12 @@ NSString *const PDFDocumentDidFindMatchNotification = { [self _setupFindString: string withOptions: options]; - _findTimer = - [[NSTimer scheduledTimerWithTimeInterval: 0.001 - target: self - selector: @selector(_findOnCurrentPage:) - userInfo: nil - repeats: YES] retain]; + _findTimer = [[NSTimer + scheduledTimerWithTimeInterval: 0.001 + target: self + selector: @selector(_findOnCurrentPage:) + userInfo: nil + repeats: YES] retain]; } - (NSArray *) findString: (NSString *) string diff --git a/PDFKit/PDFDocumentView.m b/PDFKit/PDFDocumentView.m index bfdd0dbb..fb2d6475 100644 --- a/PDFKit/PDFDocumentView.m +++ b/PDFKit/PDFDocumentView.m @@ -56,8 +56,8 @@ // clipview bounds, this is wrong, need to translate float availableWidth = - [[self superview] bounds].size.width - - ([PDFPageView leftMargin] + [PDFPageView rightMargin]); + [[self superview] bounds].size.width - + ([PDFPageView leftMargin] + [PDFPageView rightMargin]); _scaleFactor = availableWidth / maxPageWidth; diff --git a/PDFKit/PDFPage.m b/PDFKit/PDFPage.m index 3d0282ae..ec46b731 100644 --- a/PDFKit/PDFPage.m +++ b/PDFKit/PDFPage.m @@ -10,7 +10,7 @@ _capacityOfCharacters = 128; _characters = NSZoneMalloc(NULL, sizeof(unichar) * _capacityOfCharacters); _characterRects = - NSZoneMalloc(NULL, sizeof(NSRect) * _capacityOfCharacters); + NSZoneMalloc(NULL, sizeof(NSRect) * _capacityOfCharacters); return self; } @@ -72,8 +72,8 @@ for (i = 0; i < count; i++) { _characters[_numberOfCharacters] = unicode[i]; _characterRects[_numberOfCharacters] = - NSMakeRect(rects[i].origin.x, rects[i].origin.y, - rects[i].size.width, rects[i].size.height); + NSMakeRect(rects[i].origin.x, rects[i].origin.y, + rects[i].size.width, rects[i].size.height); _numberOfCharacters++; } } diff --git a/PDFKit/PDFPageView.m b/PDFKit/PDFPageView.m index 7be71031..47e4b903 100644 --- a/PDFKit/PDFPageView.m +++ b/PDFKit/PDFPageView.m @@ -57,7 +57,7 @@ CGContextSaveGState(context); CGAffineTransform xform = - CGPDFPageGetDrawingTransform(page, kCGPDFMediaBox, bounds, 0, NO); + CGPDFPageGetDrawingTransform(page, kCGPDFMediaBox, bounds, 0, NO); CGContextConcatCTM(context, xform); diff --git a/PDFKit/PDFSelection.h b/PDFKit/PDFSelection.h index 6e55f036..28d7a704 100644 --- a/PDFKit/PDFSelection.h +++ b/PDFKit/PDFSelection.h @@ -3,7 +3,7 @@ #import @class PDFDocument, NSColor, NSArray, NSMutableArray, NSAttributedString, - PDFPage; + PDFPage; @interface PDFSelection : NSObject { PDFDocument *_document; diff --git a/PDFKit/PDFSelection.m b/PDFKit/PDFSelection.m index 67f97d95..a54b3509 100644 --- a/PDFKit/PDFSelection.m +++ b/PDFKit/PDFSelection.m @@ -84,7 +84,7 @@ - (NSAttributedString *) attributedString { return [[[NSAttributedString alloc] initWithString: [self string]] - autorelease]; + autorelease]; } - (void) addSelection: (PDFSelection *) selection { @@ -119,8 +119,8 @@ if (length > 0) { PDFSelectedRange *extendRange = [[[PDFSelectedRange alloc] - initWithPage: page - range: NSMakeRange(location, length)] autorelease]; + initWithPage: page + range: NSMakeRange(location, length)] autorelease]; NSMutableArray *changes = [[_ranges mutableCopy] autorelease]; [changes addObject: extendRange]; [self _setSelectedRanges: changes]; @@ -143,8 +143,8 @@ NSInteger length = range.location - location; PDFSelectedRange *extendRange = [[[PDFSelectedRange alloc] - initWithPage: page - range: NSMakeRange(location, length)] autorelease]; + initWithPage: page + range: NSMakeRange(location, length)] autorelease]; NSMutableArray *changes = [[_ranges mutableCopy] autorelease]; [changes insertObject: extendRange atIndex: 0]; [self _setSelectedRanges: changes]; diff --git a/PDFKit/PDFView.m b/PDFKit/PDFView.m index 48a89a2e..262c90c1 100644 --- a/PDFKit/PDFView.m +++ b/PDFKit/PDFView.m @@ -32,7 +32,7 @@ documentRect.size = [_scrollView contentSize]; _documentView = [[PDFDocumentView alloc] initWithFrame: documentRect]; [_documentView - setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; + setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [_scrollView setDocumentView: _documentView]; [self addSubview: _scrollView]; diff --git a/QuartzCore/CALayerContext.m b/QuartzCore/CALayerContext.m index 8aaff25e..690a569b 100644 --- a/QuartzCore/CALayerContext.m +++ b/QuartzCore/CALayerContext.m @@ -15,7 +15,7 @@ CGLError error; CGLPixelFormatAttribute attributes[1] = { - 0, + 0, }; GLint numberOfVirtualScreens; diff --git a/QuartzCore/CAMediaTimingFunction.m b/QuartzCore/CAMediaTimingFunction.m index 5f42023b..7d5ee888 100644 --- a/QuartzCore/CAMediaTimingFunction.m +++ b/QuartzCore/CAMediaTimingFunction.m @@ -5,11 +5,11 @@ NSString *const kCAMediaTimingFunctionLinear = @"kCAMediaTimingFunctionLinear"; NSString *const kCAMediaTimingFunctionEaseIn = @"kCAMediaTimingFunctionEaseIn"; NSString *const kCAMediaTimingFunctionEaseOut = - @"kCAMediaTimingFunctionEaseOut"; + @"kCAMediaTimingFunctionEaseOut"; NSString *const kCAMediaTimingFunctionEaseInEaseOut = - @"kCAMediaTimingFunctionEaseInEaseOut"; + @"kCAMediaTimingFunctionEaseInEaseOut"; NSString *const kCAMediaTimingFunctionDefault = - @"kCAMediaTimingFunctionDefault"; + @"kCAMediaTimingFunctionDefault"; @implementation CAMediaTimingFunction diff --git a/QuartzCore/CARenderer.m b/QuartzCore/CARenderer.m index 742b482b..6efd18ac 100644 --- a/QuartzCore/CARenderer.m +++ b/QuartzCore/CARenderer.m @@ -101,7 +101,7 @@ static CGFloat mediaTimingScale(CAAnimation *animation, if (function == nil) function = [CAMediaTimingFunction - functionWithName: kCAMediaTimingFunctionDefault]; + functionWithName: kCAMediaTimingFunctionDefault]; return applyMediaTimingFunction(function, zeroToOne); } @@ -195,17 +195,17 @@ static CGRect interpolateRectInLayerKey(CALayer *layer, NSString *key, CGRect resultRect; resultRect.origin.x = - fromRect.origin.x + - (toRect.origin.x - fromRect.origin.x) * timingScale; + fromRect.origin.x + + (toRect.origin.x - fromRect.origin.x) * timingScale; resultRect.origin.y = - fromRect.origin.y + - (toRect.origin.y - fromRect.origin.y) * timingScale; + fromRect.origin.y + + (toRect.origin.y - fromRect.origin.y) * timingScale; resultRect.size.width = - fromRect.size.width + - (toRect.size.width - fromRect.size.width) * timingScale; + fromRect.size.width + + (toRect.size.width - fromRect.size.width) * timingScale; resultRect.size.height = - fromRect.size.height + - (toRect.size.height - fromRect.size.height) * timingScale; + fromRect.size.height + + (toRect.size.height - fromRect.size.height) * timingScale; return resultRect; } @@ -314,12 +314,12 @@ void CATexImage2DCGImage(CGImageRef image) { } CGPoint anchorPoint = - interpolatePointInLayerKey(layer, @"anchorPoint", currentTime); + interpolatePointInLayerKey(layer, @"anchorPoint", currentTime); CGPoint position = - interpolatePointInLayerKey(layer, @"position", currentTime); + interpolatePointInLayerKey(layer, @"position", currentTime); CGRect bounds = interpolateRectInLayerKey(layer, @"bounds", currentTime); CGFloat opacity = - interpolateFloatInLayerKey(layer, @"opacity", currentTime); + interpolateFloatInLayerKey(layer, @"opacity", currentTime); GLfloat textureVertices[4 * 2]; GLfloat vertices[4 * 3]; diff --git a/QuartzCore/CATransaction.m b/QuartzCore/CATransaction.m index 64660d94..5f7998b9 100644 --- a/QuartzCore/CATransaction.m +++ b/QuartzCore/CATransaction.m @@ -6,12 +6,12 @@ #import NSString *const kCATransactionAnimationDuration = - @"kCATransactionAnimationDuration"; + @"kCATransactionAnimationDuration"; NSString *const kCATransactionDisableActions = @"kCATransactionDisableActions"; NSString *const kCATransactionAnimationTimingFunction = - @"kCATransactionAnimationTimingFunction"; + @"kCATransactionAnimationTimingFunction"; NSString *const kCATransactionCompletionBlock = - @"kCATransactionCompletionBlock"; + @"kCATransactionCompletionBlock"; @implementation CATransaction @@ -43,11 +43,12 @@ static CATransactionGroup *createImplicitTransactionGroupIfNeeded() { [transactionStack() addObject: check]; [[NSRunLoop currentRunLoop] - performSelector: @selector(commit) - target: [CATransaction class] - argument: nil - order: 0 - modes: [NSArray arrayWithObject: NSDefaultRunLoopMode]]; + performSelector: @selector(commit) + target: [CATransaction class] + argument: nil + order: 0 + modes: [NSArray arrayWithObject: + NSDefaultRunLoopMode]]; } return check; diff --git a/QuartzCore/CIContext.m b/QuartzCore/CIContext.m index 43c37c7b..3cc28dd2 100644 --- a/QuartzCore/CIContext.m +++ b/QuartzCore/CIContext.m @@ -85,11 +85,11 @@ static void evaluate(void *info, const CGFloat *in, CGFloat *output) { colors._C1[3] = endComponents[3]; CGFunctionRef function = - CGFunctionCreate(&colors, 1, domain, 4, range, &callbacks); + CGFunctionCreate(&colors, 1, domain, 4, range, &callbacks); CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGShadingRef shading = CGShadingCreateAxial( - colorSpace, CGPointMake([startVector X], [startVector Y]), - CGPointMake([endVector X], [endVector Y]), function, NO, NO); + colorSpace, CGPointMake([startVector X], [startVector Y]), + CGPointMake([endVector X], [endVector Y]), function, NO, NO); CGContextSaveGState(_cgContext); CGContextTranslateCTM(_cgContext, inRect.origin.x, inRect.origin.y); diff --git a/Security/SecBase.h b/Security/SecBase.h index 5bc3770d..b3ec98e0 100644 --- a/Security/SecBase.h +++ b/Security/SecBase.h @@ -47,7 +47,7 @@ typedef struct SecKeychainAttributeInfo { // objc for now @class SecKeychainItem, SecKeychainSearch, SecAccess, SecKeychain, - SecTrustedApplication; + SecTrustedApplication; typedef SecKeychainItem *SecKeychainItemRef; typedef SecKeychainSearch *SecKeychainSearchRef; @@ -79,42 +79,44 @@ enum { enum { errSecItemNotFound = -25300 }; SECURITY_EXPORT OSStatus SecKeychainFindGenericPassword( - CFTypeRef keychainOrArray, UInt32 serviceNameLength, - const char *serviceName, UInt32 accountNameLength, const char *accountName, - UInt32 *passwordLength, void **passwordData, SecKeychainItemRef *itemRef); -SECURITY_EXPORT OSStatus SecKeychainAddGenericPassword( - SecKeychainRef keychain, UInt32 serviceNameLength, const char *serviceName, - UInt32 accountNameLength, const char *accountName, UInt32 passwordLength, - void *passwordData, SecKeychainItemRef *itemRef); + CFTypeRef keychainOrArray, UInt32 serviceNameLength, + const char *serviceName, UInt32 accountNameLength, + const char *accountName, UInt32 *passwordLength, void **passwordData, + SecKeychainItemRef *itemRef); +SECURITY_EXPORT OSStatus +SecKeychainAddGenericPassword(SecKeychainRef keychain, UInt32 serviceNameLength, + const char *serviceName, UInt32 accountNameLength, + const char *accountName, UInt32 passwordLength, + void *passwordData, SecKeychainItemRef *itemRef); SECURITY_EXPORT OSStatus SecKeychainSearchCreateFromAttributes( - CFTypeRef keychainOrArray, SecItemClass itemClass, - const SecKeychainAttributeList *attributeList, - SecKeychainSearchRef *resultSearch); + CFTypeRef keychainOrArray, SecItemClass itemClass, + const SecKeychainAttributeList *attributeList, + SecKeychainSearchRef *resultSearch); SECURITY_EXPORT OSStatus SecKeychainSearchCopyNext( - SecKeychainSearchRef search, SecKeychainItemRef *resultItem); + SecKeychainSearchRef search, SecKeychainItemRef *resultItem); SECURITY_EXPORT OSStatus SecKeychainItemCopyAttributesAndData( - SecKeychainItemRef item, SecKeychainAttributeInfo *info, - SecItemClass *itemClass, SecKeychainAttributeList **attributeList, - UInt32 *length, void **resultBytes); + SecKeychainItemRef item, SecKeychainAttributeInfo *info, + SecItemClass *itemClass, SecKeychainAttributeList **attributeList, + UInt32 *length, void **resultBytes); SECURITY_EXPORT OSStatus SecKeychainItemModifyAttributesAndData( - SecKeychainItemRef item, const SecKeychainAttributeList *attributeList, - UInt32 length, const void *bytes); + SecKeychainItemRef item, const SecKeychainAttributeList *attributeList, + UInt32 length, const void *bytes); SECURITY_EXPORT OSStatus SecKeychainItemFreeAttributesAndData( - SecKeychainAttributeList *attributeList, void *data); + SecKeychainAttributeList *attributeList, void *data); SECURITY_EXPORT OSStatus SecKeychainItemFreeContent(SecKeychainAttributeList *attributeList, void *data); SECURITY_EXPORT OSStatus SecTrustedApplicationCreateFromPath( - const char *path, SecTrustedApplicationRef *resultApplication); + const char *path, SecTrustedApplicationRef *resultApplication); SECURITY_EXPORT OSStatus SecAccessCreate(CFStringRef descriptor, CFArrayRef trustedlist, SecAccessRef *resultAccess); SECURITY_EXPORT OSStatus SecKeychainItemCreateFromContent( - SecItemClass itemClass, SecKeychainAttributeList *attributeList, - UInt32 length, const void *bytes, SecKeychainRef keychain, - SecAccessRef initialAccess, SecKeychainItemRef *resultItem); + SecItemClass itemClass, SecKeychainAttributeList *attributeList, + UInt32 length, const void *bytes, SecKeychainRef keychain, + SecAccessRef initialAccess, SecKeychainItemRef *resultItem); SECURITY_EXPORT OSStatus SecKeychainItemDelete(SecKeychainItemRef item); // Internal, do not use diff --git a/Security/SecBase.m b/Security/SecBase.m index b04cbed9..abd291a8 100644 --- a/Security/SecBase.m +++ b/Security/SecBase.m @@ -6,14 +6,15 @@ #import OSStatus SecKeychainFindGenericPassword( - CFTypeRef keychainOrArray, UInt32 serviceNameLength, - const char *serviceName, UInt32 accountNameLength, const char *accountName, - UInt32 *passwordLength, void **passwordData, SecKeychainItemRef *itemRef) + CFTypeRef keychainOrArray, UInt32 serviceNameLength, + const char *serviceName, UInt32 accountNameLength, + const char *accountName, UInt32 *passwordLength, void **passwordData, + SecKeychainItemRef *itemRef) { SecKeychainAttributeList attributeList; attributeList.count = 2; attributeList.attr = - malloc(sizeof(SecKeychainAttribute) * attributeList.count); + malloc(sizeof(SecKeychainAttribute) * attributeList.count); attributeList.attr[0].tag = kSecAccountItemAttr; attributeList.attr[0].length = accountNameLength; attributeList.attr[0].data = (void *) accountName; @@ -23,7 +24,7 @@ OSStatus SecKeychainFindGenericPassword( SecKeychainSearchRef search; OSStatus status = SecKeychainSearchCreateFromAttributes( - NULL, kSecGenericPasswordItemClass, &attributeList, &search); + NULL, kSecGenericPasswordItemClass, &attributeList, &search); if (status != 0) { free(attributeList.attr); return status; @@ -32,7 +33,7 @@ OSStatus SecKeychainFindGenericPassword( status = SecKeychainSearchCopyNext(search, itemRef); if (status == 0 && *itemRef) { status = SecKeychainItemCopyAttributesAndData( - *itemRef, NULL, NULL, NULL, passwordLength, passwordData); + *itemRef, NULL, NULL, NULL, passwordLength, passwordData); } else { status = errSecItemNotFound; *itemRef = NULL; @@ -53,7 +54,7 @@ SecKeychainAddGenericPassword(SecKeychainRef keychain, UInt32 serviceNameLength, SecKeychainAttributeList attributeList; attributeList.count = 2; attributeList.attr = - malloc(sizeof(SecKeychainAttribute) * attributeList.count); + malloc(sizeof(SecKeychainAttribute) * attributeList.count); attributeList.attr[0].tag = kSecAccountItemAttr; attributeList.attr[0].length = accountNameLength; attributeList.attr[0].data = (void *) accountName; @@ -62,21 +63,21 @@ SecKeychainAddGenericPassword(SecKeychainRef keychain, UInt32 serviceNameLength, attributeList.attr[1].data = (void *) serviceName; OSStatus status = SecKeychainItemCreateFromContent( - kSecGenericPasswordItemClass, &attributeList, passwordLength, - passwordData, keychain, NULL, itemRef); + kSecGenericPasswordItemClass, &attributeList, passwordLength, + passwordData, keychain, NULL, itemRef); free(attributeList.attr); return status; } OSStatus SecKeychainSearchCreateFromAttributes( - CFTypeRef keychainOrArray, SecItemClass itemClass, - const SecKeychainAttributeList *attributeList, - SecKeychainSearchRef *resultSearch) + CFTypeRef keychainOrArray, SecItemClass itemClass, + const SecKeychainAttributeList *attributeList, + SecKeychainSearchRef *resultSearch) { *resultSearch = - [[SecKeychainSearch alloc] initWithKeychainOrArray: keychainOrArray - itemClass: itemClass - attributeList: attributeList]; + [[SecKeychainSearch alloc] initWithKeychainOrArray: keychainOrArray + itemClass: itemClass + attributeList: attributeList]; return 0; } @@ -88,9 +89,9 @@ OSStatus SecKeychainSearchCopyNext(SecKeychainSearchRef search, } OSStatus SecKeychainItemCopyAttributesAndData( - SecKeychainItemRef item, SecKeychainAttributeInfo *info, - SecItemClass *itemClass, SecKeychainAttributeList **attributeList, - UInt32 *length, void **resultBytes) + SecKeychainItemRef item, SecKeychainAttributeInfo *info, + SecItemClass *itemClass, SecKeychainAttributeList **attributeList, + UInt32 *length, void **resultBytes) { [item copyAttributeInfo: info itemClass: itemClass @@ -101,8 +102,8 @@ OSStatus SecKeychainItemCopyAttributesAndData( } OSStatus SecKeychainItemModifyAttributesAndData( - SecKeychainItemRef item, const SecKeychainAttributeList *attributeList, - UInt32 length, const void *bytes) + SecKeychainItemRef item, const SecKeychainAttributeList *attributeList, + UInt32 length, const void *bytes) { [item modifyAttributeList: attributeList length: length bytes: bytes]; [[item keychain] modifyKeychainItem: item]; @@ -149,15 +150,15 @@ OSStatus SecAccessCreate(CFStringRef descriptor, CFArrayRef trustedList, } OSStatus SecKeychainItemCreateFromContent( - SecItemClass itemClass, SecKeychainAttributeList *attributeList, - UInt32 length, const void *bytes, SecKeychainRef keychain, - SecAccessRef initialAccess, SecKeychainItemRef *resultItem) + SecItemClass itemClass, SecKeychainAttributeList *attributeList, + UInt32 length, const void *bytes, SecKeychainRef keychain, + SecAccessRef initialAccess, SecKeychainItemRef *resultItem) { SecKeychainItemRef item = - [[SecKeychainItem alloc] initWithItemClass: itemClass - attributeList: attributeList - length: length - bytes: bytes]; + [[SecKeychainItem alloc] initWithItemClass: itemClass + attributeList: attributeList + length: length + bytes: bytes]; if (keychain == NULL) keychain = [SecKeychain defaultUserKeychain]; @@ -192,11 +193,11 @@ SecKeychainAttributeList * SecCopyAttributeList(const SecKeychainAttributeList *attributeList) { SecKeychainAttributeList *result = - NSZoneMalloc(NULL, sizeof(SecKeychainAttributeList)); + NSZoneMalloc(NULL, sizeof(SecKeychainAttributeList)); result->count = attributeList->count; result->attr = - NSZoneMalloc(NULL, sizeof(SecKeychainAttribute) * result->count); + NSZoneMalloc(NULL, sizeof(SecKeychainAttribute) * result->count); int i; for (i = 0; i < result->count; i++) { diff --git a/Security/SecKeychain.h b/Security/SecKeychain.h index 16658dde..4c9d44ba 100644 --- a/Security/SecKeychain.h +++ b/Security/SecKeychain.h @@ -20,9 +20,10 @@ - (SecKeychainCursor *) createCursorForItemClass: (SecItemClass) itemClass; -- (SecKeychainItemRef) - createNextItemAtCursor: (SecKeychainCursor *) cursor - attributeList: (const SecKeychainAttributeList *) attributeList; +- (SecKeychainItemRef) createNextItemAtCursor: (SecKeychainCursor *) cursor + attributeList: + (const SecKeychainAttributeList *) + attributeList; - (void) addKeychainItem: (SecKeychainItemRef) item; - (void) removeKeychainItem: (SecKeychainItemRef) item; diff --git a/Security/SecKeychain.m b/Security/SecKeychain.m index 12b55e17..da59d0e6 100644 --- a/Security/SecKeychain.m +++ b/Security/SecKeychain.m @@ -101,9 +101,10 @@ static HKEY handleToPath(NSArray *path) { unichar zero = {0}; for (i = 0; i < count; i++) { - error = RegCreateKeyExW( - previous, ZeroTerminatedString([path objectAtIndex: i]), 0, &zero, - REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, ¤t, NULL); + error = RegCreateKeyExW(previous, + ZeroTerminatedString([path objectAtIndex: i]), + 0, &zero, REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, NULL, ¤t, NULL); if (error != ERROR_SUCCESS) NSLog(@"RegCreateKeyExW failed at index %d in path=%@", i, path); @@ -125,9 +126,9 @@ static HKEY handleToPath(NSArray *path) { HKEY handle = handleToPath(path); SecKeychainCursor *result = - [[SecKeychainCursor alloc] initWithRegistryPath: path - itemClass: itemClass - handle: handle]; + [[SecKeychainCursor alloc] initWithRegistryPath: path + itemClass: itemClass + handle: handle]; return result; } @@ -241,14 +242,14 @@ static void *decryptData(void *bytes, unsigned length, unsigned *resultLength) { itemClass: (SecItemClass) itemClass { SecKeychainAttributeList *list = - NSZoneMalloc(NULL, sizeof(SecKeychainAttributeList)); + NSZoneMalloc(NULL, sizeof(SecKeychainAttributeList)); UInt32 blobLength = 0; void *blobBytes = NULL; int i, listCapacity = 1; list->count = 0; list->attr = - NSZoneMalloc(NULL, sizeof(SecKeychainAttribute) * listCapacity); + NSZoneMalloc(NULL, sizeof(SecKeychainAttribute) * listCapacity); for (i = 0;; i++) { unichar nameBuffer[256]; @@ -280,14 +281,14 @@ static void *decryptData(void *bytes, unsigned length, unsigned *resultLength) { if (nameLength == 4 && type == REG_SZ && (dataLength % 2 == 0)) { SecKeychainAttrType tag = fourByteCodeFromUnicode(nameBuffer); NSString *string = - [NSString stringWithCharacters: (unichar *) data - length: dataLength / 2 - 1]; + [NSString stringWithCharacters: (unichar *) data + length: dataLength / 2 - 1]; if (list->count + 1 >= listCapacity) { listCapacity *= 2; - list->attr = - NSZoneRealloc(NULL, list->attr, - sizeof(SecKeychainAttribute) * listCapacity); + list->attr = NSZoneRealloc(NULL, list->attr, + sizeof(SecKeychainAttribute) * + listCapacity); } list->attr[list->count].tag = tag; @@ -300,12 +301,12 @@ static void *decryptData(void *bytes, unsigned length, unsigned *resultLength) { case kSecAccountItemAttr: // utf8 case kSecServerItemAttr: // utf8 case kSecServiceItemAttr: // utf8 - ; + ; const char *utf8 = [string UTF8String]; list->attr[list->count].length = strlen(utf8); list->attr[list->count].data = - NSZoneMalloc(NULL, list->attr[list->count].length); + NSZoneMalloc(NULL, list->attr[list->count].length); SecByteCopy(utf8, list->attr[list->count].data, list->attr[list->count].length); break; @@ -313,12 +314,12 @@ static void *decryptData(void *bytes, unsigned length, unsigned *resultLength) { case kSecCreatorItemAttr: // four byte code case kSecTypeItemAttr: // four byte code case kSecProtocolItemAttr: // four byte code - ; + ; if (dataLength == 10) { // four byte code stored as unicode with // terminating zero list->attr[list->count].length = 4; list->attr[list->count].data = - createFourByteCodeFromString(string); + createFourByteCodeFromString(string); } break; @@ -341,10 +342,10 @@ static void *decryptData(void *bytes, unsigned length, unsigned *resultLength) { } SecKeychainItem *result = - [[SecKeychainItem alloc] initWithItemClass: itemClass - attributeList: list - length: blobLength - bytes: blobBytes]; + [[SecKeychainItem alloc] initWithItemClass: itemClass + attributeList: list + length: blobLength + bytes: blobBytes]; [result setKeychain: self]; @@ -354,8 +355,8 @@ static void *decryptData(void *bytes, unsigned length, unsigned *resultLength) { } - (SecKeychainItemRef) - createNextItemAtCursor: (SecKeychainCursor *) cursor - attributeList: (const SecKeychainAttributeList *) attributeList + createNextItemAtCursor: (SecKeychainCursor *) cursor + attributeList: (const SecKeychainAttributeList *) attributeList { SecKeychainItemRef result = nil; @@ -412,16 +413,16 @@ static void *decryptData(void *bytes, unsigned length, unsigned *resultLength) { case kSecAccountItemAttr: // utf8 case kSecServerItemAttr: // utf8 case kSecServiceItemAttr: // utf8 - ; + ; NSString *string = - [[NSString alloc] initWithBytes: data - length: length - encoding: NSUTF8StringEncoding]; + [[NSString alloc] initWithBytes: data + length: length + encoding: NSUTF8StringEncoding]; const unichar *unicode = ZeroTerminatedString(string); if ((error = RegSetValueExW( - handle, key, 0, REG_SZ, (const BYTE *) unicode, - ([string length] + 1) * 2)) != ERROR_SUCCESS) + handle, key, 0, REG_SZ, (const BYTE *) unicode, + ([string length] + 1) * 2)) != ERROR_SUCCESS) NSLog(@"RegSetValueExW failed with %d", error); [string release]; @@ -430,14 +431,14 @@ static void *decryptData(void *bytes, unsigned length, unsigned *resultLength) { case kSecCreatorItemAttr: // four byte code case kSecTypeItemAttr: // four byte code case kSecProtocolItemAttr: // four byte code - ; + ; if (length == 4) { NSString *string = stringForFourCharCode(*(uint32_t *) data); const unichar *unicode = ZeroTerminatedString(string); if ((error = RegSetValueExW( - handle, key, 0, REG_SZ, (const BYTE *) unicode, - ([string length] + 1) * 2)) != ERROR_SUCCESS) + handle, key, 0, REG_SZ, (const BYTE *) unicode, + ([string length] + 1) * 2)) != ERROR_SUCCESS) NSLog(@"RegSetValueExW failed with %d", error); } break; @@ -453,7 +454,7 @@ static void *decryptData(void *bytes, unsigned length, unsigned *resultLength) { const unichar *key = ZeroTerminatedString(@"_BLOB_"); unsigned encryptedLength = 0; void *encrypted = - encryptData([item blobBytes], [item blobLength], &encryptedLength); + encryptData([item blobBytes], [item blobLength], &encryptedLength); if ((error = RegSetValueExW(handle, key, 0, REG_BINARY, encrypted, encryptedLength)) != ERROR_SUCCESS) diff --git a/Security/SecKeychainItem.h b/Security/SecKeychainItem.h index 94e17bdd..988752f2 100644 --- a/Security/SecKeychainItem.h +++ b/Security/SecKeychainItem.h @@ -20,9 +20,9 @@ } - initWithItemClass: (SecItemClass) itemClass - attributeList: (SecKeychainAttributeList *) attributeList - length: (UInt32) length - bytes: (const void *) bytes; + attributeList: (SecKeychainAttributeList *) attributeList + length: (UInt32) length + bytes: (const void *) bytes; - (SecItemClass) itemClass; - (SecKeychainAttributeList *) attributeList; diff --git a/Security/SecKeychainItem.m b/Security/SecKeychainItem.m index 80a2c754..70097ea4 100644 --- a/Security/SecKeychainItem.m +++ b/Security/SecKeychainItem.m @@ -11,9 +11,9 @@ @implementation SecKeychainItem - initWithItemClass: (SecItemClass) itemClass - attributeList: (SecKeychainAttributeList *) attributeList - length: (UInt32) length - bytes: (const void *) bytes + attributeList: (SecKeychainAttributeList *) attributeList + length: (UInt32) length + bytes: (const void *) bytes { _itemClass = itemClass; _attributeList = SecCopyAttributeList(attributeList); diff --git a/Security/SecKeychainSearch.m b/Security/SecKeychainSearch.m index eb3285ed..8aac40a8 100644 --- a/Security/SecKeychainSearch.m +++ b/Security/SecKeychainSearch.m @@ -42,7 +42,7 @@ while (_arrayCursor < CFArrayGetCount(_array)) { SecKeychainRef keychain = - (id) CFArrayGetValueAtIndex(_array, _arrayCursor); + (id) CFArrayGetValueAtIndex(_array, _arrayCursor); ("%s %d", __FUNCTION__, __LINE__); if (_keychainCursor == nil) diff --git a/makefiles/test/src/test.m b/makefiles/test/src/test.m index 53901e52..10880339 100644 --- a/makefiles/test/src/test.m +++ b/makefiles/test/src/test.m @@ -103,8 +103,8 @@ int main(int argc, char **argv) { // performSelector: NSSelectorFromString(@"bar")]); SEL sel = @selector(iinvocation:test:method:); NSInvocation *i = [NSInvocation - invocationWithMethodSignature: [[Hello world] - methodSignatureForSelector: sel]]; + invocationWithMethodSignature: + [[Hello world] methodSignatureForSelector: sel]]; // int r; long long r = 1; char a1 = 'x'; diff --git a/objc/Protocol.m b/objc/Protocol.m index 5e799a2d..8e0b862c 100644 --- a/objc/Protocol.m +++ b/objc/Protocol.m @@ -66,7 +66,7 @@ void OBJCRegisterProtocol(OBJCProtocolTemplate *template) { } - (struct objc_method_description *) descriptionForInstanceMethod: - (SEL) selector + (SEL) selector { struct objc_protocol_list *list; unsigned i; diff --git a/objc/objc_association.m b/objc/objc_association.m index 71d9bb5f..bb070583 100644 --- a/objc/objc_association.m +++ b/objc/objc_association.m @@ -89,7 +89,7 @@ void AssociationTableInsert(AssociationTable *table, id key, table->nBuckets = newSize; table->buckets = - calloc(table->nBuckets, sizeof(AssociationHashBucket *)); + calloc(table->nBuckets, sizeof(AssociationHashBucket *)); // Get all of the existing buckets and place them into the new list for (i = 0; i < nBuckets; i++) { @@ -185,8 +185,8 @@ void AssociationTableRemove(AssociationTable *table, id key) { releaseTableSize *= 2; } objectsToRelease = - realloc(objectsToRelease, - sizeof(id) * releaseTableSize); + realloc(objectsToRelease, + sizeof(id) * releaseTableSize); } objectsToRelease[releaseCount++] = e->object; break; @@ -238,16 +238,16 @@ void objc_setAssociatedObject(id object, const void *key, id value, } AssociationObjectEntry *objectTable = - AssociationTableGet(associationTable, object); + AssociationTableGet(associationTable, object); if (objectTable == NULL) { - objectTable = - calloc(sizeof(AssociationObjectEntry), AssociationObjectEntrySize); + objectTable = calloc(sizeof(AssociationObjectEntry), + AssociationObjectEntrySize); AssociationTableInsert(associationTable, object, objectTable); } uintptr_t index = HASHPTR(key) % AssociationObjectEntrySize; AssociationObjectEntry *entry = - ((AssociationObjectEntry *) objectTable) + index; + ((AssociationObjectEntry *) objectTable) + index; if (entry->object == nil) { entry->policy = policy; entry->key = key; @@ -339,7 +339,7 @@ id objc_getAssociatedObject(id object, const void *key) { AssociationSpinLockLock(&AssociationLock); AssociationObjectEntry *objectTable = - AssociationTableGet(associationTable, object); + AssociationTableGet(associationTable, object); if (objectTable == NULL) { AssociationSpinLockUnlock(&AssociationLock); return nil; @@ -347,7 +347,7 @@ id objc_getAssociatedObject(id object, const void *key) { uintptr_t index = HASHPTR(key) % AssociationObjectEntrySize; AssociationObjectEntry *entry = - ((AssociationObjectEntry *) objectTable) + index; + ((AssociationObjectEntry *) objectTable) + index; while (entry) { if (entry->key == key) { break; diff --git a/objc/platform_darwin/OBJCRegisterModule_Darwin.m b/objc/platform_darwin/OBJCRegisterModule_Darwin.m index 5c4c3460..54589cf0 100644 --- a/objc/platform_darwin/OBJCRegisterModule_Darwin.m +++ b/objc/platform_darwin/OBJCRegisterModule_Darwin.m @@ -47,17 +47,17 @@ void OBJCRegisterModule_Darwin(const char *name) { } #ifdef __LP64__ const struct mach_header_64 *head = - (struct mach_header_64 *) _dyld_get_image_header(i); + (struct mach_header_64 *) _dyld_get_image_header(i); uint64_t size; - char *section = - getsectdatafromheader_64(head, "__OBJC", "__message_refs", &size); + char *section = getsectdatafromheader_64(head, "__OBJC", + "__message_refs", &size); #else const struct mach_header *head = _dyld_get_image_header(i); uint32_t size; char *section = - getsectdatafromheader(head, "__OBJC", "__message_refs", &size); + getsectdatafromheader(head, "__OBJC", "__message_refs", &size); #endif section += _dyld_get_image_vmaddr_slide(i); @@ -89,11 +89,11 @@ void OBJCRegisterModule_Darwin(const char *name) { #ifdef __LP64__ const struct mach_header_64 *head = - (struct mach_header_64 *) _dyld_get_image_header(i); + (struct mach_header_64 *) _dyld_get_image_header(i); uint64_t size = 0; - section = - getsectdatafromheader_64(head, "__OBJC", "__module_info", &size); + section = getsectdatafromheader_64(head, "__OBJC", "__module_info", + &size); #else const struct mach_header *head = _dyld_get_image_header(i); @@ -128,17 +128,17 @@ void OBJCRegisterModule_Darwin(const char *name) { } #ifdef __LP64__ const struct mach_header_64 *head = - (struct mach_header_64 *) _dyld_get_image_header(i); + (struct mach_header_64 *) _dyld_get_image_header(i); uint64_t size = 0; char *section = - getsectdatafromheader_64(head, "__OBJC", "__cls_refs", &size); + getsectdatafromheader_64(head, "__OBJC", "__cls_refs", &size); #else const struct mach_header *head = _dyld_get_image_header(i); uint32_t size = 0; char *section = - getsectdatafromheader(head, "__OBJC", "__cls_refs", &size); + getsectdatafromheader(head, "__OBJC", "__cls_refs", &size); #endif typeof(size) nrefs = size / sizeof(struct objc_class *); @@ -148,7 +148,7 @@ void OBJCRegisterModule_Darwin(const char *name) { long j; for (j = 0; j < nrefs; j++) { const char *aref = - (const char *) refs[j]; // yes these are strings ! + (const char *) refs[j]; // yes these are strings ! Class c = objc_lookUpClass(aref); if (c) { diff --git a/pthread/pthread.m b/pthread/pthread.m index 0aa5bec2..8542c556 100644 --- a/pthread/pthread.m +++ b/pthread/pthread.m @@ -139,7 +139,7 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) { if (!cond) return EINVAL; pthread_cond_impl *impl = - (pthread_cond_impl *) calloc(1, sizeof(pthread_cond_impl)); + (pthread_cond_impl *) calloc(1, sizeof(pthread_cond_impl)); impl->events[condEvent_signal] = CreateEvent(0, FALSE, FALSE, 0); impl->events[condEvent_broadcast] = CreateEvent(0, TRUE, FALSE, 0); @@ -220,9 +220,9 @@ abstime_to_win32_millisec_timeout(const struct timespec *abstime) filetime_to_timespec(&ft, &curtime); double t0 = - (double) curtime.tv_sec + ((double) curtime.tv_nsec / 1000000000.0); - double t1 = - (double) abstime->tv_sec + ((double) abstime->tv_nsec / 1000000000.0); + (double) curtime.tv_sec + ((double) curtime.tv_nsec / 1000000000.0); + double t1 = (double) abstime->tv_sec + + ((double) abstime->tv_nsec / 1000000000.0); if (t1 <= t0) return 0; @@ -248,8 +248,8 @@ static int impl_win32_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex, pthread_mutex_unlock(mutex); - int result = - WaitForMultipleObjects(condEventCount, impl->events, FALSE, timeout); + int result = WaitForMultipleObjects(condEventCount, impl->events, FALSE, + timeout); LONG newWaitersCount = InterlockedDecrement(&impl->waitersCount); _Bool lastWaiter = (result != WAIT_TIMEOUT) && @@ -285,7 +285,7 @@ int pthread_attr_init(pthread_attr_t *attr) { if (!attr) return EINVAL; pthread_attr_impl *impl = - (pthread_attr_impl *) calloc(1, sizeof(pthread_attr_impl)); + (pthread_attr_impl *) calloc(1, sizeof(pthread_attr_impl)); *attr = impl; return 0; } @@ -333,8 +333,8 @@ typedef struct pthread_start_routine_args_win32 { // Be sure the stack is aligned in case the thread wants to do exotic things // like SSE2 unsigned - __attribute__((force_align_arg_pointer)) __stdcall startroutine_thunk_for_win32_beginthreadex( - void *arg) + __attribute__((force_align_arg_pointer)) __stdcall startroutine_thunk_for_win32_beginthreadex( + void *arg) #else unsigned __stdcall startroutine_thunk_for_win32_beginthreadex(void *arg) #endif @@ -358,15 +358,15 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr, // object holds the function and its arguments. the thread thunk function // will release this object when the real start_routine finishes. pthread_start_routine_args *threadArgs = - (pthread_start_routine_args *) malloc( - sizeof(pthread_start_routine_args)); + (pthread_start_routine_args *) malloc( + sizeof(pthread_start_routine_args)); threadArgs->pthreadStyleFunc = start_routine; threadArgs->arg = arg; uint32_t threadId = 0; HANDLE win32Handle = (HANDLE) _beginthreadex( - NULL, 0, startroutine_thunk_for_win32_beginthreadex, threadArgs, 0, - &threadId); + NULL, 0, startroutine_thunk_for_win32_beginthreadex, threadArgs, 0, + &threadId); if (!win32Handle) { free(threadArgs); return EAGAIN; diff --git a/testing/Examples/CGShadingCreate/GradientView.m b/testing/Examples/CGShadingCreate/GradientView.m index a6c1320d..c7d5a733 100644 --- a/testing/Examples/CGShadingCreate/GradientView.m +++ b/testing/Examples/CGShadingCreate/GradientView.m @@ -67,16 +67,16 @@ void evaluate(void *info, const float *in, float *output) { if ([_shadingType selectedTag] == 0) shading = - CGShadingCreateAxial(CGColorSpaceCreateDeviceRGB(), - CGPointMake(_startPoint.x, _startPoint.y), - CGPointMake(_endPoint.x, _endPoint.y), - function, _extendStart, _extendEnd); + CGShadingCreateAxial(CGColorSpaceCreateDeviceRGB(), + CGPointMake(_startPoint.x, _startPoint.y), + CGPointMake(_endPoint.x, _endPoint.y), + function, _extendStart, _extendEnd); else shading = CGShadingCreateRadial( - CGColorSpaceCreateDeviceRGB(), - CGPointMake(_startPoint.x, _startPoint.y), _startRadius, - CGPointMake(_endPoint.x, _endPoint.y), _endRadius, function, - _extendStart, _extendEnd); + CGColorSpaceCreateDeviceRGB(), + CGPointMake(_startPoint.x, _startPoint.y), _startRadius, + CGPointMake(_endPoint.x, _endPoint.y), _endRadius, function, + _extendStart, _extendEnd); CGContextDrawShading(context, shading); @@ -95,8 +95,8 @@ void evaluate(void *info, const float *in, float *output) { [self updatePointFields]; [self setNeedsDisplay: YES]; - event = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while ([event type] != NSLeftMouseUp); _mouseFirst = !_mouseFirst; @@ -127,16 +127,16 @@ void evaluate(void *info, const float *in, float *output) { } - (IBAction) takeStartColorFromSender: sender { - NSColor *color = - [[sender color] colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + NSColor *color = [[sender color] + colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [color getRed: _C0 green: _C0 + 1 blue: _C0 + 2 alpha: _C0 + 3]; [self setNeedsDisplay: YES]; } - (IBAction) takeEndColorFromSender: sender { - NSColor *color = - [[sender color] colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + NSColor *color = [[sender color] + colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [color getRed: _C1 green: _C1 + 1 blue: _C1 + 2 alpha: _C1 + 3]; [self setNeedsDisplay: YES]; diff --git a/testing/Examples/CGShadingCreateAxial/GradientView.m b/testing/Examples/CGShadingCreateAxial/GradientView.m index e0ce8f28..653fd45e 100644 --- a/testing/Examples/CGShadingCreateAxial/GradientView.m +++ b/testing/Examples/CGShadingCreateAxial/GradientView.m @@ -64,24 +64,24 @@ void evaluate(void *info, const float *in, float *output) { *dest = point; [self setNeedsDisplay: YES]; - event = [[self window] - nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | + NSLeftMouseDraggedMask]; } while ([event type] != NSLeftMouseUp); _mouseFirst = !_mouseFirst; } - (IBAction) takeStartColorFromSender: sender { - NSColor *color = - [[sender color] colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + NSColor *color = [[sender color] + colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [color getRed: _C0 green: _C0 + 1 blue: _C0 + 2 alpha: _C0 + 3]; [self setNeedsDisplay: YES]; } - (IBAction) takeEndColorFromSender: sender { - NSColor *color = - [[sender color] colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; + NSColor *color = [[sender color] + colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [color getRed: _C1 green: _C1 + 1 blue: _C1 + 2 alpha: _C1 + 3]; [self setNeedsDisplay: YES]; diff --git a/testing/Examples/NSOpenGLView/MyOpenGLView.m b/testing/Examples/NSOpenGLView/MyOpenGLView.m index 51b9c952..0be3ae52 100644 --- a/testing/Examples/NSOpenGLView/MyOpenGLView.m +++ b/testing/Examples/NSOpenGLView/MyOpenGLView.m @@ -20,7 +20,7 @@ static void drawArcWithDepth(float beginAngle, float endAngle, { for (; beginAngle <= endAngle; beginAngle += 1) { CGAffineTransform matrix = - CGAffineTransformMakeRotation(M_PI * beginAngle / 180.0); + CGAffineTransformMakeRotation(M_PI * beginAngle / 180.0); CGPoint innerPoint = CGPointMake(innerRadius, 0); CGPoint outerPoint = CGPointMake(outerRadius, 0); @@ -37,7 +37,7 @@ static void drawEdge(float beginAngle, float endAngle, float radius, { for (; beginAngle <= endAngle; beginAngle += 1) { CGAffineTransform matrix = - CGAffineTransformMakeRotation(M_PI * beginAngle / 180.0); + CGAffineTransformMakeRotation(M_PI * beginAngle / 180.0); CGPoint point = CGPointMake(radius, 0); CGPoint normal = CGPointMake(1, 0); @@ -54,7 +54,7 @@ static void capAtAngle(float angle, float innerRadius, float outerRadius, float depth) { CGAffineTransform matrix = - CGAffineTransformMakeRotation(M_PI * angle / 180.0); + CGAffineTransformMakeRotation(M_PI * angle / 180.0); CGPoint innerPoint = CGPointMake(innerRadius, 0); CGPoint outerPoint = CGPointMake(outerRadius, 0); CGPoint normal = CGPointMake(1, 0); diff --git a/testing/Examples/Quartz2D/Demo.m b/testing/Examples/Quartz2D/Demo.m index 23940612..fee87033 100644 --- a/testing/Examples/Quartz2D/Demo.m +++ b/testing/Examples/Quartz2D/Demo.m @@ -14,12 +14,12 @@ CGImageRef result; NSString *path = - [[NSBundle bundleForClass: [self class]] pathForResource: name - ofType: @"png"]; + [[NSBundle bundleForClass: [self class]] pathForResource: name + ofType: @"png"]; NSData *data = [NSData dataWithContentsOfFile: path]; CGImageSourceRef source = - CGImageSourceCreateWithData((CFDataRef) data, nil); + CGImageSourceCreateWithData((CFDataRef) data, nil); result = CGImageSourceCreateImageAtIndex(source, 0, nil); diff --git a/testing/Examples/Quartz2D/DemoAffineImages.m b/testing/Examples/Quartz2D/DemoAffineImages.m index 27697533..d5616af6 100644 --- a/testing/Examples/Quartz2D/DemoAffineImages.m +++ b/testing/Examples/Quartz2D/DemoAffineImages.m @@ -20,17 +20,17 @@ CGContextTranslateCTM(context, 0.5, 0.5); int i, numberOfImages = 11; CGBlendMode modes[] = { - kCGBlendModeNormal, - kCGBlendModeClear, - kCGBlendModeCopy, - kCGBlendModeSourceIn, - kCGBlendModeSourceOut, - kCGBlendModeSourceAtop, - kCGBlendModeDestinationOver, - kCGBlendModeDestinationIn, - kCGBlendModeDestinationOut, - kCGBlendModeDestinationAtop, - kCGBlendModeXOR, + kCGBlendModeNormal, + kCGBlendModeClear, + kCGBlendModeCopy, + kCGBlendModeSourceIn, + kCGBlendModeSourceOut, + kCGBlendModeSourceAtop, + kCGBlendModeDestinationOver, + kCGBlendModeDestinationIn, + kCGBlendModeDestinationOut, + kCGBlendModeDestinationAtop, + kCGBlendModeXOR, }; for (i = 0; i < numberOfImages; i++) { diff --git a/testing/Examples/Quartz2D/DemoGradient.m b/testing/Examples/Quartz2D/DemoGradient.m index f2cfb2b6..f33f99bd 100644 --- a/testing/Examples/Quartz2D/DemoGradient.m +++ b/testing/Examples/Quartz2D/DemoGradient.m @@ -36,17 +36,17 @@ void blackToGreen(void *info, const float *in, float *output) { CGFunctionCallbacks axialCallbacks = {0, blackToRed, NULL}; CGFunctionCallbacks radialCallbacks = {0, blackToGreen, NULL}; CGFunctionRef axialFunction = - CGFunctionCreate(self, 1, domain, 4, range, &axialCallbacks); + CGFunctionCreate(self, 1, domain, 4, range, &axialCallbacks); CGFunctionRef radialFunction = - CGFunctionCreate(self, 1, domain, 4, range, &radialCallbacks); + CGFunctionCreate(self, 1, domain, 4, range, &radialCallbacks); CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGShadingRef axial = - CGShadingCreateAxial(colorSpace, CGPointMake(0, 0), CGPointMake(1, 1), - axialFunction, YES, YES); + CGShadingCreateAxial(colorSpace, CGPointMake(0, 0), + CGPointMake(1, 1), axialFunction, YES, YES); CGShadingRef radial = CGShadingCreateRadial( - colorSpace, CGPointMake(0.5, 0.75), 0, CGPointMake(0.5, 0.5), 0.3, - radialFunction, YES, YES); + colorSpace, CGPointMake(0.5, 0.75), 0, CGPointMake(0.5, 0.5), 0.3, + radialFunction, YES, YES); CGContextDrawShading(context, axial); CGContextDrawShading(context, radial); diff --git a/testing/Examples/Quartz2D/DemoPattern.m b/testing/Examples/Quartz2D/DemoPattern.m index de7c7174..d01ab48e 100644 --- a/testing/Examples/Quartz2D/DemoPattern.m +++ b/testing/Examples/Quartz2D/DemoPattern.m @@ -33,12 +33,12 @@ static void drawPattern(void *info, CGContextRef ctxt) { - (void) renderInContext: (CGContextRef) context { CGPatternCallbacks callbacks = {0, drawPattern, NULL}; CGPatternRef pattern = CGPatternCreate( - self, CGRectMake(0, 0, 1, 1), CGAffineTransformMakeScale(100, 100), 0.5, - 0.5, kCGPatternTilingNoDistortion, YES, &callbacks); + self, CGRectMake(0, 0, 1, 1), CGAffineTransformMakeScale(100, 100), + 0.5, 0.5, kCGPatternTilingNoDistortion, YES, &callbacks); CGColorSpaceRef colorSpace = CGColorSpaceCreatePattern(NULL); CGFloat components[1] = {1}; CGColorRef color = - CGColorCreateWithPattern(colorSpace, pattern, components); + CGColorCreateWithPattern(colorSpace, pattern, components); CGContextSaveGState(context); diff --git a/testing/Examples/Quartz2D/DemoPorterDuff.m b/testing/Examples/Quartz2D/DemoPorterDuff.m index 8cc3cd54..0582c4ee 100644 --- a/testing/Examples/Quartz2D/DemoPorterDuff.m +++ b/testing/Examples/Quartz2D/DemoPorterDuff.m @@ -13,17 +13,17 @@ - (void) renderInContext: (CGContextRef) context { int i, numberOfModes = 11; CGBlendMode modes[] = { - kCGBlendModeNormal, - kCGBlendModeClear, - kCGBlendModeCopy, - kCGBlendModeSourceIn, - kCGBlendModeSourceOut, - kCGBlendModeSourceAtop, - kCGBlendModeDestinationOver, - kCGBlendModeDestinationIn, - kCGBlendModeDestinationOut, - kCGBlendModeDestinationAtop, - kCGBlendModeXOR, + kCGBlendModeNormal, + kCGBlendModeClear, + kCGBlendModeCopy, + kCGBlendModeSourceIn, + kCGBlendModeSourceOut, + kCGBlendModeSourceAtop, + kCGBlendModeDestinationOver, + kCGBlendModeDestinationIn, + kCGBlendModeDestinationOut, + kCGBlendModeDestinationAtop, + kCGBlendModeXOR, }; CGFloat height = 1.0 / numberOfModes; diff --git a/testing/Examples/Quartz2D/DemoSoftMask.m b/testing/Examples/Quartz2D/DemoSoftMask.m index 2bea723f..bd1b5a41 100644 --- a/testing/Examples/Quartz2D/DemoSoftMask.m +++ b/testing/Examples/Quartz2D/DemoSoftMask.m @@ -17,7 +17,7 @@ bytes[0] = 128; CGDataProviderRef provider = - CGDataProviderCreateWithData(NULL, bytes, 1, NULL); + CGDataProviderCreateWithData(NULL, bytes, 1, NULL); _mask = CGImageMaskCreate(1, 1, 8, 8, 1, provider, NULL, YES); _maskedImage = CGImageCreateWithMask(_image, _mask); diff --git a/testing/Examples/Quartz2D/DemoWindingRules.m b/testing/Examples/Quartz2D/DemoWindingRules.m index 3055ac5a..8f6305a3 100644 --- a/testing/Examples/Quartz2D/DemoWindingRules.m +++ b/testing/Examples/Quartz2D/DemoWindingRules.m @@ -26,7 +26,7 @@ CGContextSetLineWidth(context, 0.01); for (i = 0; i < numberOfCircles; i++) { CGContextAddEllipseInRect( - context, CGRectMake(x, y, delta, yDelta - yDelta * 0.1)); + context, CGRectMake(x, y, delta, yDelta - yDelta * 0.1)); x += delta / 1.5; } CGContextDrawPath(context, mode); diff --git a/testing/Examples/TextEditor/MyDocument.m b/testing/Examples/TextEditor/MyDocument.m index c1146f0a..6efdecaa 100644 --- a/testing/Examples/TextEditor/MyDocument.m +++ b/testing/Examples/TextEditor/MyDocument.m @@ -40,7 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (NSData *) dataRepresentationOfType: (NSString *) aType { return [[[_textView textStorage] string] - dataUsingEncoding: NSISOLatin1StringEncoding]; + dataUsingEncoding: NSISOLatin1StringEncoding]; } - (BOOL) loadDataRepresentation: (NSData *) data ofType: (NSString *) aType { diff --git a/testing/OnyxPDFRasterizer/OnyxPDFRasterizer.m b/testing/OnyxPDFRasterizer/OnyxPDFRasterizer.m index 26175327..e6880524 100644 --- a/testing/OnyxPDFRasterizer/OnyxPDFRasterizer.m +++ b/testing/OnyxPDFRasterizer/OnyxPDFRasterizer.m @@ -12,7 +12,7 @@ void usage() { int main(int argc, const char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *path = - [[NSUserDefaults standardUserDefaults] stringForKey: @"Path"]; + [[NSUserDefaults standardUserDefaults] stringForKey: @"Path"]; if (path == nil) usage(); @@ -20,7 +20,7 @@ int main(int argc, const char *argv[]) { NSData *pdf = [NSData dataWithContentsOfFile: path]; O2DataProviderRef provider = O2DataProviderCreateWithCFData(pdf); O2PDFDocument *document = - [[O2PDFDocument alloc] initWithDataProvider: provider]; + [[O2PDFDocument alloc] initWithDataProvider: provider]; int i, pageCount = [document pageCount]; O2ColorSpaceRef rgbColor = O2ColorSpaceCreateDeviceRGB(); @@ -41,8 +41,8 @@ int main(int argc, const char *argv[]) { } context = O2BitmapContextCreate( - NULL, mediaBox.size.width, mediaBox.size.height, 8, 0, rgbColor, - kO2ImageAlphaPremultipliedFirst | kO2BitmapByteOrder32Host); + NULL, mediaBox.size.width, mediaBox.size.height, 8, 0, rgbColor, + kO2ImageAlphaPremultipliedFirst | kO2BitmapByteOrder32Host); if (context == NULL) { NSLog(@"Unable to create context for media box %f %f", diff --git a/testing/SWRender/CoreGraphics_KG.h b/testing/SWRender/CoreGraphics_KG.h index 8cd0291e..e0bda868 100644 --- a/testing/SWRender/CoreGraphics_KG.h +++ b/testing/SWRender/CoreGraphics_KG.h @@ -77,7 +77,7 @@ #define CGContextAddEllipseInRect O2ContextAddEllipseInRect #define CGContextAddPath O2ContextAddPath #define CGContextReplacePathWithStrokedPath \ - O2ContextReplacePathWithStrokedPath + O2ContextReplacePathWithStrokedPath #define CGContextSaveGState O2ContextSaveGState #define CGContextRestoreGState O2ContextRestoreGState #define CGContextGetUserSpaceToDeviceSpaceTransform \ diff --git a/testing/SWRender/DemosTemplate.m b/testing/SWRender/DemosTemplate.m index 6f173b7f..b306108d 100644 --- a/testing/SWRender/DemosTemplate.m +++ b/testing/SWRender/DemosTemplate.m @@ -87,8 +87,8 @@ static CGColorRef createCGColor(float r, float g, float b, float a) { _dashLengths = NSZoneMalloc([self zone], sizeof(float) * 4); NSLog(@"%s %d", __FILE__, __LINE__); - CGDataProviderRef provider = - CGDataProviderCreateWithFilename("/Library/Fonts/Times New Roman.ttf"); + CGDataProviderRef provider = CGDataProviderCreateWithFilename( + "/Library/Fonts/Times New Roman.ttf"); if (provider == NULL) NSLog(@"PROVIDER FAILED"); @@ -99,19 +99,19 @@ static CGColorRef createCGColor(float r, float g, float b, float a) { CGDataProviderRelease(provider); NSString *path = - [[NSBundle bundleForClass: [self class]] pathForResource: @"pattern" - ofType: @"jpg"]; + [[NSBundle bundleForClass: [self class]] pathForResource: @"pattern" + ofType: @"jpg"]; // NSString *path=[[NSBundle bundleForClass:[self class]] // pathForResource:@"redLZWSquare" ofType:@"tif"]; NSData *data = [NSData dataWithContentsOfFile: path]; CGImageSourceRef source = - CGImageSourceCreateWithData((CFDataRef) data, nil); + CGImageSourceCreateWithData((CFDataRef) data, nil); _resamplingImage = CGImageSourceCreateImageAtIndex(source, 0, nil); NSLog(@"%s %d", __FILE__, __LINE__); [(id) source release]; NSMutableData *tiff = [NSMutableData data]; CGImageDestinationRef destination = CGImageDestinationCreateWithData( - (CFMutableDataRef) tiff, (CFStringRef) @"public.tiff", 1, NULL); + (CFMutableDataRef) tiff, (CFStringRef) @"public.tiff", 1, NULL); CGImageDestinationAddImage(destination, _resamplingImage, NULL); #if 0 CGImageDestinationFinalize(destination); @@ -251,7 +251,7 @@ static CGColorRef createCGColor(float r, float g, float b, float a) { - (void) setImageData: (NSData *) data { CGImageSourceRef source = - CGImageSourceCreateWithData((CFDataRef) data, nil); + CGImageSourceCreateWithData((CFDataRef) data, nil); _resamplingImage = CGImageSourceCreateImageAtIndex(source, 0, nil); } @@ -260,7 +260,7 @@ static CGColorRef createCGColor(float r, float g, float b, float a) { CGPDFDocumentRelease(_pdfDocument); CGDataProviderRef provider = - CGDataProviderCreateWithCFData((CFDataRef) data); + CGDataProviderCreateWithCFData((CFDataRef) data); _pdfDocument = CGPDFDocumentCreateWithProvider(provider); CGDataProviderRelease(provider); @@ -294,11 +294,13 @@ static void addSliceToPath(CGMutablePathRef path, float innerRadius, CGPoint point; point = CGPointApplyAffineTransform( - CGPointMake(outerRadius, 0), CGAffineTransformMakeRotation(startAngle)); + CGPointMake(outerRadius, 0), + CGAffineTransformMakeRotation(startAngle)); CGPathMoveToPoint(path, NULL, point.x, point.y); CGPathAddArc(path, NULL, 0, 0, outerRadius, startAngle, endAngle, NO); point = CGPointApplyAffineTransform( - CGPointMake(innerRadius, 0), CGAffineTransformMakeRotation(endAngle)); + CGPointMake(innerRadius, 0), + CGAffineTransformMakeRotation(endAngle)); CGPathAddLineToPoint(path, NULL, point.x, point.y); CGPathAddArc(path, NULL, 0, 0, innerRadius, endAngle, startAngle, YES); CGPathCloseSubpath(path); @@ -348,8 +350,8 @@ static void addSliceToPath(CGMutablePathRef path, float innerRadius, CGAffineTransform ctm = [self ctm]; CGAffineTransform t = CGAffineTransformMakeTranslation( - -(int) CGImageGetWidth(_resamplingImage) / 2, - -(int) CGImageGetHeight(_resamplingImage) / 2); + -(int) CGImageGetWidth(_resamplingImage) / 2, + -(int) CGImageGetHeight(_resamplingImage) / 2); ctm = CGAffineTransformConcat(t, ctm); // ctm=CGAffineTransformScale(ctm,2,2); @@ -543,10 +545,10 @@ static void evaluate(void *info, const float *in, float *output) { function = CGFunctionCreate(self, 1, domain, 4, range, &callbacks); shading = CGShadingCreateRadial( - CGColorSpaceCreateDeviceRGB(), - CGPointMake(_startPoint.x, _startPoint.y), _startRadius, - CGPointMake(_endPoint.x, _endPoint.y), _endRadius, function, - _extendStart, _extendEnd); + CGColorSpaceCreateDeviceRGB(), + CGPointMake(_startPoint.x, _startPoint.y), _startRadius, + CGPointMake(_endPoint.x, _endPoint.y), _endRadius, function, + _extendStart, _extendEnd); CGContextDrawShading(_context, shading); CGShadingRelease(shading); @@ -631,18 +633,18 @@ static void drawPattern(void *info, CGContextRef ctxt) { - (void) drawPattern { CGPatternCallbacks callbacks = {0, drawPattern, NULL}; CGPatternRef pattern = CGPatternCreate( - NULL, CGRectMake(0, 0, 10, 10), CGAffineTransformIdentity, 10, 10, - kCGPatternTilingNoDistortion, YES, &callbacks); + NULL, CGRectMake(0, 0, 10, 10), CGAffineTransformIdentity, 10, 10, + kCGPatternTilingNoDistortion, YES, &callbacks); CGColorSpaceRef colorSpace = CGColorSpaceCreatePattern(NULL); CGFloat components[4] = {1}; CGColorRef color = - CGColorCreateWithPattern(colorSpace, pattern, components); + CGColorCreateWithPattern(colorSpace, pattern, components); #ifdef USING_QUARTZ2DX CGContextRef save = _context; CGRect media = CGRectMake(0, 0, 400, 400); _context = CGPDFContextCreateWithURL( - [NSURL fileURLWithPath: @"/tmp/foo.pdf"], &media, NULL); + [NSURL fileURLWithPath: @"/tmp/foo.pdf"], &media, NULL); CGPDFContextBeginPage(_context, NULL); #endif CGContextSaveGState(_context); diff --git a/testing/SWRender/KGImageView.m b/testing/SWRender/KGImageView.m index fba30807..44d80868 100644 --- a/testing/SWRender/KGImageView.m +++ b/testing/SWRender/KGImageView.m @@ -30,7 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - (void) drawRect: (NSRect) rect { CGContextRef context = - (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; + (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; [[NSColor blackColor] set]; NSRectFill([self bounds]); diff --git a/testing/SWRender/KGRender.h b/testing/SWRender/KGRender.h index 7950220f..351b8d10 100644 --- a/testing/SWRender/KGRender.h +++ b/testing/SWRender/KGRender.h @@ -30,27 +30,27 @@ - (void) clear; - (void) drawPath: (CGPathRef) path - drawingMode: (CGPathDrawingMode) drawingMode - blendMode: (CGBlendMode) blendMode - interpolationQuality: (CGInterpolationQuality) interpolationQuality - fillColor: (NSColor *) fillColor - strokeColor: (NSColor *) strokeColor - lineWidth: (float) lineWidth - lineCap: (CGLineCap) lineCap - lineJoin: (CGLineJoin) lineJoin - miterLimit: (float) miterLimit - dashPhase: (float) dashPhase - dashLengthsCount: (unsigned) dashLengthsCount - dashLengths: (float *) dashLengths - flatness: (float) flatness - transform: (CGAffineTransform) xform - antialias: (BOOL) antialias; + drawingMode: (CGPathDrawingMode) drawingMode + blendMode: (CGBlendMode) blendMode + interpolationQuality: (CGInterpolationQuality) interpolationQuality + fillColor: (NSColor *) fillColor + strokeColor: (NSColor *) strokeColor + lineWidth: (float) lineWidth + lineCap: (CGLineCap) lineCap + lineJoin: (CGLineJoin) lineJoin + miterLimit: (float) miterLimit + dashPhase: (float) dashPhase + dashLengthsCount: (unsigned) dashLengthsCount + dashLengths: (float *) dashLengths + flatness: (float) flatness + transform: (CGAffineTransform) xform + antialias: (BOOL) antialias; - (void) drawBitmapImageRep: (NSBitmapImageRep *) imageRep - antialias: (BOOL) antialias - interpolationQuality: (CGInterpolationQuality) interpolationQuality - blendMode: (CGBlendMode) blendMode - fillColor: (NSColor *) fillColor - transform: (CGAffineTransform) xform; + antialias: (BOOL) antialias + interpolationQuality: (CGInterpolationQuality) interpolationQuality + blendMode: (CGBlendMode) blendMode + fillColor: (NSColor *) fillColor + transform: (CGAffineTransform) xform; @end diff --git a/testing/SWRender/KGRender.m b/testing/SWRender/KGRender.m index bc1f0379..4603839b 100644 --- a/testing/SWRender/KGRender.m +++ b/testing/SWRender/KGRender.m @@ -32,11 +32,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _data = NSZoneMalloc([self zone], _bytesPerRow * _pixelsHigh); CGDataProviderRef provider = CGDataProviderCreateWithData( - NULL, _data, _pixelsWide * _pixelsHigh * 4, NULL); + NULL, _data, _pixelsWide * _pixelsHigh * 4, NULL); _imageRef = CGImageCreate(_pixelsWide, _pixelsHigh, _bitsPerComponent, _bitsPerPixel, _bytesPerRow, _colorSpace, kCGImageAlphaPremultipliedLast | - kCGBitmapByteOrder32Little, + kCGBitmapByteOrder32Little, provider, NULL, NO, kCGRenderingIntentDefault); return self; } @@ -56,7 +56,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } CGDataProviderRef provider = CGDataProviderCreateWithData( - NULL, diff, _pixelsWide * _pixelsHigh * 4, NULL); + NULL, diff, _pixelsWide * _pixelsHigh * 4, NULL); return CGImageCreate(_pixelsWide, _pixelsHigh, _bitsPerComponent, _bitsPerPixel, _bytesPerRow, _colorSpace, kCGBitmapByteOrder32Little, provider, NULL, NO, @@ -78,31 +78,31 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) drawPath: (CGPathRef) path - drawingMode: (CGPathDrawingMode) drawingMode - blendMode: (CGBlendMode) blendMode - interpolationQuality: (CGInterpolationQuality) interpolationQuality - fillColor: (NSColor *) fillColor - strokeColor: (NSColor *) strokeColor - lineWidth: (float) lineWidth - lineCap: (CGLineCap) lineCap - lineJoin: (CGLineJoin) lineJoin - miterLimit: (float) miterLimit - dashPhase: (float) dashPhase - dashLengthsCount: (unsigned) dashLengthsCount - dashLengths: (float *) dashLengths - flatness: (float) flatness - transform: (CGAffineTransform) xform - antialias: (BOOL) antialias + drawingMode: (CGPathDrawingMode) drawingMode + blendMode: (CGBlendMode) blendMode + interpolationQuality: (CGInterpolationQuality) interpolationQuality + fillColor: (NSColor *) fillColor + strokeColor: (NSColor *) strokeColor + lineWidth: (float) lineWidth + lineCap: (CGLineCap) lineCap + lineJoin: (CGLineJoin) lineJoin + miterLimit: (float) miterLimit + dashPhase: (float) dashPhase + dashLengthsCount: (unsigned) dashLengthsCount + dashLengths: (float *) dashLengths + flatness: (float) flatness + transform: (CGAffineTransform) xform + antialias: (BOOL) antialias { [self doesNotRecognizeSelector: _cmd]; } - (void) drawBitmapImageRep: (NSBitmapImageRep *) imageRep - antialias: (BOOL) antialias - interpolationQuality: (CGInterpolationQuality) interpolationQuality - blendMode: (CGBlendMode) blendMode - fillColor: (NSColor *) fillColor - transform: (CGAffineTransform) xform + antialias: (BOOL) antialias + interpolationQuality: (CGInterpolationQuality) interpolationQuality + blendMode: (CGBlendMode) blendMode + fillColor: (NSColor *) fillColor + transform: (CGAffineTransform) xform { [self doesNotRecognizeSelector: _cmd]; } diff --git a/testing/SWRender/KGRenderController.m b/testing/SWRender/KGRenderController.m index bc838141..aeb923a2 100644 --- a/testing/SWRender/KGRenderController.m +++ b/testing/SWRender/KGRenderController.m @@ -92,14 +92,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_cgContext != nil) { provider = CGDataProviderCreateWithData( - NULL, [_cgContext bytes], - [_cgContext bytesPerRow] * [_cgContext pixelsHigh], NULL); + NULL, [_cgContext bytes], + [_cgContext bytesPerRow] * [_cgContext pixelsHigh], NULL); image = CGImageCreate( - [_cgContext pixelsWide], [_cgContext pixelsHigh], - [_cgContext bitsPerComponent], [_cgContext bitsPerPixel], - [_cgContext bytesPerRow], CGColorSpaceCreateDeviceRGB(), - [_cgContext bitmapInfo], provider, NULL, NO, - kCGRenderingIntentDefault); + [_cgContext pixelsWide], [_cgContext pixelsHigh], + [_cgContext bitsPerComponent], [_cgContext bitsPerPixel], + [_cgContext bytesPerRow], CGColorSpaceCreateDeviceRGB(), + [_cgContext bitmapInfo], provider, NULL, NO, + kCGRenderingIntentDefault); CGDataProviderRelease(provider); [_cgView setImageRef: image]; CGImageRelease(image); @@ -107,14 +107,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if (_kgContext != nil) { provider = CGDataProviderCreateWithData( - NULL, [_kgContext bytes], - [_kgContext bytesPerRow] * [_kgContext pixelsHigh], NULL); + NULL, [_kgContext bytes], + [_kgContext bytesPerRow] * [_kgContext pixelsHigh], NULL); image = CGImageCreate( - [_kgContext pixelsWide], [_kgContext pixelsHigh], - [_kgContext bitsPerComponent], [_kgContext bitsPerPixel], - [_kgContext bytesPerRow], CGColorSpaceCreateDeviceRGB(), - [_kgContext bitmapInfo], provider, NULL, NO, - kCGRenderingIntentDefault); + [_kgContext pixelsWide], [_kgContext pixelsHigh], + [_kgContext bitsPerComponent], [_kgContext bitsPerPixel], + [_kgContext bytesPerRow], CGColorSpaceCreateDeviceRGB(), + [_kgContext bitmapInfo], provider, NULL, NO, + kCGRenderingIntentDefault); CGDataProviderRelease(provider); [_kgView setImageRef: image]; CGImageRelease(image); @@ -124,8 +124,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ unsigned char *cgData = [_cgContext bytes]; unsigned char *kgData = [_kgContext bytes]; - NSMutableData *diffData = [NSMutableData - dataWithLength: [_kgContext bytesPerRow] * [_kgContext pixelsHigh]]; + NSMutableData *diffData = + [NSMutableData dataWithLength: [_kgContext bytesPerRow] * + [_kgContext pixelsHigh]]; char *diff = [diffData mutableBytes]; int i, max = [_kgContext bytesPerRow] * [_kgContext pixelsHigh]; @@ -140,13 +141,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ diff[i] = (d1 != d2) ? ABS(d1 - d2) : 00; } CGDataProviderRef provider = - CGDataProviderCreateWithCFData((CFDataRef) diffData); + CGDataProviderCreateWithCFData((CFDataRef) diffData); CGImageRef diffImage = CGImageCreate( - [_cgContext pixelsWide], [_cgContext pixelsHigh], - [_cgContext bitsPerComponent], [_cgContext bitsPerPixel], - [_cgContext bytesPerRow], CGColorSpaceCreateDeviceRGB(), - [_kgContext bitmapInfo], provider, NULL, NO, - kCGRenderingIntentDefault); + [_cgContext pixelsWide], [_cgContext pixelsHigh], + [_cgContext bitsPerComponent], [_cgContext bitsPerPixel], + [_cgContext bytesPerRow], CGColorSpaceCreateDeviceRGB(), + [_kgContext bitmapInfo], provider, NULL, NO, + kCGRenderingIntentDefault); [_diffView setImageRef: diffImage]; CGDataProviderRelease(provider); CGImageRelease(diffImage); @@ -333,8 +334,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (void) selectInterpolationQuality: sender { - [self - setInterpolationQuality: (CGInterpolationQuality)[sender selectedTag]]; + [self setInterpolationQuality: (CGInterpolationQuality) + [sender selectedTag]]; [self setNeedsDisplay]; } @@ -374,20 +375,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ } - (BOOL) outlineView: (NSOutlineView *) outlineView - isItemExpandable: (id) item + isItemExpandable: (id) item { return [item isEqual: @"expand"]; } - (NSInteger) outlineView: (NSOutlineView *) outlineView - numberOfChildrenOfItem: (id) item + numberOfChildrenOfItem: (id) item { return 10; } - (id) outlineView: (NSOutlineView *) outlineView - objectValueForTableColumn: (NSTableColumn *) tableColumn - byItem: (id) item + objectValueForTableColumn: (NSTableColumn *) tableColumn + byItem: (id) item { return @"bar"; } diff --git a/testing/UnitTests/Array.m b/testing/UnitTests/Array.m index 26fb6a37..2de192e3 100644 --- a/testing/UnitTests/Array.m +++ b/testing/UnitTests/Array.m @@ -55,12 +55,13 @@ for (int i = 0; i < 100; i++) { [array _insertObject: [NSNumber numberWithInt: rand()] - inArraySortedByDescriptors: descArray]; + inArraySortedByDescriptors: descArray]; id other = [array mutableCopy]; [other sortUsingDescriptors: descArray]; STAssertEqualObjects( - array, other, @"sorted array not equal to array after insertion"); + array, other, + @"sorted array not equal to array after insertion"); [other release]; } diff --git a/testing/UnitTests/Bindings/NibBasedTest.m b/testing/UnitTests/Bindings/NibBasedTest.m index 2c949cbd..be5bb07b 100644 --- a/testing/UnitTests/Bindings/NibBasedTest.m +++ b/testing/UnitTests/Bindings/NibBasedTest.m @@ -30,8 +30,8 @@ - (void) setUp { id nib = [[NSNib alloc] - initWithNibNamed: [self className] - bundle: [NSBundle bundleForClass: [self class]]]; + initWithNibNamed: [self className] + bundle: [NSBundle bundleForClass: [self class]]]; [nib instantiateNibWithOwner: self topLevelObjects: &_topLevelObjects]; [_topLevelObjects retain]; diff --git a/testing/UnitTests/Bindings/ObservableArray.m b/testing/UnitTests/Bindings/ObservableArray.m index 190a8078..e2892fe7 100644 --- a/testing/UnitTests/Bindings/ObservableArray.m +++ b/testing/UnitTests/Bindings/ObservableArray.m @@ -35,30 +35,30 @@ void *ObservableArrayTestContext; return; [_array addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"First", @"name", - [NSNumber - numberWithInt: 10], - @"value", nil]]; + dictionaryWithObjectsAndKeys: + @"First", @"name", + [NSNumber numberWithInt: 10], @"value", + nil]]; [_array addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Second", @"name", - [NSNumber - numberWithInt: 20], - @"value", nil]]; + dictionaryWithObjectsAndKeys: + @"Second", @"name", + [NSNumber numberWithInt: 20], @"value", + nil]]; [_array addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Third", @"name", - [NSNumber - numberWithInt: 30], - @"value", nil]]; + dictionaryWithObjectsAndKeys: + @"Third", @"name", + [NSNumber numberWithInt: 30], @"value", + nil]]; [_array addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Fourth", @"name", - [NSNumber - numberWithInt: 40], - @"value", nil]]; + dictionaryWithObjectsAndKeys: + @"Fourth", @"name", + [NSNumber numberWithInt: 40], @"value", + nil]]; [_array addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Fifth", @"name", - [NSNumber - numberWithInt: 50], - @"value", nil]]; + dictionaryWithObjectsAndKeys: + @"Fifth", @"name", + [NSNumber numberWithInt: 50], @"value", + nil]]; } - (void) testArrayMutation { @@ -71,10 +71,10 @@ void *ObservableArrayTestContext; context: &ObservableArrayTestContext]; [_array addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Sixth", @"name", - [NSNumber - numberWithInt: 60], - @"value", nil]]; + dictionaryWithObjectsAndKeys: + @"Sixth", @"name", + [NSNumber numberWithInt: 60], @"value", + nil]]; AssertLastKeyWas(@"@count"); [_array removeLastObject]; @@ -83,10 +83,10 @@ void *ObservableArrayTestContext; [_array replaceObjectAtIndex: 3 withObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: - @"Sixth", @"name", - [NSNumber numberWithInt: 60], - @"value", nil]]; + dictionaryWithObjectsAndKeys: + @"Sixth", @"name", + [NSNumber numberWithInt: 60], + @"value", nil]]; AssertLastKeyWas(@"@count"); [_array removeObserver: self forKeyPath: @"@count"]; @@ -102,10 +102,10 @@ void *ObservableArrayTestContext; context: &ObservableArrayTestContext]; [_array addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Sixth", @"name", - [NSNumber - numberWithInt: 60], - @"value", nil]]; + dictionaryWithObjectsAndKeys: + @"Sixth", @"name", + [NSNumber numberWithInt: 60], @"value", + nil]]; AssertLastKeyWas(@"@avg.value"); @@ -144,7 +144,7 @@ void *ObservableArrayTestContext; context: &ObservableArrayTestContext]; id indexes = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(2, 2)]; id irrelevant = - [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, 2)]; + [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, 2)]; [irrelevant addIndexesInRange: NSMakeRange(4, [_array count] - 4)]; [_array setROI: indexes]; @@ -164,13 +164,12 @@ void *ObservableArrayTestContext; } [_array removeObjectAtIndex: 1]; - [_array - insertObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Sixth", @"name", - [NSNumber - numberWithInt: 60], - @"value", nil] - atIndex: 1]; + [_array insertObject: [NSMutableDictionary + dictionaryWithObjectsAndKeys: + @"Sixth", @"name", + [NSNumber numberWithInt: 60], + @"value", nil] + atIndex: 1]; for (int i = [indexes firstIndex]; i != NSNotFound; i = [indexes indexGreaterThanIndex: i]) { @@ -192,8 +191,8 @@ void *ObservableArrayTestContext; context: &ObservableArrayTestContext]; [_array removeObserver: self forKeyPath: @"value"]; - indexes = - [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [_array count])]; + indexes = [NSIndexSet + indexSetWithIndexesInRange: NSMakeRange(0, [_array count])]; for (int i = [irrelevant firstIndex]; i != NSNotFound; i = [irrelevant indexGreaterThanIndex: i]) { [[_array objectAtIndex: i] setValue: [NSNumber numberWithInt: 0] diff --git a/testing/UnitTests/Bindings/TableViewTest.m b/testing/UnitTests/Bindings/TableViewTest.m index 51540894..c7ec69f4 100644 --- a/testing/UnitTests/Bindings/TableViewTest.m +++ b/testing/UnitTests/Bindings/TableViewTest.m @@ -37,31 +37,26 @@ id table = [NSMutableArray array]; - [table addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Test", @"name", - [NSNumber - numberWithInt: 10], - @"value", nil]]; - [table addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Something", @"name", - [NSNumber - numberWithInt: 20], - @"value", nil]]; - [table addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Ultimate", @"name", - [NSNumber - numberWithInt: 30], - @"value", nil]]; - [table addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Nothing", @"name", - [NSNumber - numberWithInt: 40], - @"value", nil]]; - [table addObject: [NSMutableDictionary - dictionaryWithObjectsAndKeys: @"Abcdefg", @"name", - [NSNumber - numberWithInt: 50], - @"value", nil]]; + [table addObject: [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Test", @"name", + [NSNumber numberWithInt: 10], + @"value", nil]]; + [table addObject: [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Something", @"name", + [NSNumber numberWithInt: 20], + @"value", nil]]; + [table addObject: [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Ultimate", @"name", + [NSNumber numberWithInt: 30], + @"value", nil]]; + [table addObject: [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Nothing", @"name", + [NSNumber numberWithInt: 40], + @"value", nil]]; + [table addObject: [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Abcdefg", @"name", + [NSNumber numberWithInt: 50], + @"value", nil]]; self.table = table; } @@ -73,8 +68,9 @@ STAssertEqualObjects([cell objectValue], @"Test", nil); [_tableView - setSortDescriptors: [NSArray - arrayWithObject: [[[_tableView tableColumns] + setSortDescriptors: + [NSArray + arrayWithObject: [[[_tableView tableColumns] objectAtIndex: 0] sortDescriptorPrototype]]]; @@ -82,9 +78,9 @@ STAssertEqualObjects([cell objectValue], @"Abcdefg", nil); [_arrayController - setFilterPredicate: [NSPredicate - predicateWithFormat: @"name endswith %@", - @"thing"]]; + setFilterPredicate: + [NSPredicate predicateWithFormat: @"name endswith %@", + @"thing"]]; cell = [_tableView preparedCellAtColumn: 0 row: 0]; STAssertEqualObjects([cell objectValue], @"Nothing", nil); diff --git a/testing/UnitTests/Forwarding.m b/testing/UnitTests/Forwarding.m index 8e8884b5..1ccccf46 100644 --- a/testing/UnitTests/Forwarding.m +++ b/testing/UnitTests/Forwarding.m @@ -116,11 +116,11 @@ { beenInMethodFlag = YES; return [NSString - stringWithFormat: @"%i %i %i %i %i %i %i %i %i %i %i", (int) size.width, - (int) size.height, c, range.location, range.length, - (int) rect.origin.x, (int) rect.origin.y, - (int) rect.size.width, (int) rect.size.height, - (int) d, (int) l]; + stringWithFormat: @"%i %i %i %i %i %i %i %i %i %i %i", + (int) size.width, (int) size.height, c, + range.location, range.length, (int) rect.origin.x, + (int) rect.origin.y, (int) rect.size.width, + (int) rect.size.height, (int) d, (int) l]; } - (TestingStruct) returnTestingStructWithParam: (float) x { diff --git a/testing/UnitTests/KVO.m b/testing/UnitTests/KVO.m index 436eee2f..332077e9 100644 --- a/testing/UnitTests/KVO.m +++ b/testing/UnitTests/KVO.m @@ -40,7 +40,7 @@ - (void) setUp { [[self class] setKeys: [NSArray arrayWithObjects: @"someKey", @"someOtherKey", nil] - triggerChangeNotificationsForDependentKey: @"derived"]; + triggerChangeNotificationsForDependentKey: @"derived"]; dict = [NSMutableDictionary new]; } @@ -70,12 +70,12 @@ - (void) testDependencyKVOException { observerCalled = 0; - STAssertThrowsSpecificNamed([self - addObserver: self - forKeyPath: @"propertyWithBadDependencies" - options: 0 - context: nil], - NSException, NSUndefinedKeyException, nil); + STAssertThrowsSpecificNamed( + [self addObserver: self + forKeyPath: @"propertyWithBadDependencies" + options: 0 + context: nil], + NSException, NSUndefinedKeyException, nil); STAssertTrue([self observationInfo] == nil, nil); STAssertThrows([self removeObserver: self @@ -89,16 +89,16 @@ observerCalled = 0; STAssertThrowsSpecificNamed([self addObserver: self - forKeyPath: @"nonExisting.other" - options: 0 - context: nil], + forKeyPath: @"nonExisting.other" + options: 0 + context: nil], NSException, NSUndefinedKeyException, nil); STAssertTrue([self observationInfo] == nil, nil); STAssertNoThrowSpecificNamed([self addObserver: self - forKeyPath: @"nonExisting" - options: 0 - context: nil], + forKeyPath: @"nonExisting" + options: 0 + context: nil], NSException, NSUndefinedKeyException, nil); STAssertNoThrow([self removeObserver: self forKeyPath: @"nonExisting"], @@ -142,9 +142,9 @@ - (void) testDeepKVO { [self addObserver: self - forKeyPath: @"dict.someKey" - options: 0 - context: nil]; + forKeyPath: @"dict.someKey" + options: 0 + context: nil]; observerCalled = 0; [dict setObject: @"val1" forKey: @"someKey"]; @@ -178,9 +178,9 @@ [self removeObserver: self forKeyPath: @"derived"]; [self addObserver: self - forKeyPath: @"newStyleDerived" - options: 0 - context: nil]; + forKeyPath: @"newStyleDerived" + options: 0 + context: nil]; observerCalled = 0; [self setValue: @"val3" forKeyPath: @"dict.derivedProperty"]; diff --git a/testing/UnitTests/KeyedArchiving.m b/testing/UnitTests/KeyedArchiving.m index ef2f9b8a..3c205abc 100644 --- a/testing/UnitTests/KeyedArchiving.m +++ b/testing/UnitTests/KeyedArchiving.m @@ -67,16 +67,16 @@ // if you change the encoding of ArchivableClass, you need to uncomment the // line below, run on Apple-Darwin, then copy the resulting data file [data writeToFile: [@"~/ArchivableClass.keyedArchive" - stringByExpandingTildeInPath] - atomically: NO]; + stringByExpandingTildeInPath] + atomically: NO]; object = [NSKeyedUnarchiver unarchiveObjectWithData: data]; } - (void) testForeignDecoding { id paths = [[NSBundle bundleForClass: [self class]] - pathsForResourcesOfType: @"keyedArchive" - inDirectory: @""]; + pathsForResourcesOfType: @"keyedArchive" + inDirectory: @""]; for (id archiveName in paths) { id data = [NSData dataWithContentsOfFile: archiveName]; STAssertNotNil(data, @"Data file couldn't be opened"); diff --git a/testing/UnitTests/MessageSendTorture.m b/testing/UnitTests/MessageSendTorture.m index eaf36c36..1fec5f1a 100644 --- a/testing/UnitTests/MessageSendTorture.m +++ b/testing/UnitTests/MessageSendTorture.m @@ -48,12 +48,12 @@ extern id objc_msgSend(id self, SEL op, ...); didInit = YES; struct objc_method_list *list = - calloc(sizeof(struct objc_method_list) + - NUM_SELECTORS * sizeof(struct objc_method), - 1); + calloc(sizeof(struct objc_method_list) + + NUM_SELECTORS * sizeof(struct objc_method), + 1); list->method_count = NUM_SELECTORS; Method torture = - class_getInstanceMethod([self class], @selector(_torture_)); + class_getInstanceMethod([self class], @selector(_torture_)); for (int currentMethod = 0; currentMethod < NUM_SELECTORS; currentMethod++) { diff --git a/testing/UnitTests/OperationQueueTests.m b/testing/UnitTests/OperationQueueTests.m index 85e45dce..4acf664c 100644 --- a/testing/UnitTests/OperationQueueTests.m +++ b/testing/UnitTests/OperationQueueTests.m @@ -56,10 +56,10 @@ } - (void) testMaximumOperationCount; { - STAssertEquals( - [queue maxConcurrentOperationCount], - NSOperationQueueDefaultMaxConcurrentOperationCount, - @"Queue should initially have default max conncurrent operation count"); + STAssertEquals([queue maxConcurrentOperationCount], + NSOperationQueueDefaultMaxConcurrentOperationCount, + @"Queue should initially have default max conncurrent " + @"operation count"); int i; for (i = 1; i < 32; i++) { [queue setMaxConcurrentOperationCount: i]; @@ -73,8 +73,8 @@ [queue addOperation: operation]; [queue cancelAllOperations]; STAssertTrue( - [operation isCancelled], - @"Operation should be cancelled after Queue cancelAllOperations"); + [operation isCancelled], + @"Operation should be cancelled after Queue cancelAllOperations"); } - (void) watchRunningOperation; { @@ -87,8 +87,8 @@ STAssertFalse([operation isExecuting], @"Finished operation should not say it is executing"); STAssertEquals( - (NSUInteger) 1, [operation retainCount], - @"Operation should have a retain count of 1 after it is done"); + (NSUInteger) 1, [operation retainCount], + @"Operation should have a retain count of 1 after it is done"); } - (void) testRunning; { @@ -102,9 +102,9 @@ @"Initially there should be 0 operations in the array"); [queue addOperation: operation]; array = [queue operations]; - STAssertEquals( - (NSUInteger) 1, [array count], - @"After adding an operation there should be 1 operation in the array"); + STAssertEquals((NSUInteger) 1, [array count], + @"After adding an operation there should be 1 operation in " + @"the array"); STAssertEquals(operation, [array objectAtIndex: 0], @"The object in the array should be my operation object"); sleep(3); @@ -122,7 +122,7 @@ - (void) testRunningFromArrayWaiting; { [queue addOperations: [NSArray arrayWithObject: operation] - waitUntilFinished: YES]; + waitUntilFinished: YES]; STAssertTrue([operation isFinished], @"Operation should have been finnished"); } @@ -159,15 +159,15 @@ static NSString *const MyQueueName = @"MyQueueName"; - (void) testOperationPriority; { STAssertEquals( - NSOperationQueuePriorityNormal, [operation queuePriority], - @"Standard priority should be NSOperationQueuePriorityNormal"); + NSOperationQueuePriorityNormal, [operation queuePriority], + @"Standard priority should be NSOperationQueuePriorityNormal"); } static NSString *const observationContext = @"observationContext"; static void SleepWithRunloop(NSTimeInterval seconds) { [[NSRunLoop currentRunLoop] - runUntilDate: [NSDate dateWithTimeIntervalSinceNow: seconds]]; + runUntilDate: [NSDate dateWithTimeIntervalSinceNow: seconds]]; } - (void) testOperationExecutingKVO; { @@ -180,8 +180,8 @@ static void SleepWithRunloop(NSTimeInterval seconds) { SleepWithRunloop(1); STAssertEquals( - (NSUInteger) 1, observationCount, - @"Object added to queue, should have received 1 KVO notification"); + (NSUInteger) 1, observationCount, + @"Object added to queue, should have received 1 KVO notification"); SleepWithRunloop(2); STAssertEquals((NSUInteger) 2, observationCount, @"Should have received 2 KVO notification after done"); diff --git a/testing/UnitTests/Predicate.m b/testing/UnitTests/Predicate.m index 876b3bbd..dea30390 100644 --- a/testing/UnitTests/Predicate.m +++ b/testing/UnitTests/Predicate.m @@ -23,73 +23,76 @@ @implementation Predicate - (void) testPredicateParsing { id dict = [NSDictionary - dictionaryWithObjectsAndKeys: @"Something", @"name", - [NSNumber numberWithDouble: 17.5], - @"value", nil]; + dictionaryWithObjectsAndKeys: @"Something", @"name", + [NSNumber numberWithDouble: 17.5], + @"value", nil]; STAssertTrueNoThrow( - ([[NSPredicate predicateWithFormat: @"name contains %@", @"Some"] - evaluateWithObject: dict]), - nil); + ([[NSPredicate predicateWithFormat: @"name contains %@", @"Some"] + evaluateWithObject: dict]), + nil); STAssertTrueNoThrow( - ([[NSPredicate predicateWithFormat: @"name beginswith %@", @"Some"] - evaluateWithObject: dict]), - nil); + ([[NSPredicate predicateWithFormat: @"name beginswith %@", @"Some"] + evaluateWithObject: dict]), + nil); STAssertTrueNoThrow( - ([[NSPredicate predicateWithFormat: @"name endswith %@", @"thing"] - evaluateWithObject: dict]), - nil); + ([[NSPredicate predicateWithFormat: @"name endswith %@", @"thing"] + evaluateWithObject: dict]), + nil); STAssertTrueNoThrow( - (![[NSPredicate predicateWithFormat: @"name beginswith %@", @"None"] - evaluateWithObject: dict]), - nil); + (![[NSPredicate predicateWithFormat: @"name beginswith %@", @"None"] + evaluateWithObject: dict]), + nil); STAssertTrueNoThrow( - (![[NSPredicate predicateWithFormat: @"name endswith %@", @"None"] - evaluateWithObject: dict]), - nil); + (![[NSPredicate predicateWithFormat: @"name endswith %@", @"None"] + evaluateWithObject: dict]), + nil); STAssertTrueNoThrow( - (![[NSPredicate predicateWithFormat: @"name contains %@", @"None"] - evaluateWithObject: dict]), - nil); + (![[NSPredicate predicateWithFormat: @"name contains %@", @"None"] + evaluateWithObject: dict]), + nil); STAssertTrueNoThrow( - (![[NSPredicate predicateWithFormat: @"unavailable like %@", @"None"] - evaluateWithObject: dict]), - nil); + (![[NSPredicate + predicateWithFormat: @"unavailable like %@", @"None"] + evaluateWithObject: dict]), + nil); STAssertTrueNoThrow(([[NSPredicate predicateWithFormat: @"value < %f", 20.0] - evaluateWithObject: dict]), + evaluateWithObject: dict]), nil); STAssertTrueNoThrow(([[NSPredicate predicateWithFormat: @"value > %f", 17.3] - evaluateWithObject: dict]), + evaluateWithObject: dict]), nil); STAssertTrueNoThrow( - ([[NSPredicate predicateWithFormat: @"value between {%f, %f}", 15.0, - 20.0] evaluateWithObject: dict]), - nil); + ([[NSPredicate + predicateWithFormat: @"value between {%f, %f}", 15.0, 20.0] + evaluateWithObject: dict]), + nil); STAssertTrueNoThrow( - (![[NSPredicate predicateWithFormat: @"value between {%f, %f}", 20.0, - 25.0] evaluateWithObject: dict]), - nil); + (![[NSPredicate + predicateWithFormat: @"value between {%f, %f}", 20.0, 25.0] + evaluateWithObject: dict]), + nil); STAssertTrueNoThrow( - ([[NSPredicate predicateWithFormat: @"self == %@", @"Hello"] - evaluateWithObject: @"Hello"]), - nil); + ([[NSPredicate predicateWithFormat: @"self == %@", @"Hello"] + evaluateWithObject: @"Hello"]), + nil); STAssertTrueNoThrow( - (![[NSPredicate predicateWithFormat: @"self != %@", @"Hello"] - evaluateWithObject: @"Hello"]), - nil); + (![[NSPredicate predicateWithFormat: @"self != %@", @"Hello"] + evaluateWithObject: @"Hello"]), + nil); STAssertTrueNoThrow( - ([[NSPredicate predicateWithFormat: @"self like %@", @"H?llo"] - evaluateWithObject: @"Hello"]), - nil); + ([[NSPredicate predicateWithFormat: @"self like %@", @"H?llo"] + evaluateWithObject: @"Hello"]), + nil); STAssertTrueNoThrow( - ([[NSPredicate predicateWithFormat: @"NOT (self == %@)", @"Hello"] - evaluateWithObject: @"Jello"]), - nil); + ([[NSPredicate predicateWithFormat: @"NOT (self == %@)", @"Hello"] + evaluateWithObject: @"Jello"]), + nil); STAssertTrueNoThrow( - ([[NSPredicate predicateWithFormat: @"self == \"Hello\""] - evaluateWithObject: @"Hello"]), - nil); + ([[NSPredicate predicateWithFormat: @"self == \"Hello\""] + evaluateWithObject: @"Hello"]), + nil); } @end diff --git a/testing/UnitTests/Properties.m b/testing/UnitTests/Properties.m index 9fc76cb9..b3323529 100644 --- a/testing/UnitTests/Properties.m +++ b/testing/UnitTests/Properties.m @@ -27,8 +27,8 @@ - (NSMethodSignature *) methodSignatureForSelector: (SEL) aSelector { if (aSelector == @selector(fullName)) { - return - [self methodSignatureForSelector: @selector(replacementFullName)]; + return [self + methodSignatureForSelector: @selector(replacementFullName)]; } return [super methodSignatureForSelector: aSelector]; } diff --git a/testing/UnitTests/PropertyListUnarchiving.m b/testing/UnitTests/PropertyListUnarchiving.m index 210e23b9..f4403136 100644 --- a/testing/UnitTests/PropertyListUnarchiving.m +++ b/testing/UnitTests/PropertyListUnarchiving.m @@ -44,23 +44,23 @@ id error = nil; NSInteger format = NSPropertyListBinaryFormat_v1_0; id path = - [[NSBundle bundleForClass: [self class]] pathForResource: @"Binary" - ofType: @"plist"]; + [[NSBundle bundleForClass: [self class]] pathForResource: @"Binary" + ofType: @"plist"]; STAssertNotNil(path, @"Data file not found"); id data = [NSData dataWithContentsOfFile: path]; STAssertNotNil(data, @"Data file couldn't be opened"); id plist = [NSPropertyListSerialization - propertyListFromData: data - mutabilityOption: NSPropertyListImmutable - format: (NSUInteger *) &format - errorDescription: &error]; + propertyListFromData: data + mutabilityOption: NSPropertyListImmutable + format: (NSUInteger *) &format + errorDescription: &error]; STAssertNotNil(plist, error); STAssertEquals(format, NSPropertyListBinaryFormat_v1_0, nil); STAssertEqualObjects( - [[self class] sampleList], plist, - @"Property list unarchived but doesn't match sample list"); + [[self class] sampleList], plist, + @"Property list unarchived but doesn't match sample list"); } - (void) testFailureCase { @@ -69,11 +69,11 @@ NSInteger format = 0; id plist = nil; STAssertNoThrow(plist = [NSPropertyListSerialization - propertyListFromData: [NSData dataWithBytes: data - length: 5] - mutabilityOption: NSPropertyListImmutable - format: (NSUInteger *) &format - errorDescription: &error], + propertyListFromData: [NSData dataWithBytes: data + length: 5] + mutabilityOption: NSPropertyListImmutable + format: (NSUInteger *) &format + errorDescription: &error], nil); STAssertTrue(plist == nil, nil); } @@ -81,22 +81,22 @@ - (void) testXML { id error = nil; NSInteger format = 0; - id data = - [NSData dataWithContentsOfFile: [[NSBundle bundleForClass: [self class]] + id data = [NSData + dataWithContentsOfFile: [[NSBundle bundleForClass: [self class]] pathForResource: @"XML" ofType: @"plist"]]; STAssertNotNil(data, @"Data file not found"); id plist = [NSPropertyListSerialization - propertyListFromData: data - mutabilityOption: NSPropertyListImmutable - format: (NSUInteger *) &format - errorDescription: &error]; + propertyListFromData: data + mutabilityOption: NSPropertyListImmutable + format: (NSUInteger *) &format + errorDescription: &error]; STAssertNotNil(plist, error); STAssertEquals(format, NSPropertyListXMLFormat_v1_0, nil); STAssertEqualObjects( - plist, [[self class] sampleList], - @"Property list unarchived but doesn't match sample list"); + plist, [[self class] sampleList], + @"Property list unarchived but doesn't match sample list"); } @end diff --git a/testing/UnitTests/Runloop.m b/testing/UnitTests/Runloop.m index a0773b80..b394905b 100644 --- a/testing/UnitTests/Runloop.m +++ b/testing/UnitTests/Runloop.m @@ -50,7 +50,7 @@ while (![self isCancelled]) { id pool2 = [NSAutoreleasePool new]; [runLoop runMode: NSDefaultRunLoopMode - beforeDate: [NSDate distantFuture]]; + beforeDate: [NSDate distantFuture]]; __sync_add_and_fetch(&_loopCount, 1); [pool2 drain]; }