cocoa 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +1 -0
- data/VERSION +1 -1
- data/cocoa.gemspec +11 -5
- data/examples/table_view.rb +72 -0
- data/lib/cocoa/bindings/CAConstraint.rb +2 -2
- data/lib/cocoa/bindings/CALayer.rb +6 -6
- data/lib/cocoa/bindings/CAMediaTimingFunction.rb +1 -1
- data/lib/cocoa/bindings/CAOpenGLLayer.rb +2 -2
- data/lib/cocoa/bindings/CARenderer.rb +2 -2
- data/lib/cocoa/bindings/CATransaction.rb +1 -1
- data/lib/cocoa/bindings/CIImage.rb +2 -2
- data/lib/cocoa/bindings/NSATSTypesetter.rb +21 -21
- data/lib/cocoa/bindings/NSAffineTransform.rb +2 -2
- data/lib/cocoa/bindings/NSAlert.rb +2 -2
- data/lib/cocoa/bindings/NSAnimation.rb +3 -3
- data/lib/cocoa/bindings/NSAnimationContext.rb +1 -1
- data/lib/cocoa/bindings/NSAppleEventDescriptor.rb +8 -8
- data/lib/cocoa/bindings/NSAppleEventManager.rb +3 -3
- data/lib/cocoa/bindings/NSAppleScript.rb +2 -2
- data/lib/cocoa/bindings/NSApplication.rb +19 -19
- data/lib/cocoa/bindings/NSArchiver.rb +3 -3
- data/lib/cocoa/bindings/NSArray.rb +21 -21
- data/lib/cocoa/bindings/NSArrayController.rb +2 -2
- data/lib/cocoa/bindings/NSAssertionHandler.rb +2 -2
- data/lib/cocoa/bindings/NSAttributedString.rb +29 -29
- data/lib/cocoa/bindings/NSBezierPath.rb +15 -15
- data/lib/cocoa/bindings/NSBitmapImageRep.rb +16 -16
- data/lib/cocoa/bindings/NSBrowser.rb +16 -16
- data/lib/cocoa/bindings/NSBundle.rb +14 -14
- data/lib/cocoa/bindings/NSButton.rb +2 -2
- data/lib/cocoa/bindings/NSButtonCell.rb +6 -6
- data/lib/cocoa/bindings/NSByteCountFormatter.rb +1 -1
- data/lib/cocoa/bindings/NSCache.rb +1 -1
- data/lib/cocoa/bindings/NSCachedImageRep.rb +2 -2
- data/lib/cocoa/bindings/NSCachedURLResponse.rb +1 -1
- data/lib/cocoa/bindings/NSCalendar.rb +4 -4
- data/lib/cocoa/bindings/NSCalendarDate.rb +7 -7
- data/lib/cocoa/bindings/NSCell.rb +21 -21
- data/lib/cocoa/bindings/NSClassDescription.rb +1 -1
- data/lib/cocoa/bindings/NSCoder.rb +20 -20
- data/lib/cocoa/bindings/NSCollectionView.rb +3 -3
- data/lib/cocoa/bindings/NSColor.rb +17 -17
- data/lib/cocoa/bindings/NSColorList.rb +3 -3
- data/lib/cocoa/bindings/NSColorPanel.rb +1 -1
- data/lib/cocoa/bindings/NSColorPicker.rb +2 -2
- data/lib/cocoa/bindings/NSComboBox.rb +1 -1
- data/lib/cocoa/bindings/NSComboBoxCell.rb +1 -1
- data/lib/cocoa/bindings/NSComparisonPredicate.rb +2 -2
- data/lib/cocoa/bindings/NSCompoundPredicate.rb +1 -1
- data/lib/cocoa/bindings/NSConditionLock.rb +1 -1
- data/lib/cocoa/bindings/NSConnection.rb +6 -6
- data/lib/cocoa/bindings/NSControl.rb +2 -2
- data/lib/cocoa/bindings/NSController.rb +1 -1
- data/lib/cocoa/bindings/NSCursor.rb +1 -1
- data/lib/cocoa/bindings/NSCustomImageRep.rb +2 -2
- data/lib/cocoa/bindings/NSData.rb +12 -12
- data/lib/cocoa/bindings/NSDataDetector.rb +2 -2
- data/lib/cocoa/bindings/NSDate.rb +5 -5
- data/lib/cocoa/bindings/NSDateFormatter.rb +4 -4
- data/lib/cocoa/bindings/NSDecimalNumber.rb +10 -10
- data/lib/cocoa/bindings/NSDecimalNumberHandler.rb +2 -2
- data/lib/cocoa/bindings/NSDictionary.rb +12 -12
- data/lib/cocoa/bindings/NSDistantObject.rb +4 -4
- data/lib/cocoa/bindings/NSDistributedNotificationCenter.rb +3 -3
- data/lib/cocoa/bindings/NSDocument.rb +41 -41
- data/lib/cocoa/bindings/NSDocumentController.rb +16 -16
- data/lib/cocoa/bindings/NSDraggingItem.rb +1 -1
- data/lib/cocoa/bindings/NSDraggingSession.rb +1 -1
- data/lib/cocoa/bindings/NSDrawer.rb +1 -1
- data/lib/cocoa/bindings/NSError.rb +2 -2
- data/lib/cocoa/bindings/NSEvent.rb +9 -9
- data/lib/cocoa/bindings/NSException.rb +3 -3
- data/lib/cocoa/bindings/NSExpression.rb +8 -8
- data/lib/cocoa/bindings/NSFileCoordinator.rb +4 -4
- data/lib/cocoa/bindings/NSFileHandle.rb +4 -4
- data/lib/cocoa/bindings/NSFileManager.rb +39 -39
- data/lib/cocoa/bindings/NSFileVersion.rb +4 -4
- data/lib/cocoa/bindings/NSFileWrapper.rb +6 -6
- data/lib/cocoa/bindings/NSFont.rb +4 -4
- data/lib/cocoa/bindings/NSFontCollection.rb +5 -5
- data/lib/cocoa/bindings/NSFontDescriptor.rb +1 -1
- data/lib/cocoa/bindings/NSFontManager.rb +10 -10
- data/lib/cocoa/bindings/NSFontPanel.rb +1 -1
- data/lib/cocoa/bindings/NSForm.rb +1 -1
- data/lib/cocoa/bindings/NSFormatter.rb +3 -3
- data/lib/cocoa/bindings/NSGlyphGenerator.rb +1 -1
- data/lib/cocoa/bindings/NSGlyphInfo.rb +3 -3
- data/lib/cocoa/bindings/NSGradient.rb +7 -7
- data/lib/cocoa/bindings/NSGraphicsContext.rb +1 -1
- data/lib/cocoa/bindings/NSHTTPCookie.rb +1 -1
- data/lib/cocoa/bindings/NSHTTPCookieStorage.rb +1 -1
- data/lib/cocoa/bindings/NSHTTPURLResponse.rb +1 -1
- data/lib/cocoa/bindings/NSHashTable.rb +2 -2
- data/lib/cocoa/bindings/NSHelpManager.rb +4 -4
- data/lib/cocoa/bindings/NSImage.rb +11 -11
- data/lib/cocoa/bindings/NSImageRep.rb +2 -2
- data/lib/cocoa/bindings/NSIndexPath.rb +2 -2
- data/lib/cocoa/bindings/NSIndexSet.rb +9 -9
- data/lib/cocoa/bindings/NSIndexSpecifier.rb +1 -1
- data/lib/cocoa/bindings/NSInputManager.rb +2 -2
- data/lib/cocoa/bindings/NSInputServer.rb +1 -1
- data/lib/cocoa/bindings/NSInputStream.rb +2 -2
- data/lib/cocoa/bindings/NSInvocation.rb +2 -2
- data/lib/cocoa/bindings/NSInvocationOperation.rb +1 -1
- data/lib/cocoa/bindings/NSJSONSerialization.rb +4 -4
- data/lib/cocoa/bindings/NSKeyedArchiver.rb +12 -12
- data/lib/cocoa/bindings/NSKeyedUnarchiver.rb +3 -3
- data/lib/cocoa/bindings/NSLayoutConstraint.rb +2 -2
- data/lib/cocoa/bindings/NSLayoutManager.rb +59 -59
- data/lib/cocoa/bindings/NSLinguisticTagger.rb +8 -8
- data/lib/cocoa/bindings/NSLocale.rb +1 -1
- data/lib/cocoa/bindings/NSMachBootstrapServer.rb +2 -2
- data/lib/cocoa/bindings/NSMachPort.rb +4 -4
- data/lib/cocoa/bindings/NSMapTable.rb +4 -4
- data/lib/cocoa/bindings/NSMatrix.rb +20 -20
- data/lib/cocoa/bindings/NSMenu.rb +7 -7
- data/lib/cocoa/bindings/NSMenuItem.rb +1 -1
- data/lib/cocoa/bindings/NSMenuItemCell.rb +6 -6
- data/lib/cocoa/bindings/NSMessagePortNameServer.rb +1 -1
- data/lib/cocoa/bindings/NSMetadataQuery.rb +1 -1
- data/lib/cocoa/bindings/NSMutableArray.rb +12 -12
- data/lib/cocoa/bindings/NSMutableAttributedString.rb +11 -11
- data/lib/cocoa/bindings/NSMutableData.rb +2 -2
- data/lib/cocoa/bindings/NSMutableDictionary.rb +2 -2
- data/lib/cocoa/bindings/NSMutableIndexSet.rb +1 -1
- data/lib/cocoa/bindings/NSMutableOrderedSet.rb +11 -11
- data/lib/cocoa/bindings/NSMutableString.rb +3 -3
- data/lib/cocoa/bindings/NSMutableURLRequest.rb +2 -2
- data/lib/cocoa/bindings/NSNameSpecifier.rb +1 -1
- data/lib/cocoa/bindings/NSNetService.rb +4 -4
- data/lib/cocoa/bindings/NSNetServiceBrowser.rb +3 -3
- data/lib/cocoa/bindings/NSNib.rb +4 -4
- data/lib/cocoa/bindings/NSNibConnector.rb +1 -1
- data/lib/cocoa/bindings/NSNotification.rb +1 -1
- data/lib/cocoa/bindings/NSNotificationCenter.rb +4 -4
- data/lib/cocoa/bindings/NSNotificationQueue.rb +2 -2
- data/lib/cocoa/bindings/NSNumberFormatter.rb +2 -2
- data/lib/cocoa/bindings/NSObject.rb +142 -142
- data/lib/cocoa/bindings/NSObjectController.rb +1 -1
- data/lib/cocoa/bindings/NSOpenGLContext.rb +8 -8
- data/lib/cocoa/bindings/NSOpenGLLayer.rb +2 -2
- data/lib/cocoa/bindings/NSOpenGLPixelBuffer.rb +1 -1
- data/lib/cocoa/bindings/NSOpenGLPixelFormat.rb +1 -1
- data/lib/cocoa/bindings/NSOpenGLView.rb +1 -1
- data/lib/cocoa/bindings/NSOpenPanel.rb +3 -3
- data/lib/cocoa/bindings/NSOperationQueue.rb +1 -1
- data/lib/cocoa/bindings/NSOrderedSet.rb +21 -21
- data/lib/cocoa/bindings/NSOrthography.rb +2 -2
- data/lib/cocoa/bindings/NSOutlineView.rb +7 -7
- data/lib/cocoa/bindings/NSOutputStream.rb +7 -7
- data/lib/cocoa/bindings/NSPageLayout.rb +1 -1
- data/lib/cocoa/bindings/NSPasteboard.rb +9 -9
- data/lib/cocoa/bindings/NSPasteboardItem.rb +4 -4
- data/lib/cocoa/bindings/NSPathCell.rb +4 -4
- data/lib/cocoa/bindings/NSPathControl.rb +1 -1
- data/lib/cocoa/bindings/NSPersistentDocument.rb +4 -4
- data/lib/cocoa/bindings/NSPointerArray.rb +2 -2
- data/lib/cocoa/bindings/NSPopUpButton.rb +3 -3
- data/lib/cocoa/bindings/NSPopUpButtonCell.rb +5 -5
- data/lib/cocoa/bindings/NSPopover.rb +1 -1
- data/lib/cocoa/bindings/NSPort.rb +5 -5
- data/lib/cocoa/bindings/NSPortCoder.rb +2 -2
- data/lib/cocoa/bindings/NSPortMessage.rb +1 -1
- data/lib/cocoa/bindings/NSPortNameServer.rb +2 -2
- data/lib/cocoa/bindings/NSPositionalSpecifier.rb +1 -1
- data/lib/cocoa/bindings/NSPredicate.rb +2 -2
- data/lib/cocoa/bindings/NSPredicateEditorRowTemplate.rb +2 -2
- data/lib/cocoa/bindings/NSPrintOperation.rb +4 -4
- data/lib/cocoa/bindings/NSPrintPanel.rb +1 -1
- data/lib/cocoa/bindings/NSPrinter.rb +9 -9
- data/lib/cocoa/bindings/NSPropertyListSerialization.rb +7 -7
- data/lib/cocoa/bindings/NSProtocolChecker.rb +2 -2
- data/lib/cocoa/bindings/NSRangeSpecifier.rb +1 -1
- data/lib/cocoa/bindings/NSRegularExpression.rb +10 -10
- data/lib/cocoa/bindings/NSRelativeSpecifier.rb +1 -1
- data/lib/cocoa/bindings/NSResponder.rb +5 -5
- data/lib/cocoa/bindings/NSRuleEditor.rb +4 -4
- data/lib/cocoa/bindings/NSRulerMarker.rb +2 -2
- data/lib/cocoa/bindings/NSRulerView.rb +4 -4
- data/lib/cocoa/bindings/NSRunLoop.rb +7 -7
- data/lib/cocoa/bindings/NSSavePanel.rb +3 -3
- data/lib/cocoa/bindings/NSScanner.rb +4 -4
- data/lib/cocoa/bindings/NSScreen.rb +1 -1
- data/lib/cocoa/bindings/NSScriptClassDescription.rb +1 -1
- data/lib/cocoa/bindings/NSScriptCoercionHandler.rb +2 -2
- data/lib/cocoa/bindings/NSScriptCommandDescription.rb +1 -1
- data/lib/cocoa/bindings/NSScriptObjectSpecifier.rb +3 -3
- data/lib/cocoa/bindings/NSScriptSuiteRegistry.rb +2 -2
- data/lib/cocoa/bindings/NSScrollView.rb +3 -3
- data/lib/cocoa/bindings/NSScroller.rb +4 -4
- data/lib/cocoa/bindings/NSSegmentedCell.rb +10 -10
- data/lib/cocoa/bindings/NSSegmentedControl.rb +7 -7
- data/lib/cocoa/bindings/NSSet.rb +9 -9
- data/lib/cocoa/bindings/NSSharingService.rb +1 -1
- data/lib/cocoa/bindings/NSSharingServicePicker.rb +1 -1
- data/lib/cocoa/bindings/NSSliderCell.rb +1 -1
- data/lib/cocoa/bindings/NSSocketPort.rb +3 -3
- data/lib/cocoa/bindings/NSSocketPortNameServer.rb +2 -2
- data/lib/cocoa/bindings/NSSortDescriptor.rb +3 -3
- data/lib/cocoa/bindings/NSSound.rb +2 -2
- data/lib/cocoa/bindings/NSSpecifierTest.rb +1 -1
- data/lib/cocoa/bindings/NSSpeechSynthesizer.rb +3 -3
- data/lib/cocoa/bindings/NSSpellChecker.rb +15 -15
- data/lib/cocoa/bindings/NSSpellServer.rb +2 -2
- data/lib/cocoa/bindings/NSSplitView.rb +2 -2
- data/lib/cocoa/bindings/NSStatusItem.rb +1 -1
- data/lib/cocoa/bindings/NSStream.rb +4 -4
- data/lib/cocoa/bindings/NSString.rb +39 -39
- data/lib/cocoa/bindings/NSTabView.rb +1 -1
- data/lib/cocoa/bindings/NSTabViewItem.rb +1 -1
- data/lib/cocoa/bindings/NSTableHeaderCell.rb +1 -1
- data/lib/cocoa/bindings/NSTableView.rb +25 -25
- data/lib/cocoa/bindings/NSTask.rb +1 -1
- data/lib/cocoa/bindings/NSText.rb +4 -4
- data/lib/cocoa/bindings/NSTextAlternatives.rb +1 -1
- data/lib/cocoa/bindings/NSTextBlock.rb +9 -9
- data/lib/cocoa/bindings/NSTextCheckingResult.rb +12 -12
- data/lib/cocoa/bindings/NSTextContainer.rb +1 -1
- data/lib/cocoa/bindings/NSTextList.rb +1 -1
- data/lib/cocoa/bindings/NSTextStorage.rb +1 -1
- data/lib/cocoa/bindings/NSTextTab.rb +2 -2
- data/lib/cocoa/bindings/NSTextTable.rb +3 -3
- data/lib/cocoa/bindings/NSTextTableBlock.rb +1 -1
- data/lib/cocoa/bindings/NSTextView.rb +27 -27
- data/lib/cocoa/bindings/NSThread.rb +2 -2
- data/lib/cocoa/bindings/NSTimeZone.rb +3 -3
- data/lib/cocoa/bindings/NSTimer.rb +3 -3
- data/lib/cocoa/bindings/NSToolbar.rb +1 -1
- data/lib/cocoa/bindings/NSTrackingArea.rb +1 -1
- data/lib/cocoa/bindings/NSTreeController.rb +4 -4
- data/lib/cocoa/bindings/NSTreeNode.rb +1 -1
- data/lib/cocoa/bindings/NSTypesetter.rb +24 -24
- data/lib/cocoa/bindings/NSURL.rb +18 -18
- data/lib/cocoa/bindings/NSURLAuthenticationChallenge.rb +2 -2
- data/lib/cocoa/bindings/NSURLCache.rb +2 -2
- data/lib/cocoa/bindings/NSURLConnection.rb +6 -6
- data/lib/cocoa/bindings/NSURLCredential.rb +4 -4
- data/lib/cocoa/bindings/NSURLCredentialStorage.rb +3 -3
- data/lib/cocoa/bindings/NSURLDownload.rb +3 -3
- data/lib/cocoa/bindings/NSURLHandle.rb +3 -3
- data/lib/cocoa/bindings/NSURLProtectionSpace.rb +2 -2
- data/lib/cocoa/bindings/NSURLProtocol.rb +5 -5
- data/lib/cocoa/bindings/NSURLRequest.rb +2 -2
- data/lib/cocoa/bindings/NSURLResponse.rb +1 -1
- data/lib/cocoa/bindings/NSUbiquitousKeyValueStore.rb +8 -8
- data/lib/cocoa/bindings/NSUnarchiver.rb +3 -3
- data/lib/cocoa/bindings/NSUndoManager.rb +1 -1
- data/lib/cocoa/bindings/NSUniqueIDSpecifier.rb +1 -1
- data/lib/cocoa/bindings/NSUserAppleScriptTask.rb +1 -1
- data/lib/cocoa/bindings/NSUserAutomatorTask.rb +1 -1
- data/lib/cocoa/bindings/NSUserDefaults.rb +9 -9
- data/lib/cocoa/bindings/NSUserDefaultsController.rb +1 -1
- data/lib/cocoa/bindings/NSUserScriptTask.rb +1 -1
- data/lib/cocoa/bindings/NSUserUnixTask.rb +1 -1
- data/lib/cocoa/bindings/NSValue.rb +3 -3
- data/lib/cocoa/bindings/NSValueTransformer.rb +1 -1
- data/lib/cocoa/bindings/NSView.rb +34 -34
- data/lib/cocoa/bindings/NSViewController.rb +2 -2
- data/lib/cocoa/bindings/NSWhoseSpecifier.rb +1 -1
- data/lib/cocoa/bindings/NSWindow.rb +22 -22
- data/lib/cocoa/bindings/NSWindowController.rb +2 -2
- data/lib/cocoa/bindings/NSWorkspace.rb +18 -18
- data/lib/cocoa/bindings/NSXMLDTD.rb +6 -6
- data/lib/cocoa/bindings/NSXMLDocument.rb +9 -9
- data/lib/cocoa/bindings/NSXMLElement.rb +7 -7
- data/lib/cocoa/bindings/NSXMLNode.rb +8 -8
- data/lib/cocoa/bindings/NSXPCConnection.rb +1 -1
- data/lib/cocoa/bindings/NSXPCInterface.rb +4 -4
- data/lib/cocoa/extensions.rb +7 -4
- data/lib/cocoa/helpers.rb +99 -179
- data/lib/cocoa/objc.rb +63 -217
- data/lib/cocoa/objc/method_def.rb +314 -0
- data/lib/cocoa/structs/NSRange.rb +3 -0
- data/lib/cocoa/structs/NSRect.rb +3 -0
- data/spec/cocoa/cocoa_spec.rb +99 -0
- data/spec/spec_helper.rb +1 -0
- data/tasks/generate.rake +6 -4
- metadata +37 -37
|
@@ -5,8 +5,8 @@ module Cocoa
|
|
|
5
5
|
attach_method :close, :args=>0, :names=>[], :types=>[], :retval=>"v"
|
|
6
6
|
attach_method :document, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
7
7
|
attach_method :initWithWindow, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
8
|
-
attach_method :initWithWindowNibName, [{:args=>1, :names=>[], :types=>["@"], :retval=>"@"}, {:args=>2, :names=>[
|
|
9
|
-
attach_method :initWithWindowNibPath, :args=>2, :names=>[
|
|
8
|
+
attach_method :initWithWindowNibName, [{:args=>1, :names=>[], :types=>["@"], :retval=>"@"}, {:args=>2, :names=>[:owner], :types=>["@", "@"], :retval=>"@"}]
|
|
9
|
+
attach_method :initWithWindowNibPath, :args=>2, :names=>[:owner], :types=>["@", "@"], :retval=>"@"
|
|
10
10
|
attach_method :isWindowLoaded, :args=>0, :names=>[], :types=>[], :retval=>"B"
|
|
11
11
|
attach_method :loadWindow, :args=>0, :names=>[], :types=>[], :retval=>"v"
|
|
12
12
|
attach_method :owner, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
@@ -10,25 +10,25 @@ module Cocoa
|
|
|
10
10
|
attach_method :checkForRemovableMedia, :args=>0, :names=>[], :types=>[], :retval=>"v"
|
|
11
11
|
attach_method :desktopImageOptionsForScreen, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
12
12
|
attach_method :desktopImageURLForScreen, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
13
|
-
attach_method :duplicateURLs, :args=>2, :names=>[
|
|
13
|
+
attach_method :duplicateURLs, :args=>2, :names=>[:completionHandler], :types=>["@", "@?"], :retval=>"v"
|
|
14
14
|
attach_method :extendPowerOffBy, :args=>1, :names=>[], :types=>["q"], :retval=>"q"
|
|
15
15
|
attach_method :fileLabelColors, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
16
16
|
attach_method :fileLabels, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
17
17
|
attach_method :fileSystemChanged, :args=>0, :names=>[], :types=>[], :retval=>"B"
|
|
18
|
-
attach_method :filenameExtension, :args=>2, :names=>[
|
|
18
|
+
attach_method :filenameExtension, :args=>2, :names=>[:isValidForType], :types=>["@", "@"], :retval=>"B"
|
|
19
19
|
attach_method :findApplications, :args=>0, :names=>[], :types=>[], :retval=>"v"
|
|
20
20
|
attach_method :frontmostApplication, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
21
21
|
attach_method :fullPathForApplication, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
22
|
-
attach_method :getFileSystemInfoForPath, :args=>6, :names=>[
|
|
23
|
-
attach_method :getInfoForFile, :args=>3, :names=>[
|
|
22
|
+
attach_method :getFileSystemInfoForPath, :args=>6, :names=>[:isRemovable, :isWritable, :isUnmountable, :description, :type], :types=>["@", "^B", "^B", "^B", "^@", "^@"], :retval=>"B"
|
|
23
|
+
attach_method :getInfoForFile, :args=>3, :names=>[:application, :type], :types=>["@", "^@", "^@"], :retval=>"B"
|
|
24
24
|
attach_method :hideOtherApplications, :args=>0, :names=>[], :types=>[], :retval=>"v"
|
|
25
25
|
attach_method :iconForFile, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
26
26
|
attach_method :iconForFileType, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
27
27
|
attach_method :iconForFiles, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
28
28
|
attach_method :isFilePackageAtPath, :args=>1, :names=>[], :types=>["@"], :retval=>"B"
|
|
29
|
-
attach_method :launchAppWithBundleIdentifier, :args=>4, :names=>[
|
|
30
|
-
attach_method :launchApplication, [{:args=>1, :names=>[], :types=>["@"], :retval=>"B"}, {:args=>3, :names=>[
|
|
31
|
-
attach_method :launchApplicationAtURL, :args=>4, :names=>[
|
|
29
|
+
attach_method :launchAppWithBundleIdentifier, :args=>4, :names=>[:options, :additionalEventParamDescriptor, :launchIdentifier], :types=>["@", "Q", "@", "^@"], :retval=>"B"
|
|
30
|
+
attach_method :launchApplication, [{:args=>1, :names=>[], :types=>["@"], :retval=>"B"}, {:args=>3, :names=>[:showIcon, :autolaunch], :types=>["@", "B", "B"], :retval=>"B"}]
|
|
31
|
+
attach_method :launchApplicationAtURL, :args=>4, :names=>[:options, :configuration, :error], :types=>["@", "Q", "@", "^@"], :retval=>"@"
|
|
32
32
|
attach_method :launchedApplications, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
33
33
|
attach_method :localizedDescriptionForType, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
34
34
|
attach_method :menuBarOwningApplication, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
@@ -38,24 +38,24 @@ module Cocoa
|
|
|
38
38
|
attach_method :noteFileSystemChanged, [{:args=>0, :names=>[], :types=>[], :retval=>"v"}, {:args=>1, :names=>[], :types=>["@"], :retval=>"v"}]
|
|
39
39
|
attach_method :noteUserDefaultsChanged, :args=>0, :names=>[], :types=>[], :retval=>"v"
|
|
40
40
|
attach_method :notificationCenter, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
41
|
-
attach_method :openFile, [{:args=>1, :names=>[], :types=>["@"], :retval=>"B"}, {:args=>4, :names=>[
|
|
41
|
+
attach_method :openFile, [{:args=>1, :names=>[], :types=>["@"], :retval=>"B"}, {:args=>4, :names=>[:fromImage, :at, :inView], :types=>["@", "@", "{CGPoint=dd}", "@"], :retval=>"B"}, {:args=>2, :names=>[:withApplication], :types=>["@", "@"], :retval=>"B"}, {:args=>3, :names=>[:withApplication, :andDeactivate], :types=>["@", "@", "B"], :retval=>"B"}]
|
|
42
42
|
attach_method :openTempFile, :args=>1, :names=>[], :types=>["@"], :retval=>"B"
|
|
43
43
|
attach_method :openURL, :args=>1, :names=>[], :types=>["@"], :retval=>"B"
|
|
44
|
-
attach_method :openURLs, :args=>5, :names=>[
|
|
45
|
-
attach_method :performFileOperation, :args=>5, :names=>[
|
|
44
|
+
attach_method :openURLs, :args=>5, :names=>[:withAppBundleIdentifier, :options, :additionalEventParamDescriptor, :launchIdentifiers], :types=>["@", "@", "Q", "@", "^@"], :retval=>"B"
|
|
45
|
+
attach_method :performFileOperation, :args=>5, :names=>[:source, :destination, :files, :tag], :types=>["@", "@", "@", "@", "^q"], :retval=>"B"
|
|
46
46
|
attach_method :preferredFilenameExtensionForType, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
47
|
-
attach_method :recycleURLs, :args=>2, :names=>[
|
|
47
|
+
attach_method :recycleURLs, :args=>2, :names=>[:completionHandler], :types=>["@", "@?"], :retval=>"v"
|
|
48
48
|
attach_method :runningApplications, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
49
|
-
attach_method :selectFile, :args=>2, :names=>[
|
|
50
|
-
attach_method :setDesktopImageURL, :args=>4, :names=>[
|
|
51
|
-
attach_method :setIcon, :args=>3, :names=>[
|
|
49
|
+
attach_method :selectFile, :args=>2, :names=>[:inFileViewerRootedAtPath], :types=>["@", "@"], :retval=>"B"
|
|
50
|
+
attach_method :setDesktopImageURL, :args=>4, :names=>[:forScreen, :options, :error], :types=>["@", "@", "@", "^@"], :retval=>"B"
|
|
51
|
+
attach_method :setIcon, :args=>3, :names=>[:forFile, :options], :types=>["@", "@", "Q"], :retval=>"B"
|
|
52
52
|
attach_singular_method :sharedWorkspace, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
53
53
|
attach_method :showSearchResultsForQueryString, :args=>1, :names=>[], :types=>["@"], :retval=>"B"
|
|
54
|
-
attach_method :slideImage, :args=>3, :names=>[
|
|
55
|
-
attach_method :type, :args=>2, :names=>[
|
|
56
|
-
attach_method :typeOfFile, :args=>2, :names=>[
|
|
54
|
+
attach_method :slideImage, :args=>3, :names=>[:from, :to], :types=>["@", "{CGPoint=dd}", "{CGPoint=dd}"], :retval=>"v"
|
|
55
|
+
attach_method :type, :args=>2, :names=>[:conformsToType], :types=>["@", "@"], :retval=>"B"
|
|
56
|
+
attach_method :typeOfFile, :args=>2, :names=>[:error], :types=>["@", "^@"], :retval=>"@"
|
|
57
57
|
attach_method :unmountAndEjectDeviceAtPath, :args=>1, :names=>[], :types=>["@"], :retval=>"B"
|
|
58
|
-
attach_method :unmountAndEjectDeviceAtURL, :args=>2, :names=>[
|
|
58
|
+
attach_method :unmountAndEjectDeviceAtURL, :args=>2, :names=>[:error], :types=>["@", "^@"], :retval=>"B"
|
|
59
59
|
attach_method :userDefaultsChanged, :args=>0, :names=>[], :types=>[], :retval=>"B"
|
|
60
60
|
end
|
|
61
61
|
end
|
|
@@ -3,18 +3,18 @@ require 'cocoa/bindings/NSXMLNode'
|
|
|
3
3
|
module Cocoa
|
|
4
4
|
class NSXMLDTD < Cocoa::NSXMLNode
|
|
5
5
|
attach_method :addChild, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
6
|
-
attach_method :attributeDeclarationForName, :args=>2, :names=>[
|
|
6
|
+
attach_method :attributeDeclarationForName, :args=>2, :names=>[:elementName], :types=>["@", "@"], :retval=>"@"
|
|
7
7
|
attach_method :elementDeclarationForName, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
8
8
|
attach_method :entityDeclarationForName, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
9
|
-
attach_method :initWithContentsOfURL, :args=>3, :names=>[
|
|
10
|
-
attach_method :initWithData, :args=>3, :names=>[
|
|
11
|
-
attach_method :insertChild, :args=>2, :names=>[
|
|
12
|
-
attach_method :insertChildren, :args=>2, :names=>[
|
|
9
|
+
attach_method :initWithContentsOfURL, :args=>3, :names=>[:options, :error], :types=>["@", "Q", "^@"], :retval=>"@"
|
|
10
|
+
attach_method :initWithData, :args=>3, :names=>[:options, :error], :types=>["@", "Q", "^@"], :retval=>"@"
|
|
11
|
+
attach_method :insertChild, :args=>2, :names=>[:atIndex], :types=>["@", "Q"], :retval=>"v"
|
|
12
|
+
attach_method :insertChildren, :args=>2, :names=>[:atIndex], :types=>["@", "Q"], :retval=>"v"
|
|
13
13
|
attach_method :notationDeclarationForName, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
14
14
|
attach_singular_method :predefinedEntityDeclarationForName, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
15
15
|
attach_method :publicID, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
16
16
|
attach_method :removeChildAtIndex, :args=>1, :names=>[], :types=>["Q"], :retval=>"v"
|
|
17
|
-
attach_method :replaceChildAtIndex, :args=>2, :names=>[
|
|
17
|
+
attach_method :replaceChildAtIndex, :args=>2, :names=>[:withNode], :types=>["Q", "@"], :retval=>"v"
|
|
18
18
|
attach_method :setChildren, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
19
19
|
attach_method :setPublicID, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
20
20
|
attach_method :setSystemID, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
@@ -9,18 +9,18 @@ module Cocoa
|
|
|
9
9
|
attach_method :addChild, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
10
10
|
attach_method :characterEncoding, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
11
11
|
attach_method :documentContentKind, :args=>0, :names=>[], :types=>[], :retval=>"Q"
|
|
12
|
-
attach_method :initWithContentsOfURL, :args=>3, :names=>[
|
|
13
|
-
attach_method :initWithData, :args=>3, :names=>[
|
|
12
|
+
attach_method :initWithContentsOfURL, :args=>3, :names=>[:options, :error], :types=>["@", "Q", "^@"], :retval=>"@"
|
|
13
|
+
attach_method :initWithData, :args=>3, :names=>[:options, :error], :types=>["@", "Q", "^@"], :retval=>"@"
|
|
14
14
|
attach_method :initWithRootElement, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
15
|
-
attach_method :initWithXMLString, :args=>3, :names=>[
|
|
16
|
-
attach_method :insertChild, :args=>2, :names=>[
|
|
17
|
-
attach_method :insertChildren, :args=>2, :names=>[
|
|
15
|
+
attach_method :initWithXMLString, :args=>3, :names=>[:options, :error], :types=>["@", "Q", "^@"], :retval=>"@"
|
|
16
|
+
attach_method :insertChild, :args=>2, :names=>[:atIndex], :types=>["@", "Q"], :retval=>"v"
|
|
17
|
+
attach_method :insertChildren, :args=>2, :names=>[:atIndex], :types=>["@", "Q"], :retval=>"v"
|
|
18
18
|
attach_method :isStandalone, :args=>0, :names=>[], :types=>[], :retval=>"B"
|
|
19
|
-
attach_method :objectByApplyingXSLT, :args=>3, :names=>[
|
|
20
|
-
attach_method :objectByApplyingXSLTAtURL, :args=>3, :names=>[
|
|
21
|
-
attach_method :objectByApplyingXSLTString, :args=>3, :names=>[
|
|
19
|
+
attach_method :objectByApplyingXSLT, :args=>3, :names=>[:arguments, :error], :types=>["@", "@", "^@"], :retval=>"@"
|
|
20
|
+
attach_method :objectByApplyingXSLTAtURL, :args=>3, :names=>[:arguments, :error], :types=>["@", "@", "^@"], :retval=>"@"
|
|
21
|
+
attach_method :objectByApplyingXSLTString, :args=>3, :names=>[:arguments, :error], :types=>["@", "@", "^@"], :retval=>"@"
|
|
22
22
|
attach_method :removeChildAtIndex, :args=>1, :names=>[], :types=>["Q"], :retval=>"v"
|
|
23
|
-
attach_method :replaceChildAtIndex, :args=>2, :names=>[
|
|
23
|
+
attach_method :replaceChildAtIndex, :args=>2, :names=>[:withNode], :types=>["Q", "@"], :retval=>"v"
|
|
24
24
|
attach_singular_method :replacementClassForClass, :args=>1, :names=>[], :types=>["#"], :retval=>"#"
|
|
25
25
|
attach_method :rootElement, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
26
26
|
attach_method :setCharacterEncoding, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
@@ -5,22 +5,22 @@ module Cocoa
|
|
|
5
5
|
attach_method :addAttribute, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
6
6
|
attach_method :addChild, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
7
7
|
attach_method :addNamespace, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
8
|
-
attach_method :attributeForLocalName, :args=>2, :names=>[
|
|
8
|
+
attach_method :attributeForLocalName, :args=>2, :names=>[:URI], :types=>["@", "@"], :retval=>"@"
|
|
9
9
|
attach_method :attributeForName, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
10
10
|
attach_method :attributes, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
11
|
-
attach_method :elementsForLocalName, :args=>2, :names=>[
|
|
11
|
+
attach_method :elementsForLocalName, :args=>2, :names=>[:URI], :types=>["@", "@"], :retval=>"@"
|
|
12
12
|
attach_method :elementsForName, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
13
|
-
attach_method :initWithName, [{:args=>1, :names=>[], :types=>["@"], :retval=>"@"}, {:args=>2, :names=>[
|
|
14
|
-
attach_method :initWithXMLString, :args=>2, :names=>[
|
|
15
|
-
attach_method :insertChild, :args=>2, :names=>[
|
|
16
|
-
attach_method :insertChildren, :args=>2, :names=>[
|
|
13
|
+
attach_method :initWithName, [{:args=>1, :names=>[], :types=>["@"], :retval=>"@"}, {:args=>2, :names=>[:URI], :types=>["@", "@"], :retval=>"@"}, {:args=>2, :names=>[:stringValue], :types=>["@", "@"], :retval=>"@"}]
|
|
14
|
+
attach_method :initWithXMLString, :args=>2, :names=>[:error], :types=>["@", "^@"], :retval=>"@"
|
|
15
|
+
attach_method :insertChild, :args=>2, :names=>[:atIndex], :types=>["@", "Q"], :retval=>"v"
|
|
16
|
+
attach_method :insertChildren, :args=>2, :names=>[:atIndex], :types=>["@", "Q"], :retval=>"v"
|
|
17
17
|
attach_method :namespaceForPrefix, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
18
18
|
attach_method :namespaces, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
19
19
|
attach_method :normalizeAdjacentTextNodesPreservingCDATA, :args=>1, :names=>[], :types=>["B"], :retval=>"v"
|
|
20
20
|
attach_method :removeAttributeForName, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
21
21
|
attach_method :removeChildAtIndex, :args=>1, :names=>[], :types=>["Q"], :retval=>"v"
|
|
22
22
|
attach_method :removeNamespaceForPrefix, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
23
|
-
attach_method :replaceChildAtIndex, :args=>2, :names=>[
|
|
23
|
+
attach_method :replaceChildAtIndex, :args=>2, :names=>[:withNode], :types=>["Q", "@"], :retval=>"v"
|
|
24
24
|
attach_method :resolveNamespaceForName, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
25
25
|
attach_method :resolvePrefixForNamespaceURI, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
26
26
|
attach_method :setAttributes, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
@@ -7,7 +7,7 @@ module Cocoa
|
|
|
7
7
|
attach_method :XMLString, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
8
8
|
attach_method :XMLStringWithOptions, :args=>1, :names=>[], :types=>["Q"], :retval=>"@"
|
|
9
9
|
attach_method :XPath, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
10
|
-
attach_singular_method :attributeWithName, [{:args=>3, :names=>[
|
|
10
|
+
attach_singular_method :attributeWithName, [{:args=>3, :names=>[:URI, :stringValue], :types=>["@", "@", "@"], :retval=>"@"}, {:args=>2, :names=>[:stringValue], :types=>["@", "@"], :retval=>"@"}]
|
|
11
11
|
attach_method :canonicalXMLStringPreservingComments, :args=>1, :names=>[], :types=>["B"], :retval=>"@"
|
|
12
12
|
attach_method :childAtIndex, :args=>1, :names=>[], :types=>["Q"], :retval=>"@"
|
|
13
13
|
attach_method :childCount, :args=>0, :names=>[], :types=>[], :retval=>"Q"
|
|
@@ -17,31 +17,31 @@ module Cocoa
|
|
|
17
17
|
attach_method :detach, :args=>0, :names=>[], :types=>[], :retval=>"v"
|
|
18
18
|
attach_singular_method :document, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
19
19
|
attach_singular_method :documentWithRootElement, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
20
|
-
attach_singular_method :elementWithName, [{:args=>1, :names=>[], :types=>["@"], :retval=>"@"}, {:args=>2, :names=>[
|
|
20
|
+
attach_singular_method :elementWithName, [{:args=>1, :names=>[], :types=>["@"], :retval=>"@"}, {:args=>2, :names=>[:URI], :types=>["@", "@"], :retval=>"@"}, {:args=>3, :names=>[:children, :attributes], :types=>["@", "@", "@"], :retval=>"@"}, {:args=>2, :names=>[:stringValue], :types=>["@", "@"], :retval=>"@"}]
|
|
21
21
|
attach_method :index, :args=>0, :names=>[], :types=>[], :retval=>"Q"
|
|
22
|
-
attach_method :initWithKind, [{:args=>1, :names=>[], :types=>["Q"], :retval=>"@"}, {:args=>2, :names=>[
|
|
22
|
+
attach_method :initWithKind, [{:args=>1, :names=>[], :types=>["Q"], :retval=>"@"}, {:args=>2, :names=>[:options], :types=>["Q", "Q"], :retval=>"@"}]
|
|
23
23
|
attach_method :kind, :args=>0, :names=>[], :types=>[], :retval=>"Q"
|
|
24
24
|
attach_method :level, :args=>0, :names=>[], :types=>[], :retval=>"Q"
|
|
25
25
|
attach_method :localName, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
26
26
|
attach_singular_method :localNameForName, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
27
27
|
attach_method :name, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
28
|
-
attach_singular_method :namespaceWithName, :args=>2, :names=>[
|
|
28
|
+
attach_singular_method :namespaceWithName, :args=>2, :names=>[:stringValue], :types=>["@", "@"], :retval=>"@"
|
|
29
29
|
attach_method :nextNode, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
30
30
|
attach_method :nextSibling, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
31
|
-
attach_method :nodesForXPath, :args=>2, :names=>[
|
|
31
|
+
attach_method :nodesForXPath, :args=>2, :names=>[:error], :types=>["@", "^@"], :retval=>"@"
|
|
32
32
|
attach_method :objectValue, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
33
|
-
attach_method :objectsForXQuery, [{:args=>3, :names=>[
|
|
33
|
+
attach_method :objectsForXQuery, [{:args=>3, :names=>[:constants, :error], :types=>["@", "@", "^@"], :retval=>"@"}, {:args=>2, :names=>[:error], :types=>["@", "^@"], :retval=>"@"}]
|
|
34
34
|
attach_method :parent, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
35
35
|
attach_singular_method :predefinedNamespaceForPrefix, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
36
36
|
attach_method :prefix, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
37
37
|
attach_singular_method :prefixForName, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
38
38
|
attach_method :previousNode, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
39
39
|
attach_method :previousSibling, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
40
|
-
attach_singular_method :processingInstructionWithName, :args=>2, :names=>[
|
|
40
|
+
attach_singular_method :processingInstructionWithName, :args=>2, :names=>[:stringValue], :types=>["@", "@"], :retval=>"@"
|
|
41
41
|
attach_method :rootDocument, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
42
42
|
attach_method :setName, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
43
43
|
attach_method :setObjectValue, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
44
|
-
attach_method :setStringValue, [{:args=>1, :names=>[], :types=>["@"], :retval=>"v"}, {:args=>2, :names=>[
|
|
44
|
+
attach_method :setStringValue, [{:args=>1, :names=>[], :types=>["@"], :retval=>"v"}, {:args=>2, :names=>[:resolvingEntities], :types=>["@", "B"], :retval=>"v"}]
|
|
45
45
|
attach_method :setURI, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
46
46
|
attach_method :stringValue, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
47
47
|
attach_singular_method :textWithStringValue, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
@@ -9,7 +9,7 @@ module Cocoa
|
|
|
9
9
|
attach_method :exportedInterface, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
10
10
|
attach_method :exportedObject, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
11
11
|
attach_method :initWithListenerEndpoint, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
12
|
-
attach_method :initWithMachServiceName, :args=>2, :names=>[
|
|
12
|
+
attach_method :initWithMachServiceName, :args=>2, :names=>[:options], :types=>["@", "Q"], :retval=>"@"
|
|
13
13
|
attach_method :initWithServiceName, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
14
14
|
attach_method :interruptionHandler, :args=>0, :names=>[], :types=>[], :retval=>"@?"
|
|
15
15
|
attach_method :invalidate, :args=>0, :names=>[], :types=>[], :retval=>"v"
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
require 'cocoa/bindings/NSObject'
|
|
3
3
|
module Cocoa
|
|
4
4
|
class NSXPCInterface < Cocoa::NSObject
|
|
5
|
-
attach_method :classesForSelector, :args=>3, :names=>[
|
|
6
|
-
attach_method :interfaceForSelector, :args=>3, :names=>[
|
|
5
|
+
attach_method :classesForSelector, :args=>3, :names=>[:argumentIndex, :ofReply], :types=>[":", "Q", "B"], :retval=>"@"
|
|
6
|
+
attach_method :interfaceForSelector, :args=>3, :names=>[:argumentIndex, :ofReply], :types=>[":", "Q", "B"], :retval=>"@"
|
|
7
7
|
attach_singular_method :interfaceWithProtocol, :args=>1, :names=>[], :types=>["@"], :retval=>"@"
|
|
8
8
|
attach_method :protocol, :args=>0, :names=>[], :types=>[], :retval=>"@"
|
|
9
|
-
attach_method :setClasses, :args=>4, :names=>[
|
|
10
|
-
attach_method :setInterface, :args=>4, :names=>[
|
|
9
|
+
attach_method :setClasses, :args=>4, :names=>[:forSelector, :argumentIndex, :ofReply], :types=>["@", ":", "Q", "B"], :retval=>"v"
|
|
10
|
+
attach_method :setInterface, :args=>4, :names=>[:forSelector, :argumentIndex, :ofReply], :types=>["@", ":", "Q", "B"], :retval=>"v"
|
|
11
11
|
attach_method :setProtocol, :args=>1, :names=>[], :types=>["@"], :retval=>"v"
|
|
12
12
|
end
|
|
13
13
|
end
|
data/lib/cocoa/extensions.rb
CHANGED
|
@@ -2,6 +2,9 @@ class Cocoa::NSString < Cocoa::NSObject
|
|
|
2
2
|
def to_s
|
|
3
3
|
ObjC.NSString_to_String(object)
|
|
4
4
|
end
|
|
5
|
+
def == other
|
|
6
|
+
to_s == other.to_s
|
|
7
|
+
end
|
|
5
8
|
end
|
|
6
9
|
|
|
7
10
|
class String
|
|
@@ -46,22 +49,22 @@ class Cocoa::NSObject
|
|
|
46
49
|
end
|
|
47
50
|
|
|
48
51
|
def alloc
|
|
49
|
-
self.object = ObjC.
|
|
52
|
+
self.object = ObjC.msgSend_pointer(ObjC.objc_getClass(self.native_name),"alloc")
|
|
50
53
|
self
|
|
51
54
|
end
|
|
52
55
|
|
|
53
56
|
def init
|
|
54
|
-
self.object = ObjC.
|
|
57
|
+
self.object = ObjC.msgSend_pointer(@object,"init")
|
|
55
58
|
self
|
|
56
59
|
end
|
|
57
60
|
|
|
58
61
|
def new
|
|
59
|
-
self.object = ObjC.
|
|
62
|
+
self.object = ObjC.msgSend_pointer(@object,"new")
|
|
60
63
|
self
|
|
61
64
|
end
|
|
62
65
|
|
|
63
66
|
def autorelease
|
|
64
|
-
self.object = ObjC.
|
|
67
|
+
self.object = ObjC.msgSend_pointer(@object,"autorelease")
|
|
65
68
|
self
|
|
66
69
|
end
|
|
67
70
|
|
data/lib/cocoa/helpers.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Cocoa
|
|
|
16
16
|
end
|
|
17
17
|
def instance_for data
|
|
18
18
|
if data.is_a?(FFI::Pointer)
|
|
19
|
-
@@instances[data.address] ||= ObjC.
|
|
19
|
+
@@instances[data.address] ||= ObjC.ffi_to_ruby_value(nil, data, '@')
|
|
20
20
|
else
|
|
21
21
|
data
|
|
22
22
|
end
|
|
@@ -29,7 +29,7 @@ module Cocoa
|
|
|
29
29
|
Cocoa.const_set(method,ObjC.NSString_to_String(send(raw)))
|
|
30
30
|
else
|
|
31
31
|
define_singleton_method method do
|
|
32
|
-
|
|
32
|
+
ObjC.NSString_to_String(send(raw))
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
end
|
|
@@ -40,7 +40,7 @@ module Cocoa
|
|
|
40
40
|
if params[:args] == 0
|
|
41
41
|
define_singleton_method method do
|
|
42
42
|
instance = new(true)
|
|
43
|
-
instance.object = ObjC.
|
|
43
|
+
instance.object = ObjC.msgSend_pointer(instance.klass,method.to_s)
|
|
44
44
|
instance
|
|
45
45
|
end
|
|
46
46
|
else
|
|
@@ -55,175 +55,99 @@ module Cocoa
|
|
|
55
55
|
params = params.last
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
m = ObjC::MethodDef.new(method,params.first)
|
|
59
|
+
|
|
58
60
|
params = params.extract_options!
|
|
59
61
|
params.freeze
|
|
60
62
|
begin
|
|
61
63
|
if params[:args] == 0
|
|
62
|
-
attach_function "call_#{method}".to_sym, method,
|
|
64
|
+
attach_function "call_#{method}".to_sym, method, m.ffi_types, m.ffi_return_type
|
|
63
65
|
define_method method do
|
|
64
|
-
|
|
65
|
-
when /^\^{[^=]*=.*}$/
|
|
66
|
-
Cocoa::translate_retval(method,send("call_#{method}".to_sym),params[:retval])
|
|
67
|
-
else
|
|
68
|
-
raise params.inspect
|
|
69
|
-
end
|
|
66
|
+
m.ruby_return_value(send("call_#{method}".to_sym))
|
|
70
67
|
end
|
|
71
68
|
else
|
|
72
|
-
attach_function "call_#{method}".to_sym, method,
|
|
69
|
+
attach_function "call_#{method}".to_sym, method, m.ffi_types, m.ffi_return_type
|
|
73
70
|
define_method method do |*args|
|
|
74
71
|
raise ArgumentError.new("#{method} requires #{params[:args]} argument(s)") unless params[:args] == args.size
|
|
75
|
-
|
|
76
|
-
if params[:retval]=='v'
|
|
77
|
-
self
|
|
78
|
-
else
|
|
79
|
-
ObjC.translate_retval(method,ret,params[:retval])
|
|
80
|
-
end
|
|
72
|
+
m.ruby_return_value(self,send("call_#{method}".to_sym,*m.call_arguments(args)))
|
|
81
73
|
end
|
|
82
74
|
end
|
|
83
75
|
rescue FFI::NotFoundError => e
|
|
84
76
|
end
|
|
85
77
|
end
|
|
78
|
+
|
|
86
79
|
extend self
|
|
87
80
|
|
|
88
81
|
class NSObject
|
|
89
82
|
attr_accessor :klass
|
|
90
83
|
attr_reader :object
|
|
91
84
|
|
|
92
|
-
def self.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
smart_constantize(_superclass,superclass_name)
|
|
102
|
-
end
|
|
103
|
-
proxy = Class.new(superclass)
|
|
104
|
-
Cocoa.const_set(klass_name, proxy)
|
|
105
|
-
klass = ("Cocoa::"+klass_name).constantize
|
|
106
|
-
superclass.inherited(klass)
|
|
107
|
-
klass
|
|
85
|
+
def self.attach_singular_method method,*__params
|
|
86
|
+
return if method == :superclass
|
|
87
|
+
return if method == :class
|
|
88
|
+
return if method == :new
|
|
89
|
+
|
|
90
|
+
@@singular_specs ||= {}
|
|
91
|
+
@@singular_specs[method] = []
|
|
92
|
+
[__params].flatten.each do |spec|
|
|
93
|
+
@@singular_specs[method] << ObjC::MethodDef.new(method,spec)
|
|
108
94
|
end
|
|
109
|
-
end
|
|
110
95
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if __params.first.is_a?(Hash) && __params.first[:args] == 0
|
|
116
|
-
define_singleton_method method do
|
|
117
|
-
instance = new(true)
|
|
118
|
-
instance.object = ObjC.msgSend(instance.klass,method.to_s)
|
|
119
|
-
instance
|
|
120
|
-
end
|
|
121
|
-
else
|
|
122
|
-
_params = [__params.dup].flatten
|
|
123
|
-
_params.freeze
|
|
124
|
-
define_singleton_method method do |*args|
|
|
125
|
-
par = if _params.size == 1 && _params.first[:variadic]
|
|
126
|
-
_params
|
|
127
|
-
else
|
|
128
|
-
_params.select{ |par| (par[:args] == 1 && args.size == 1) || (par[:args] == args.last.size+1 && par[:names].map(&:to_sym).sort == args.last.keys.sort) }
|
|
96
|
+
define_singleton_method method do |*args|
|
|
97
|
+
matching = if args.size <= 1
|
|
98
|
+
matching = @@singular_specs[method].select do |m|
|
|
99
|
+
m.types.size == args.size
|
|
129
100
|
end
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
raise "not yet supported" unless params[:types].size == 1
|
|
136
|
-
NSObject.fixed_args(args,options,params[:types],params)
|
|
101
|
+
else
|
|
102
|
+
matching = if args.last.is_a? Hash
|
|
103
|
+
@@singular_specs[method].select do |m|
|
|
104
|
+
args.last.keys == m.names
|
|
105
|
+
end
|
|
137
106
|
else
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
else
|
|
148
|
-
raise params[:retval]
|
|
107
|
+
if args.size == 1
|
|
108
|
+
@@singular_specs[method].select do |m|
|
|
109
|
+
m.types.size == 1
|
|
110
|
+
end
|
|
111
|
+
else
|
|
112
|
+
@@singular_specs[method].select do |m|
|
|
113
|
+
m.variadic? && m.types.size == 1
|
|
114
|
+
end
|
|
115
|
+
end
|
|
149
116
|
end
|
|
150
117
|
end
|
|
118
|
+
raise "hell" unless matching.size == 1
|
|
119
|
+
m = matching.first
|
|
120
|
+
m.call(self,ObjC.objc_getClass(name.split('::').last),*args)
|
|
151
121
|
end
|
|
152
122
|
end
|
|
153
123
|
|
|
154
124
|
def self.attach_method method,*_params
|
|
155
125
|
return if method==:class
|
|
156
126
|
@@method_specs ||= {}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
@@method_specs[method] = params
|
|
166
|
-
|
|
167
|
-
options = args.extract_options!
|
|
168
|
-
fixed_args = ObjC.fixed_args(args,options,params[:types])
|
|
169
|
-
# puts "ObjC.msgSend(@object,\"#{method}:#{params[:names].join(':')}:\",#{fixed_args.inspect})"
|
|
170
|
-
ObjC.msgSend(@object,"#{method}#{(['']+params[:names]).join(':')}:",*fixed_args)
|
|
171
|
-
self
|
|
172
|
-
else
|
|
173
|
-
params = _params.select{ |par| par[:args] == 1 }
|
|
174
|
-
raise ArgumentError unless params.size == 1
|
|
175
|
-
@@method_specs[method] = params
|
|
176
|
-
|
|
177
|
-
fixed_args = ObjC.fixed_args(args)
|
|
178
|
-
# puts "ObjC.msgSend(#{@object.inspect},#{method},#{fixed_args.inspect})"
|
|
179
|
-
ObjC.msgSend(@object,"#{method}:",*fixed_args)
|
|
180
|
-
self
|
|
181
|
-
end
|
|
182
|
-
end
|
|
183
|
-
else
|
|
184
|
-
params = _params.extract_options!
|
|
185
|
-
@@method_specs[method] = params
|
|
186
|
-
if params[:args] == 0
|
|
187
|
-
params.freeze
|
|
188
|
-
define_method method do
|
|
189
|
-
case params[:retval]
|
|
190
|
-
when '@'
|
|
191
|
-
ObjC.translate_retval(method,ObjC.msgSend(@object,method.to_s),params[:retval])
|
|
192
|
-
when 'v'
|
|
193
|
-
ObjC.msgSend(@object,method.to_s)
|
|
194
|
-
self
|
|
195
|
-
when '^v'
|
|
196
|
-
ObjC.msgSend(@object,method.to_s)
|
|
197
|
-
when 'Q', 'q'
|
|
198
|
-
ObjC.msgSend(@object,method.to_s).address
|
|
199
|
-
when 'B'
|
|
200
|
-
ret = ObjC.msgSend(@object,method.to_s)
|
|
201
|
-
ret.address ? true : false
|
|
202
|
-
when /^{([^=]*)=.*}$/
|
|
203
|
-
ObjC.msgSend_stret($1.constantize,@object,method.to_s)
|
|
204
|
-
when /^\^{([^=]*)=.*}$/
|
|
205
|
-
ret = ObjC.msgSend(@object,method.to_s)
|
|
206
|
-
ObjC.object_to_instance(ret)
|
|
207
|
-
when '*'
|
|
208
|
-
ObjC.msgSend(@object,method.to_s).read_string
|
|
209
|
-
else
|
|
210
|
-
puts params.inspect
|
|
211
|
-
raise params[:retval]
|
|
212
|
-
end
|
|
127
|
+
@@method_specs[method] = []
|
|
128
|
+
[_params].flatten.each do |spec|
|
|
129
|
+
@@method_specs[method] << ObjC::MethodDef.new(method,spec)
|
|
130
|
+
end
|
|
131
|
+
define_method method do |*args|
|
|
132
|
+
matching = if args.size <= 1
|
|
133
|
+
matching = @@method_specs[method].select do |m|
|
|
134
|
+
m.types.size == args.size
|
|
213
135
|
end
|
|
214
136
|
else
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
self
|
|
137
|
+
matching = if args.last.is_a? Hash
|
|
138
|
+
@@method_specs[method].select do |m|
|
|
139
|
+
args.last.keys == m.names
|
|
140
|
+
end
|
|
141
|
+
else
|
|
142
|
+
raise "hell" unless args.size == 1
|
|
143
|
+
@@method_specs[method].select do |m|
|
|
144
|
+
m.types.size == 1
|
|
224
145
|
end
|
|
225
146
|
end
|
|
226
147
|
end
|
|
148
|
+
raise "hell" unless matching.size == 1
|
|
149
|
+
m = matching.first
|
|
150
|
+
m.call(self,@object,*args)
|
|
227
151
|
end
|
|
228
152
|
end
|
|
229
153
|
|
|
@@ -232,62 +156,58 @@ module Cocoa
|
|
|
232
156
|
@object = obj
|
|
233
157
|
end
|
|
234
158
|
|
|
235
|
-
def self.
|
|
236
|
-
return
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
else
|
|
244
|
-
raise type
|
|
159
|
+
def self.method_defs method
|
|
160
|
+
return nil unless @@method_specs[method]
|
|
161
|
+
params = instance_method(method).parameters
|
|
162
|
+
keys = params.select{ |param| param.first == :key }.map{ |param| param.last }
|
|
163
|
+
if params.size > 0 && params.last.first == :rest
|
|
164
|
+
filtered = @@method_specs[method].select do |m|
|
|
165
|
+
((m.types.size == 0 && keys.size == 0) || (m.types.size > keys.size)) &&
|
|
166
|
+
(m.names[0,keys.size-1] || []) == keys
|
|
245
167
|
end
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
def self.ffi_return_type method
|
|
250
|
-
return :void unless @@method_specs[method] # own method probably
|
|
251
|
-
case @@method_specs[method][:retval]
|
|
252
|
-
when nil
|
|
253
|
-
:void
|
|
254
|
-
when 'v'
|
|
255
|
-
:void
|
|
256
|
-
when '@'
|
|
257
|
-
:pointer
|
|
168
|
+
return nil if filtered.size == 0
|
|
169
|
+
filtered
|
|
258
170
|
else
|
|
259
|
-
|
|
171
|
+
filtered = @@method_specs[method].select do |m|
|
|
172
|
+
((m.types.size == 0 && keys.size == 0) || (m.types.size == keys.size+1)) &&
|
|
173
|
+
m.names == keys
|
|
174
|
+
end
|
|
175
|
+
return nil if filtered.size == 0
|
|
176
|
+
raise filtered.inspect unless filtered.size == 1
|
|
177
|
+
filtered.first
|
|
260
178
|
end
|
|
261
179
|
end
|
|
262
180
|
|
|
263
|
-
def self.objc_argument_types method
|
|
264
|
-
#"@:^{CGRect={CGPoint=dd}{CGSize=dd}}@"
|
|
265
|
-
return 'v@:@' unless @@method_specs[method] # own method probably TODO: @v: + @ times argument count
|
|
266
|
-
ObjC.objc_type(@@method_specs[method][:retval],'v')+'@:'+@@method_specs[method][:types].map{ |type| ObjC.objc_type(type) }.join
|
|
267
|
-
end
|
|
268
|
-
|
|
269
181
|
def self.method_added(name)
|
|
182
|
+
return if name == :== # TODO: define as equals or something?
|
|
183
|
+
return if name.to_s[-1] == '='
|
|
270
184
|
return if caller.first.split('`').last[0..-2] == 'define_method' # MRI
|
|
271
185
|
return if caller.first.split('`').last[0..-2] == 'attach_method' # Rubinius
|
|
272
|
-
method_definition = "#{self.name.gsub('::','__')}_#{name}".to_sym
|
|
273
|
-
add_method = "add_#{method_definition}".to_sym
|
|
274
186
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
187
|
+
defs = method_defs name
|
|
188
|
+
defs ||= ObjC::MethodDef.new(name, :names => [], :types => ['@'], :retval => 'v') # TODO: generate from method arguments!
|
|
189
|
+
|
|
190
|
+
[defs].flatten.each do |m|
|
|
191
|
+
@callbacks ||= []
|
|
192
|
+
@callbacks << Proc.new do |this,cmd,*args|
|
|
193
|
+
begin
|
|
194
|
+
instance = Cocoa.instances[this.address]
|
|
195
|
+
params = instance_method(name).parameters
|
|
196
|
+
m.callback(instance,params,args)
|
|
197
|
+
rescue => e
|
|
198
|
+
puts e.message
|
|
199
|
+
puts e.backtrace
|
|
200
|
+
end
|
|
284
201
|
end
|
|
285
|
-
end
|
|
286
202
|
|
|
287
|
-
|
|
288
|
-
|
|
203
|
+
callback_name = "#{self.name.gsub('::','__')}_#{m.selector.gsub(/:/,'_')}".to_sym
|
|
204
|
+
add_method = "add_#{callback_name}".to_sym
|
|
289
205
|
|
|
290
|
-
|
|
206
|
+
ObjC.callback callback_name, [:pointer, :pointer]+m.ffi_types, m.ffi_return_type
|
|
207
|
+
ObjC.attach_function add_method, :class_addMethod, [:pointer,:pointer,callback_name,:string], :void
|
|
208
|
+
|
|
209
|
+
ObjC.send(add_method,ObjC.objc_getClass(self.name.split('::').last),ObjC.sel_registerName(m.selector),@callbacks.last,m.objc_types)
|
|
210
|
+
end
|
|
291
211
|
end
|
|
292
212
|
end
|
|
293
213
|
end
|